#include using namespace std; const int mod = 998244353; int fsp(int x, int k) { int s = 1; while(k) { if(k & 1) s = 1LL * s * x % mod; x = 1LL * x * x % mod, k >>= 1; } return s; } int main() { int T; scanf("%d", &T); while(T--) { int a, b, k; scanf("%d%d%d", &a, &b, &k); int mul = fsp(2, k >> 1); if(k & 1) printf("%lld %lld\n", 1LL * (a + b) * mul % mod, 1LL * (a + mod - b) * mul % mod); else printf("%lld %lld\n", 1LL * a * mul % mod, 1LL * b * mul % mod); } return 0; }