#include using namespace std; typedef long long ll; template ostream &operator<<(ostream &io, vector a) { io << "{"; for (auto I:a)io << I << " "; io << "}"; return io; } template ostream &operator<<(ostream &io, set a) { io << "{"; for (auto I:a)io << I << " "; io << "}"; return io; } template ostream &operator<<(ostream &io, map a) { io << "("; for (auto I:a)io << "{" << I.first << ":" << I.second << "}"; io << ")"; return io; } void debug_out() { cerr << endl; } template void debug_out(Head H, Tail... T) { cerr << ' ' << H; debug_out(T...); } #ifdef local #define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__) #else #define debug(...) 55 #endif #define all(x) x.begin(),x.end() mt19937_64 Rand(123456); ll Range(ll l, ll r) { return l + Rand() % (r - l + 1); } //a+b a-b //2*a 2*b const int mod = 998244353; ll power(ll a,ll b){ ll res = 1; while(b){ if(b&1)res=res*a%mod; a=a*a%mod; b>>=1; } return res; } int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); #ifdef local freopen("../in.txt", "r", stdin); #endif int _;cin>>_; while(_--){ ll a,b,k;cin>>a>>b>>k; a = a*power(2,k/2)%mod; b = b*power(2 ,(k/2))%mod; if(k&1){ ll c = a, d = b; a = (c+d+mod)%mod; b = (c-d+mod)%mod; } cout<< a<< ' '<