#include<cstdio> usingnamespace std; template <classType> voidread(Type &x) { char c; bool flag = false; while ((c = getchar()) < '0' || c > '9') flag |= c == '-'; x = c - '0'; while ((c = getchar()) >= '0' && c <= '9') x = (x << 3) + (x << 1) + c - '0'; if (flag) x = ~x + 1; } template <classType, class ...Rest> voidread(Type &x, Rest &...y){ read(x); read(y...); } template <classType> voidwrite(Type x) { if (x < 0) putchar('-'), x = ~x + 1; if (x > 9) write(x / 10); putchar('0' + x % 10); } typedeflonglong LL; constint N = 5e5 + 10, mod = 19491001; int n, m, d, fact[N], ifact[N]; intbinpow(int b, int k = mod - 2) { int res = 1; for (; k; k >>= 1, b = (LL)b * b % mod) if (k & 1) res = (LL)res * b % mod; return res; } voidinit() { fact[0] = ifact[0] = 1; for (int i = 1; i < N; ++i) fact[i] = (LL)fact[i - 1] * i % mod; ifact[N - 1] = binpow(fact[N - 1]); for (int i = N - 1; i; --i) ifact[i - 1] = (LL)ifact[i] * i % mod; } intC(int a, int b){ return a < b ? 0 : (LL)fact[a] * ifact[b] % mod * ifact[a - b] % mod; } intmain() { init(); read(n, m, d); if (d == 1) returnwrite(binpow(m, n)), 0; if (d == 2) { int res = 0; for (int i = 0; i <= m; ++i) res = (res + (LL)C(m, i) * binpow(i + i - m, n)) % mod; write(((LL)res * binpow(2, -m + mod - 1) % mod + mod) % mod); } elseif (d == 3) { int w = binpow(7, (mod - 1) / 3), res = 0; for (int i = 0; i <= m; ++i) for (int j = 0; j <= i; ++j) res = (res + (LL)C(m, i) * C(i, j) % mod * binpow(m - i + (j + (LL)w * (i - j) % mod) * w % mod, n)) % mod; write(((LL)res * binpow(3, -m + mod - 1) % mod + mod) % mod); } return0; }