#include #include #include #include #include using namespace std; const long long mod=998244353; typedef long long ll; ll power(ll a,ll b) { ll ans=1,base=a; while(b!=0) { if(b&1) ans=((ans%mod)*(base%mod))%mod; base=((base%mod)*(base%mod))%mod; b>>=1; } return ans%mod; } int main() { ll t; cin>>t; while(t--) { ll a,b,k; cin>>a>>b>>k; if(k%2==0) { if(k==0) { cout<