#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
template <typename... Args>
void db(Args... args) {}
long long qpow(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % MOD;
    a = a * a % MOD;
    b /= 2;
  }
  return res;
}
long long inv(long long x) { return qpow(x, MOD - 2); }
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long N, M, A;
  cin >> N >> M >> A;
  vector<long long> vect;
  long long may = 0;
  for (long long i = 0; i < M; i++) {
    long long n;
    cin >> n;
    may = max(may, n);
    vect.push_back(n);
  }
  vect.push_back(0);
  sort(vect.begin(), vect.end());
  long long tot = may + (N - may * 2);
  vector<long long> dif;
  for (long long i = 1; i < vect.size(); i++) {
    if (vect[i] - vect[i - 1]) dif.push_back(vect[i] - vect[i - 1]);
  }
  long long temp = 1;
  for (long long i = 0; i < dif.size(); i++) {
    temp =
        (((temp * ((qpow(A, dif[i]) + MOD - 1) % MOD) % MOD) * inv(2)) % MOD +
         temp) %
        MOD;
  }
  cout << temp * qpow(A, tot) % MOD << '\n';
  return 0;
}
