#include<bits/stdc++.h> using namespace std; using ll = long long; #define rep(i,n) for(int i=0;i<n;i++) #define all(A) A.begin(),A.end() #include<atcoder/modint> using namespace atcoder; using mint = modint998244353; vector<mint> fact, factinv, inv; const ll mod = 998244353; void prenCkModp(ll n) { fact.resize(n + 5); factinv.resize(n + 5); inv.resize(n + 5); fact[0] = fact[1] = 1; factinv[0] = factinv[1] = 1; inv[1] = 1; for (ll i = 2; i < n + 5; i++) { fact[i] = (fact[i - 1] * i); inv[i] = mod - (inv[mod % i] * (mod / i)); factinv[i] = (factinv[i - 1] * inv[i]); } } mint nCk(ll n, ll k) { if (n < k||k<0) return 0; return fact[n] * (factinv[k] * factinv[n - k]); } using vm=vector<mint>; using vvm=vector<vm>; vvm mul(vvm A,vvm B){ int N=A.size(); int M=B.size(); int R=B[0].size(); vvm C(N,vm(R,0)); rep(i,N)rep(j,R)rep(k,M)C[i][j]+=A[i][k]*B[k][j]; return C; } vvm pow(vvm A,ll N){ int n=A.size(); vvm R(n,vm(n,0)); rep(j,n)R[j][j]=1; while(N>0){ if(N%2==1){ R=mul(R,A); } A=mul(A,A); N/=2; } return R; } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); ll X,Y,N; cin>>X>>Y>>N; vvm P(4,vm(4,0)); P[0][0]=X; P[0][1]=-5*Y; P[1][0]=Y; P[1][1]=X; P[2][0]=P[2][2]=P[3][1]=P[3][3]=1; vvm R=pow(P,N); vvm A={{X},{Y},{0},{0}}; R=mul(R,A); cout<<R[2][0].val()<<" "<<R[3][0].val()<<endl; }