#include <bits/stdc++.h>
using namespace std;
const int M = 998244353;
const int N = 200000 + 10;
struct re {
  int x, y;
};
long long n, s, res;
int m, b[N];
set<int> p;
long long pw(long long x, long long y) {
  if (y == 0) return 1;
  long long res = pw(x, y / 2);
  res = res * res % M;
  if (y % 2) res = res * x % M;
  return res;
}
int main() {
  cin >> n >> m >> s;
  res = 1;
  for (int i = (1); (i <= (m)); ++i) {
    cin >> b[i];
    p.insert(b[i]);
  }
  int j = 0;
  for (int i : p) {
    int g = i - j;
    j = i;
    long long tmp = pw(s, g);
    res = res * (((tmp - 1) * tmp / 2 + tmp) % M) % M;
    n -= g * 2;
  }
  res = res * pw(s, n) % M;
  cout << res;
}
