#include <bits/stdc++.h>
#define endl '\n'
using namespace std;

const int MAXN = 1e6;
const int mod = 998244353;
int dp[MAXN];

int main ()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int n, m, k;
    cin >> n >> m >> k;

    if (k == 1)
    {
        int ans = 1;
        for (int i = 0; i < m; i++)
            ans = (ans * n) % mod;
        cout << ans << endl;
        return 0;
    }
//    else if (k == 2)
//    {
//
//    }

    dp[0] = 1;
    for (int i = 1; i <= n; i++)
    {
        dp[i] = dp[i-1];
        dp[i] = dp[i] * m % mod;
        for (int j = 1; j <= k; j++)
        {
            int jind = i + j - 1;

        }
    }

    cout << dp[n] << endl;

    return 0;
}
/***

3 2 2
6

*/

