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.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(479 << 21 | 1, 3);
            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.convolve(a, b);
                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[] convolve(long[] a, long[] b);

    }

    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 NTTConvolution implements Convolution {
        private NumberTheoreticTransform NTT;
        int mod;

        public NTTConvolution(int mod, int root) {
            NTT = new NumberTheoreticTransform(mod, root);
            this.mod = mod;
        }


        public long[] convolve(long[] a, long[] b) {
            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);
            NTT.ntt(bv, false);
            for (int i = 0; i < L; i++) {
                av[i] = av[i] * bv[i] % mod;
            }
            NTT.ntt(av, true);
            return Arrays.copyOf(av, sz);
        }

    }

    static class NumberTheoreticTransform {
        int mod;
        int root;
        int base = 1;
        int[] rev = {0, 1};
        int[] roots = {0, 1};
        int[] invRoots = {0, 1};

        public NumberTheoreticTransform(int mod, int root) {
            this.mod = mod;
            this.root = root;
        }

        private void prepareBase(int nBase) {
            if (nBase <= base) return;
            rev = new int[1 << nBase];
            for (int i = 0; i < (1 << nBase); i++) {
                rev[i] = (rev[i >> 1] >> 1) + ((i & 1) << (nBase - 1));
            }

            int[] nR = new int[1 << nBase];
            System.arraycopy(roots, 0, nR, 0, roots.length);
            int[] nV = new int[1 << nBase];
            System.arraycopy(invRoots, 0, nV, 0, invRoots.length);
            while (base < nBase) {
                long e1 = IntegerUtils.powMod(root, (mod - 1) / (1 << (base + 1)), mod);
                long e2 = IntegerUtils.inverse((int) e1, mod);
                for (int i = 1 << (base - 1); i < (1 << base); i++) {
                    nR[i << 1] = nR[i];
                    nV[i << 1] = nV[i];
                    nR[i << 1 | 1] = (int) (nR[i << 1] * e1 % mod);
                    nV[i << 1 | 1] = (int) (nV[i << 1] * e2 % mod);
                }
                base++;
            }
            roots = nR;
            invRoots = nV;
        }

        public void ntt(long[] a, boolean invert) {
            int n = a.length;
            int zeros = Integer.numberOfTrailingZeros(n);
            prepareBase(zeros);
            int shift = base - zeros;
            for (int i = 0; i < n; i++) {
                if (i < (rev[i] >> shift)) {
                    long t = a[i];
                    a[i] = a[rev[i] >> shift];
                    a[rev[i] >> shift] = t;
                }
            }
            for (int k = 1; k < n; k <<= 1) {
                for (int i = 0; i < n; i += 2 * k) {
                    for (int j = 0; j < k; j++) {
                        long x = a[i + j];
                        long y = a[i + j + k] * (invert ? invRoots[j + k] : roots[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 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;
        }

    }

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

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

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

    }
}