#include <bits/stdc++.h>
using namespace std;
const long long mod = 998244353;
long long p(long long i, long long j) {
  long long ans = 1;
  for (; j; j >>= 1, (i *= i) %= mod)
    if (j & 1) (ans *= i) %= mod;
  return ans;
}
long long inv(long long i) { return p(i, mod - 2); }
long long s(long long i, long long l, long long r) {
  return (p(i, r + 1) - p(i, l)) % mod * inv(i - 1) % mod;
}
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  int a[m];
  for (int &i : a) cin >> i;
  int tmp = 0;
  long long ans = 1, b = 1ll * (k - 1) * k / 2 % mod;
  for (int i : a) {
    ans = (s(k, i - tmp - 1, 2 * (i - tmp - 1)) * b % mod + p(k, i - tmp)) %
          mod * ans % mod;
    tmp = i;
  }
  (ans *= p(k, n - 2 * tmp)) %= mod;
  if (ans < 0) ans += mod;
  cout << ans;
}
