#include <bits/stdc++.h>
using namespace std;
const int N = 2E5 + 10, MOD = 998244353;
inline char nc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
long long read() {
  long long x = 0, f = 1;
  char ch = nc();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = nc();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = nc();
    ;
  }
  return x * f;
}
long long pow(long long x, int n) {
  long long ret = 1;
  for (; n; n >>= 1, x = (x * x) % MOD)
    if (n & 1) ret = (ret * x) % MOD;
  return ret;
}
int n, m, a[N], l[N];
long long p;
int main() {
  n = read(), m = read(), p = read();
  for (int i = 1; i <= m; i++) a[i] = read();
  for (int i = 1; i <= m; i++) l[i] = a[i] - a[i - 1];
  long long ans = 1;
  for (int i = 1; i <= m; i++) {
    long long s = pow(p, l[i]);
    ans = ans * (s * (s + 1) / 2 % MOD) % MOD;
  }
  ans = ans * pow(p, n - a[m] * 2) % MOD;
  printf("%I64d", ans);
}
