#include #include #include #include #include #include using namespace std; typedef long long ll; const int mod=998244353; //const int maxn=; namespace IO{ char buf[1<<20],*P1=buf,*P2=buf; #define gc() getchar() //#define gc() (P1==P2&&(P2=(P1=buf)+fread(buf,1,1<<20,stdin),P1==P2)?EOF:*P1++) #define TT templateinline TT void read(T&x) { x=0;register char c=gc();register bool f=0; while(c<48||c>57){f^=c=='-',c=gc();} while(47>=1; a=a*a%mod; } return ans; } int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int t; cin>>t; while(t--) { ll a,b,k; cin>>a>>b>>k; if(k%2==0)cout<