Vasya has got an array consisting of n integers, and two integers k and len in addition. All numbers in the array are either between 1 and k (inclusive), or equal to -1. The array is good if there is no segment of len consecutive equal numbers.

Vasya will replace each -1 with some number from 1 to k (inclusive) in such a way that the resulting array is good. Tell him the number of ways to do this replacement. Since the answer may be large, print it modulo 998244353.

Input

The first line contains three integers n, k and len (1 ≤ n ≤ 10^5, 1 ≤ k ≤ 100, 1 ≤ len ≤ n).

The second line contains n numbers — the array. Each number is either -1 or between 1 and k (inclusive).

Output

Print one integer — the number of ways to replace each -1 with some number from 1 to k (inclusive) so the array is good. The answer may be large, so print it modulo 998244353.

Examples

Input


5 2 3
1 -1 1 -1 2


Output


2


Input


6 3 2
1 1 -1 -1 -1 -1


Output


0


Input


10 42 7
-1 -1 -1 -1 -1 -1 -1 -1 -1 -1


Output


645711643

Note

Possible answers in the first test: 

  1. [1, 2, 1, 1, 2]; 
  2. [1, 2, 1, 2, 2]. 



There is no way to make the array good in the second test, since first two elements are equal.

There are too many answers in the third test, so we won't describe any of them.
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.util.ArrayDeque;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        VasyaAndArray solver = new VasyaAndArray();
        solver.solve(1, in, out);
        out.close();
    }

    static class VasyaAndArray {
        ArrayDeque<Long>[] dp;
        long tot = 1;
        long[] sums;
        int len;
        long MOD = 998244353;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int N = in.nextInt();
            int K = in.nextInt();
            len = in.nextInt();
            dp = new ArrayDeque[K + 1];
            for (int i = 0; i <= K; i++) {
                dp[i] = new ArrayDeque<>();
            }
            dp[0].add(1L);
            tot = 1;
            sums = new long[K + 1];
            sums[0] = 1;
            for (int i = 0; i < N; i++) {
                int a = in.nextInt();
                tot = 0;
                for (int j = 0; j <= K; j++) {
                    tot = add(tot, sums[j]);
                }
                if (a == -1) {
                    dp[0].clear();
                    sums[0] = 0;
                    for (int j = 1; j <= K; j++) {
                        upd(j);
                    }
                } else {
                    upd(a);
                    for (int j = 0; j <= K; j++) {
                        if (j != a) {
                            sums[j] = 0;
                            dp[j].clear();
                        }
                    }
                }
            }
            tot = 0;
            for (int j = 0; j <= K; j++) {
                tot = add(tot, sums[j]);
            }
            out.println(tot);
        }

        long add(long a, long b) {
            long res = a + b;
            if (res >= MOD) {
                res -= MOD;
            }
            return res;
        }

        long sub(long a, long b) {
            long res = a - b;
            if (res < 0) {
                res += MOD;
            }
            return res;
        }

        void upd(int i) {
            dp[i].addFirst((tot - sums[i] < 0 ? tot - sums[i] + MOD : tot - sums[i]));
            sums[i] = add(sums[i], dp[i].getFirst());
            if (dp[i].size() == len) {
                sums[i] = sub(sums[i], dp[i].pollLast());
            }
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

