#include <bits/stdc++.h>
typedef long long ll;
const int mod = 998244353;

ll step( int x, int st ){
    if( st == 0 ) return 1;
    return ( step( x, st-1 ) * x ) % mod;
}

int main () {

    int n, m, k;
    std::cin>>n>>m>>k;
    if( k == 1 ){
        std::cout<<step( m, n )<<"\n";
    }

    return 0;
}
