#include <bits/stdc++.h>
using namespace std;
const long long MODULO = 998244353;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int length, numberOfOptions, alphabets;
  cin >> length >> numberOfOptions >> alphabets;
  vector<int> options(numberOfOptions);
  for (int i = 0; i < numberOfOptions; i++) {
    cin >> options[i];
  }
  vector<int> chunks(numberOfOptions);
  chunks[0] = options[0];
  for (int i = 1; i < numberOfOptions; i++) {
    chunks[i] = options[i] - options[i - 1];
  }
  int leftChunk = length - options.back() * 2;
  int powerLength = max(*max_element(chunks.begin(), chunks.end()), leftChunk);
  vector<long long> alphabetPowerPowerIndexes;
  vector<long long> powerIndexes;
  alphabetPowerPowerIndexes.push_back(alphabets);
  powerIndexes.push_back(1);
  for (int twoPowerI = 2; twoPowerI <= powerLength; twoPowerI *= 2) {
    alphabetPowerPowerIndexes.push_back(alphabetPowerPowerIndexes.back() *
                                        alphabetPowerPowerIndexes.back() %
                                        (MODULO * 2));
    powerIndexes.push_back(twoPowerI);
  }
  long long answer = 1;
  for (const int &chunk : chunks) {
    long long alphabetPowerChunk = 1LL;
    int left = chunk;
    for (int i = alphabetPowerPowerIndexes.size() - 1; i >= 0; i--) {
      if (powerIndexes[i] <= left) {
        left -= powerIndexes[i];
        alphabetPowerChunk *= alphabetPowerPowerIndexes[i];
        alphabetPowerChunk %= MODULO * 2;
      }
    }
    long long alphabetPowerChunkTimesTwo =
        alphabetPowerChunk * alphabetPowerChunk % (MODULO * 2);
    answer *= (alphabetPowerChunkTimesTwo + alphabetPowerChunk) / 2 % MODULO;
    answer %= MODULO;
  }
  long long alphabetPowerLeftChunk = 1LL;
  int left = leftChunk;
  for (int i = alphabetPowerPowerIndexes.size() - 1; i >= 0; i--) {
    if (powerIndexes[i] <= left) {
      left -= powerIndexes[i];
      alphabetPowerLeftChunk *= alphabetPowerPowerIndexes[i];
      alphabetPowerLeftChunk %= MODULO;
    }
  }
  answer *= alphabetPowerLeftChunk;
  answer %= MODULO;
  cout << answer << endl;
  return 0;
}
