#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
long long mul(long long a, long long b) { return (a * b) % MOD; }
long long bin_pow(long long a, long long p) {
  if (p == 0) return 1;
  long long ans = bin_pow(mul(a, a), p / 2);
  if (p % 2) ans = mul(ans, a);
  return ans;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m, a;
  cin >> n >> m >> a;
  vector<long long> b(m + 1);
  b[0] = 0;
  for (long long i = 0; i < m; i++) cin >> b[i + 1];
  long long ans = 1;
  for (long long i = 0; i < (long long)(b).size() - 1; i++) {
    long long seg = b[i + 1] - b[i];
    long long p = bin_pow(a, seg);
    long long p1 = (p * (p - 1) / 2) % MOD;
    long long delta = (p1 + p) % MOD;
    ans = mul(ans, delta);
  }
  long long ost = n - b.back() * 2;
  ans = mul(ans, bin_pow(a, ost));
  cout << ans;
  return 0;
}
