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.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Vasya {

    private static StringTokenizer ST;
    private static BufferedReader BR;
    private static PrintWriter PW;

    private static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    private static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    private static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    private static String next() throws IOException {
        while (ST == null || !ST.hasMoreTokens())
            ST = new StringTokenizer(BR.readLine());
        return ST.nextToken();
    }

    private static int N;
    private static int K;
    private static int LEN;
    private static int[] input;
    private static long[][] G;
    private static long[] SUM;
    private static int M = 998244353;
    private static BIT S_BIT;
    private static BIT[] BIT_LIST;
    private static int[] ZEROS;


    private long calc(int x, int y) {
        long ret = 0;
        if (x < LEN) {
            ret += SUM[x - 1];
        } else {
            int des = x - 1;
            int start = Math.max(ZEROS[y], x - LEN + 1);
            long SS = S_BIT.ask(start - 1, des);
            ret += SS;
            long MS = BIT_LIST[y - 1].ask(start - 1, des);
            ret -= MS;
        }
        ret %= M;
        if (ret < 0)
            ret += M;
        return ret;
    }

    public long run2(int n, int k, int len, int[] in) {
        N = n;
        K = k;
        LEN = len;
        input = in;
        G = new long[K + 1][N + 1];
        SUM = new long[N + 1];
        S_BIT = new BIT(n);
        BIT_LIST = new BIT[k];
        ZEROS = new int[k + 1];
        for (int i = 0; i < k; i++) {
            BIT_LIST[i] = new BIT(n);
        }
        SUM[0] = 1;
        for (int i = 1; i <= N; i++) {
            int num = input[i - 1];
            if (num != -1) {
                G[num][i] = calc(i, num);
                for (int j = 1; j <= K; j++) {
                    if (j != num) {
                        ZEROS[j] = i;
                    }
                }
            } else {
                long[][] last = new long[2][2];
                last[0][0] = last[1][0] = -1;
                for (int j = 1; j <= K; j++) {
                    int zj = ZEROS[j];
                    if (last[0][0] == zj) {
                        G[j][i] = last[0][1];
                    } else if (last[1][0] == zj) {
                        G[j][i] = last[1][1];
                    } else if (last[0][0] == -1) {
                        G[j][i] = calc(i, j);
                        last[0][0] = zj;
                        last[0][1] = G[j][i];
                    } else {
                        G[j][i] = calc(i, j);
                        last[1][0] = zj;
                        last[1][1] = G[j][i];
                    }
                }
            }
            for (int j = 1; j <= k; j++) {
                BIT_LIST[j - 1].change(i, G[j][i]);
                SUM[i] += G[j][i];
                if (SUM[i] > M) {
                    SUM[i] %= M;
                }
            }
            S_BIT.change(i, SUM[i]);
        }



        /*
        for (int i = 1; i <= k; i++) {
            for (int j = 1; j <= n && j < 100; j++) {
                System.out.print(G[i][j]);
                System.out.print("\t");
            }
            System.out.println();
        }
        for (int i = 1; i <= n; i++) {
            System.out.print(SUM[i] + " ");
        }
        System.out.println();
        */
        return SUM[n];
    }

    private void run() throws IOException {
        BR = new BufferedReader(new InputStreamReader(System.in));
        PW = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        int n = nextInt();
        int k = nextInt();
        int len = nextInt();
        int[] in = new int[n];
        for (int i = 0; i < n; i++) {
            in[i] = nextInt();
        }
        long res = run2(n, k, len, in);
        PW.println(res);
        PW.close();

    }

    class BIT {

        long[] t;
        int n;

        public BIT(int n) {
            init(n);
        }

        private void init(int n) {
            this.t = new long[n * 2 + 1];
            this.n = n;
        }

        private void change(int x, long p) {
            if (p == 0) {
                return;
            }
            while (x <= n) {
                t[x] += p;
                if (t[x] > M) {
                    t[x] %= M;
                }
                x += lowBit(x);
            }
        }

        private long sum(int k) {
            int ans = 0;
            while (k > 0) {
                ans += t[k];
                if (ans > M) {
                    ans %= M;
                }
                k -= lowBit(k);
            }
            return ans;
        }

        long ask(int i, int r) {
            return (sum(r) - sum(i)) % M;
        }

        int lowBit(int a) {
            return a & -a;
        }

    }

    public static void main(String[] args) throws IOException {

        /*
        int n = 100000;
        int k = 100;
        int len = 50000;
        int[] in = new int[n];
        Arrays.fill(in, -1);
        for (int i = 5; i < n; i += 5000) {
            in[i] = i % 97 + 1;
        }
        long ts = System.currentTimeMillis();
        System.out.println(new Vasya().run2(n, k, len, in));
        long use = System.currentTimeMillis() - ts;
        System.out.println(use);
        */
        new Vasya().run();
    }
}
