#include #include #define int long long using namespace std; typedef long long ll; const int p=998244353; int n; ll qmi(int a,int b){ int res=1; while(b){ if(b&1) res=res*a%p; b>>=1; a=a*a%p; } return res; } signed main(){ cin.tie(0)->sync_with_stdio(false); while(cin>>n){ while(n--){ int a,b,k; cin>>a>>b>>k; if(k==0) cout<<(a%p)<<" "<<(b%p)<