#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
int fast_power(int a, int n) {
  if (a == 0) return 0;
  if (n == 0) return 1;
  long long x = fast_power(a, n / 2);
  x = (x * x) % MOD;
  if (n & 1) return (a * x) % MOD;
  return x;
}
int main() {
  int n, m, s;
  cin >> n >> m >> s;
  vector<int> b(m);
  for (int i = 0; i < m; i++) cin >> b[i];
  int l = n - 2 * b[m - 1];
  for (int i = m - 1; i > 0; i--) b[i] -= b[i - 1];
  s %= MOD;
  l %= (MOD - 1);
  for (int i = 0; i < m; i++) b[i] %= (MOD - 1);
  long long tot = fast_power(s, l);
  for (int i = 0; i < m; i++) {
    long long val = fast_power(s, b[i]);
    val = ((val * (val + 1)) / 2) % MOD;
    tot = (tot * val) % MOD;
  }
  cout << tot << endl;
  return 0;
}
