#include<bits/stdc++.h>
using  namespace std;
typedef long long  ll;
#define p (long long)(1e9+7)
#define  _(i,a,n) for(int i=a;i<n;i++)

ll solve(ll a,ll b)
{
a%=1000000;
    ll r=1;
    while (b)
    {
        if (b&1)
            r=(r*a)%3000000000;
        a=(a*a)%3000000000;
        b>>= 1;
    }
    return r;
}
int main()
{
    ll a,b,c;
    cin>>a>>b>>c;
    a%=10;
    b=solve(b,c);
    a=solve(a,b);
    cout<<a%10<<endl;
    return 0;
}


#include <iostream>
using namespace std;
long long mod=998244353;
int llpow(long long a,long long b){
  long long r;
  if(b==0)r=1;
  else if(b==1)r=a%mod;
  else if(b%2==1){
    r=llpow(a,b-1)*a;
    r%=mod;
  }else{
    r=llpow(a,b/2);
    r*=r;
    r%=mod;
  }
  if(r<0)r+=mod;
  return r;
}
int main(){
  long long N,M,K;
  cin>>N>>M>>K;
  long long ans=0;
  long long t;
  if(N>=2&&M>=2){
    for(long long i=1;i<=K;++i){
      t=(llpow(i,N)-llpow(i-1,N))%mod;
      ans+=(t*llpow(K-i+1,M))%mod;
    }
  }else if(N==1||M==1){
    ans=llpow(K,N+M-1);
  }
  ans%=mod;
  if(ans<0)ans+=mod;
  cout<<ans<<endl;
  return 0;
}