Problem: Grigory loves strings. Recently he found a metal strip on a loft. The strip had length n and consisted of letters "V" and "K". Unfortunately, rust has eaten some of the letters so that it's now impossible to understand which letter was written.

Grigory couldn't understand for a long time what these letters remind him of, so he became interested in the following question: if we put a letter "V" or "K" on each unreadable position, which values can the period of the resulting string be equal to?

A period of a string is such an integer d from 1 to the length of the string that if we put the string shifted by d positions to the right on itself, then all overlapping letters coincide. For example, 3 and 5 are periods of "VKKVK".

Input

There are several (at least one) test cases in the input. The first line contains single integer — the number of test cases.

There is an empty line before each test case. Each test case is described in two lines: the first line contains single integer n (1 ≤ n ≤ 5·105) — the length of the string, the second line contains the string of length n, consisting of letters "V", "K" and characters "?". The latter means the letter on its position is unreadable.

It is guaranteed that the sum of lengths among all test cases doesn't exceed 5·105.

For hacks you can only use tests with one test case.

Output

For each test case print two lines. In the first line print the number of possible periods after we replace each unreadable letter with "V" or "K". In the next line print all these values in increasing order.

Example

Input

3
 
5
V??VK
 
6
??????
 
4
?VK?


Output

2
3 5
6
1 2 3 4 5 6
3
2 3 4

Note

In the first test case from example we can obtain, for example, "VKKVK", which has periods 3 and 5.

In the second test case we can obtain "VVVVVV" which has all periods from 1 to 6.

In the third test case string "KVKV" has periods 2 and 4, and string "KVKK" has periods 3 and 4.

