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.OutputStream;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.io.Closeable;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) throws Exception {
        Thread thread = new Thread(null, new TaskAdapter(), "", 1 << 27);
        thread.start();
        thread.join();
    }

    static class TaskAdapter implements Runnable {
        @Override
        public void run() {
            InputStream inputStream = System.in;
            OutputStream outputStream = System.out;
            FastInput in = new FastInput(inputStream);
            FastOutput out = new FastOutput(outputStream);
            FVasyaAndArray solver = new FVasyaAndArray();
            solver.solve(1, in, out);
            out.close();
        }
    }

    static class FVasyaAndArray {
        Modular mod = new Modular(998244353);

        public void solve(int testNumber, FastInput in, FastOutput out) {
            int n = in.readInt();
            int k = in.readInt();
            int len = in.readInt();

            int[] s = new int[n];
            for (int i = 0; i < n; i++) {
                s[i] = in.readInt();
            }

            if (len == 1) {
                out.println(0);
                return;
            }

            RotateVersionArray[] deques = new RotateVersionArray[k + 1];
            for (int i = 1; i <= k; i++) {
                deques[i] = new RotateVersionArray(len);
            }

            int[] sum = new int[k + 1];
            int[] oneVal = new int[k + 1];
            if (s[0] == -1) {
                for (int i = 1; i <= k; i++) {
                    deques[i].set(1, 1);
                    sum[i] = 1;
                }
            } else {
                deques[s[0]].set(1, 1);
                sum[s[0]] = 1;
            }


            for (int i = 1; i < n; i++) {
                int total = sumOf(sum, 1, k);

                if (s[i] == -1) {
                    for (int j = 1; j <= k; j++) {
                        oneVal[j] = mod.subtract(total, sum[j]);
                    }
                    for (int j = 1; j <= k; j++) {
                        sum[j] = mod.subtract(sum[j], deques[j].get(len - 1));
                        deques[j].rotate();
                        deques[j].set(1, oneVal[j]);
                        sum[j] = mod.plus(sum[j], oneVal[j]);
                    }
                } else {
                    int j = s[i];
                    oneVal[j] = mod.subtract(total, sum[j]);
                    sum[j] = mod.subtract(sum[j], deques[j].get(len - 1));
                    deques[j].rotate();
                    deques[j].set(1, oneVal[j]);
                    sum[j] = mod.plus(sum[j], oneVal[j]);

                    for (int t = 1; t <= k; t++) {
                        if (t != j) {
                            deques[t].clear();
                            sum[t] = 0;
                        }
                    }
                }
            }

            int ans = sumOf(sum, 1, k);
            out.println(ans);
        }

        public int sumOf(int[] sum, int l, int r) {
            long ans = 0;
            for (int i = l; i <= r; i++) {
                ans += sum[i];
            }
            return mod.valueOf(ans);
        }

    }

    static class RotateVersionArray {
        private int offset;
        private IntVersionArray va;
        private int n;

        public RotateVersionArray(int n) {
            va = new IntVersionArray(n);
            this.n = n;
        }

        public void rotate() {
            offset--;
            if (offset < 0) {
                offset += n;
            }
        }

        public int get(int i) {
            return va.get((i + offset) % n);
        }

        public void clear() {
            va.clear();
        }

        public void set(int i, int val) {
            va.set((i + offset) % n, val);
        }

        public String toString() {
            StringBuilder builder = new StringBuilder();
            for (int i = 1; i < n; i++) {
                builder.append(get(i)).append(',');
            }
            if (builder.length() > 0) {
                builder.setLength(builder.length() - 1);
            }
            return builder.toString();
        }

    }

    static class Modular {
        int m;

        public Modular(int m) {
            this.m = m;
        }

        public Modular(long m) {
            this.m = (int) m;
            if (this.m != m) {
                throw new IllegalArgumentException();
            }
        }

        public Modular(double m) {
            this.m = (int) m;
            if (this.m != m) {
                throw new IllegalArgumentException();
            }
        }

        public int valueOf(int x) {
            x %= m;
            if (x < 0) {
                x += m;
            }
            return x;
        }

        public int valueOf(long x) {
            x %= m;
            if (x < 0) {
                x += m;
            }
            return (int) x;
        }

        public int plus(int x, int y) {
            return valueOf(x + y);
        }

        public int subtract(int x, int y) {
            return valueOf(x - y);
        }

        public String toString() {
            return "mod " + m;
        }

    }

    static class FastInput {
        private final InputStream is;
        private byte[] buf = new byte[1 << 13];
        private int bufLen;
        private int bufOffset;
        private int next;

        public FastInput(InputStream is) {
            this.is = is;
        }

        private int read() {
            while (bufLen == bufOffset) {
                bufOffset = 0;
                try {
                    bufLen = is.read(buf);
                } catch (IOException e) {
                    bufLen = -1;
                }
                if (bufLen == -1) {
                    return -1;
                }
            }
            return buf[bufOffset++];
        }

        public void skipBlank() {
            while (next >= 0 && next <= 32) {
                next = read();
            }
        }

        public int readInt() {
            int sign = 1;

            skipBlank();
            if (next == '+' || next == '-') {
                sign = next == '+' ? 1 : -1;
                next = read();
            }

            int val = 0;
            if (sign == 1) {
                while (next >= '0' && next <= '9') {
                    val = val * 10 + next - '0';
                    next = read();
                }
            } else {
                while (next >= '0' && next <= '9') {
                    val = val * 10 - next + '0';
                    next = read();
                }
            }

            return val;
        }

    }

    static class FastOutput implements AutoCloseable, Closeable {
        private StringBuilder cache = new StringBuilder(10 << 20);
        private final Writer os;

        public FastOutput(Writer os) {
            this.os = os;
        }

        public FastOutput(OutputStream os) {
            this(new OutputStreamWriter(os));
        }

        public FastOutput println(int c) {
            cache.append(c).append('\n');
            return this;
        }

        public FastOutput flush() {
            try {
                os.append(cache);
                os.flush();
                cache.setLength(0);
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
            return this;
        }

        public void close() {
            flush();
            try {
                os.close();
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        }

        public String toString() {
            return cache.toString();
        }

    }

    static class IntVersionArray {
        int[] data;
        int[] version;
        int now;
        int def;

        public IntVersionArray(int cap) {
            this(cap, 0);
        }

        public IntVersionArray(int cap, int def) {
            data = new int[cap];
            version = new int[cap];
            now = 0;
            this.def = def;
        }

        public void clear() {
            now++;
        }

        public void visit(int i) {
            if (version[i] < now) {
                version[i] = now;
                data[i] = def;
            }
        }

        public void set(int i, int v) {
            version[i] = now;
            data[i] = v;
        }

        public int get(int i) {
            visit(i);
            return data[i];
        }

    }
}

