#include #include #include #include #include #include #include using namespace std; #define ll long long const int maxn=1e5+10; const ll mod=998244353; ll mul(ll a,ll b) { ll y=1; while (b) { if (b&1) { y=y*a%mod; } a=a*a%mod; b>>=1; } return y; } int main() { int t; ll a,b,times; scanf("%d",&t); while (t--) { scanf("%lld%lld%lld",&a,&b,×); if (times&1) { printf("%lld %lld\n",(a+b)*mul(2ll,times/2)%mod , (a-b+mod)*mul(2ll,times/2)%mod); } else { printf("%lld %lld\n",a*mul(2ll,times/2)%mod , b*mul(2ll,times/2)%mod); } } return 0; }