Solution (in JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.util.Arrays;
import java.security.InvalidParameterException;
import java.io.Writer;
import java.io.IOException;
import java.io.InputStream;

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

    static class ProblemERustyString {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int T = in.nextInt();
            Convolution fft = new NTTConvolution();
            while (T-- > 0) {
                int n = in.nextInt();
                char[] s = in.nextCharArray(n);
                long[] a = new long[n];
                long[] b = new long[n];
                for (int i = 0; i < n; i++) {
                    if (s[i] == 'V') {
                        a[i] = 1;
                    } else if (s[i] == 'K') {
                        b[n - i - 1] = 1;
                    }
                }
                long[] c = fft.convolveMod(a, b, 479 << 21 | 1);
                boolean[] ok = new boolean[n + 1];
                for (int i = 0; i < c.length; i++) {
                    if (c[i] > 0) {
                        ok[Math.abs(i + 1 - n)] = true;
                    }
                }
                int cnt = 0;
                for (int i = 1; i <= n; i++) {
                    for (int j = i; j <= n; j += i) {
                        ok[i] |= ok[j];
                    }
                    if (!ok[i]) cnt++;
                }
                out.println(cnt);
                for (int i = 1; i <= n; i++) {
                    if (!ok[i]) out.print(i + " ");
                }
                out.println();
            }

        }

    }

    static interface Convolution {
        public long[] convolveMod(long[] a, long[] b, int mod);

    }

    static class NTTConvolution implements Convolution {
        private int[][] roots = {{119 << 23 | 1, 3}, {5 << 25 | 1, 3}, {7 << 26 | 1, 3},
                {479 << 21 | 1, 3}, {483 << 21 | 1, 5}};
        private static NumberTheoreticTransform NTT = new NumberTheoreticTransform();


        public long[] convolveMod(long[] a, long[] b, int mod) {
            int root = -1;
            if (mod == -1) mod = (119 << 23) + 1;
            for (int i = 0; i < roots.length; i++) {
                if (mod == roots[i][0]) {
                    root = roots[i][1];
                }
            }
            if (root == -1) {
                throw new InvalidParameterException("module not support");
            }
            int sz = a.length + b.length - 1;
            int L = 1;
            while (L < sz) L <<= 1;
            long[] av = new long[L];
            System.arraycopy(a, 0, av, 0, a.length);
            long[] bv = new long[L];
            System.arraycopy(b, 0, bv, 0, b.length);
            NTT.ntt(av, false, mod, root);
            NTT.ntt(bv, false, mod, root);
            for (int i = 0; i < L; i++) {
                av[i] = av[i] * bv[i] % mod;
            }
            NTT.ntt(av, true, mod, root);
            return Arrays.copyOf(av, sz);
        }

    }

    static class OutputWriter extends PrintWriter {
        public OutputWriter(OutputStream out) {
            super(out);
        }

        public OutputWriter(Writer out) {
            super(out);
        }

        public void close() {
            super.close();
        }

    }

    static class NumberTheoreticTransform {
        private int revv(int x, int bits) {
            int ret = 0;
            for (int i = 0; i < bits; i++) {
                ret <<= 1;
                ret |= x & 1;
                x >>= 1;
            }
            return ret;
        }

        public void ntt(long[] a, boolean invert, int mod, int root) {
            int n = a.length;
            int bits = Integer.numberOfTrailingZeros(n);
            for (int i = 0; i < n; i++) {
                int j = revv(i, bits);
                if (i < j) {
                    long t = a[i];
                    a[i] = a[j];
                    a[j] = t;
                }
            }
            for (int k = 1; k < n; k <<= 1) {
                int e = IntegerUtils.powMod(root, (mod - 1) / 2 / k, mod);
                if (invert) e = IntegerUtils.inverse(e, mod);
                for (int i = 0; i < n; i += 2 * k) {
                    long w = 1;
                    for (int j = 0; j < k; j++, w = w * e % mod) {
                        long x = a[i + j];
                        long y = w * a[i + j + k] % mod;
                        a[i + j] = x + y;
                        if (a[i + j] >= mod) a[i + j] -= mod;
                        a[i + j + k] = x - y + mod;
                        if (a[i + j + k] >= mod) a[i + j + k] -= mod;
                    }
                }
            }
            if (invert) {
                long inv = IntegerUtils.inverse(n, mod);
                for (int i = 0; i < n; i++) a[i] = a[i] * inv % mod;
            }
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] inbuf = new byte[1024];
        private int lenbuf = 0;
        private int ptrbuf = 0;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        private int readByte() {
            if (lenbuf == -1) throw new UnknownError();
            if (ptrbuf >= lenbuf) {
                ptrbuf = 0;
                try {
                    lenbuf = stream.read(inbuf);
                } catch (IOException e) {
                    throw new UnknownError();
                }
                if (lenbuf <= 0) return -1;
            }
            return inbuf[ptrbuf++];
        }

        private boolean isSpaceChar(int c) {
            return !(c >= 33 && c <= 126);
        }

        private int skip() {
            int b;
            while ((b = readByte()) != -1 && isSpaceChar(b)) ;
            return b;
        }

        public char[] nextCharArray(int n) {
            char[] buf = new char[n];
            int b = skip(), p = 0;
            while (p < n && !(isSpaceChar(b))) {
                buf[p++] = (char) b;
                b = readByte();
            }
            return n == p ? buf : Arrays.copyOf(buf, p);
        }

        public int nextInt() {
            int num = 0, b;
            boolean minus = false;
            while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
            if (b == '-') {
                minus = true;
                b = readByte();
            }

            while (true) {
                if (b >= '0' && b <= '9') {
                    num = num * 10 + (b - '0');
                } else {
                    return minus ? -num : num;
                }
                b = readByte();
            }
        }

    }

    static class IntegerUtils {
        public static int powMod(long x, long y, int mod) {
            long ret = 1;
            x %= mod;
            for (; y > 0; y >>= 1, x = x * x % mod) {
                if ((y & 1) > 0) ret = ret * x % mod;
            }
            return (int) ret;
        }

        public static int inverse(int a, int md) {
            a %= md;
            if (a < 0) a += md;
            int b = md, u = 0, v = 1;
            while (a > 0) {
                int t = b / a;
                b -= t * a;
                int tmp = a;
                a = b;
                b = tmp;
                u -= t * v;
                tmp = u;
                u = v;
                v = tmp;
            }
            assert (b == 1);
            if (u < 0) u += md;
            return u;
        }

    }
}