#include<cstdio>
const int mod=998244353;
long long cqpow(long long bas,int fur)
{
	long long res=1;
	while(fur)
	{
		if(fur&1)	res=res*bas%mod;
		bas=bas*bas%mod;
		fur>>=1;
	}
	return res;
}
int n,m,k;
long long ans;
int main()
{
	scanf("%d %d %d",&n,&m,&k);
	if(n==1)	ans=cqpow(k,m);
	else if(m==1)	ans=cqpow(k,n);
	else
	{
		for(int i=1;i<=k;++i)	ans=(ans+((cqpow(i,n)-cqpow(i-1,n)+mod)%mod)*cqpow(k-i+1,m)%mod)%mod;
	}
	printf("%lld\n",ans);
	return 0;
}
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define For(i,a,b,c) for(ll i=a;i<b;i+=c)
#define For2(i,a,b,c) for(ll i=a;i>=b;i-=c)
#define vec_ll vector<vector<ll>>
#define vec_pr vector<pair<ll,ll>>
#define p_ll pair<ll,ll>
#define pbk push_back
#define mkpr make_pair
#define fst first
#define snd second
 
void print(ll *arr, ll n){
    For(i,0,n,1)cout<<arr[i]<<" ";
    cout<<"\n";
}
 
void print_vec(vector<ll> &vec, ll n){
    For(i,0,n,1)cout<<vec[i]<<" ";
    cout<<"\n";
}
 
 
bool s_sec(const pair<ll,ll> &a, const pair<ll,ll> &b) {
    return (a.second < b.second);
}
 
ll fast_expo(ll a, ll x, ll p){
    //cout<<a<<" ";
    ll curr=a;
    ll ans=1;
    while(x!=0){
        if(x%2==1){
            ans=(ans*curr)%p;
        }
        x/=2;
        curr=(curr*curr)%p;
    }
    return ans;
}
 
//
ll calc_pow(ll base, ll expo){
	ll ans=1;
	For(i,0,expo,1)ans*=base;
	return ans;
}

//
 
 
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    ll p=1000000007;
    
    //Find the primes
    /*vector<ll> prime;
    ll len=0;
    prime.pbk(2);
    prime.pbk(3);
    len=2;
    For(i,5,448,1){
    	ll ptr=0;
    	ll root=sqrt(i);
    	bool poss=true;
    	
    	while(prime[ptr]<=root){
    		if(i%prime[ptr]==0){
    			poss=false;
    			break;
    		}
    		ptr++;
    	}
    	
    	if(poss==true){
    		prime.pbk(i);
    		len++;
		}
    }
    */
    
	ll N,P;
	cin>>N>>P;
	
	//Algorithm
	ll ans=(P-1);
	ans=(ans*fast_expo(P-2,N-1,p))%p;
	
	//Output
	cout<<ans;
}

