/*                                                       
  /^--^\                                                 
  \____/                                                 
 /      \ _____  _ __  __ ____  _     ____   ____  _____ 
|        || ()_)| |\ \/ /| ===|| |__ / (__` / () \|_   _|
 \__  __/ |_|   |_|/_/\_\|____||____|\____)/__/\__\ |_|  
|^|^\ \^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|^|
| | |\ \| | | | | | | | | | | | | | | | | | | | | | | | |
#####/ /#################################################
| | |\/ | | | | | | | | | | | | | | | | | | | | | | | | |
|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|*/
#pragma GCC optimize("O4,unroll-loops,no-stack-protector")
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ull=unsigned long long;
using pii=pair<ll,ll>;
#define int ll
#define double long double

#define For(i,a,b)  for(int i=a;i<=b;i++)
#define Forr(i,a,b) for(int i=a;i>=b;i--)
#define F first
#define S second
#define L(id) (id<<1)
#define R(id) (id<<1|1)
#define LO(x) (x&(-x))

#define eb emplace_back
#define all(x) x.begin(),x.end()
#define sz(x) ((int)x.size())
#define mkp make_pair

#define MOD (ll)(998244353)
#define INF (ll)(1e15)
#define EPS (1e-6)

#ifdef LOCALMEOW
#define debug(...) do{\
	cerr << __PRETTY_FUNCTION__ << " - " << __LINE__ <<\
	" : ("#__VA_ARGS__ << ") = ";\
	_OUT(__VA_ARGS__);\
}while(0)
template<typename T> void _OUT(T x) { cerr << x << "\n"; }
template<typename T,typename...I>
void _OUT(T x,I ...tail) { cerr << x << ", "; _OUT(tail...); }
#else
#define debug(...)
#endif
inline void IOS(){ ios::sync_with_stdio(false); cin.tie(0); }

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
int gcd(int a,int b) { return b==0?a:gcd(b,a%b); }
int lcm(int a,int b) { return a/gcd(a,b)*b; }
int fpow(int b,int p){
	int ans=1,now=b;
	while(p){
		if(p&1) ans=ans*now%MOD;
		p/=2; now=now*now%MOD;
	}
	return ans;
}
void minify(int &a,int b) { if(b<a) a=b; }
void maxify(int &a,int b) { if(b>a) a=b; }

int32_t main(){
	IOS();
	//code...
	int n,m,k; cin>>n>>m>>k;
	if(n==1){
		cout<<fpow(k,m)<<"\n";
		return 0;
	}
	if(m==1){
		cout<<fpow(k,n)<<"\n";
		return 0;
	}
	int ans=0;
	For(i,1,k) ans=(ans+fpow(k-i+1,m)*(fpow(i,n)-fpow(i-1,n)))%MOD;
	cout<<(ans+MOD)%MOD<<"\n";
	return 0;
}
#include <bits/stdc++.h>
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
	int a, b, c;
	std::cin >> a >> b >> c;
	a %= 10;
	int roundTime = 2, t = a * a % 10;
	while (t != a) {
		t *= a;
		t %= 10;
		roundTime++;
	}
	roundTime--;
	int r = 1;
	while (c) {
		if (c & 1) {
			r = (i64)r * b % roundTime;
		}
		b = (i64)b * b % roundTime;
		c /= 2;
	}
	if (!r) r = roundTime;
	t = 1;
	while (r--) {
		t *= a;
		t %= 10;
	}
	std::cout << t << "\n";
	return 0;
}