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 FFTConvolution();
            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 OutputWriter extends PrintWriter {
        public OutputWriter(OutputStream out) {
            super(out);
        }

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

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

    }

    static class FastFourierTransform {
        int base = 1;
        double[] rootsR = {0, 1};
        double[] rootsI = {0, 0};
        int[] rev = {0, 1};

        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));
            }
            double[] nR = new double[1 << nBase];
            System.arraycopy(rootsR, 0, nR, 0, rootsR.length);
            double[] nI = new double[1 << nBase];
            System.arraycopy(rootsI, 0, nI, 0, rootsI.length);
            while (base < nBase) {
                double angle = 2 * Math.PI / (1 << (base + 1));
                double zR = Math.cos(angle), zI = Math.sin(angle);
                for (int i = 1 << (base - 1); i < (1 << base); i++) {
                    nR[i << 1] = nR[i];
                    nI[i << 1] = nI[i];
                    double angle_i = angle * (2 * i + 1 - (1 << base));
                    nR[i << 1 | 1] = Math.cos(angle_i);
                    nI[i << 1 | 1] = Math.sin(angle_i);
                }
                base++;
            }
            rootsR = nR;
            rootsI = nI;
        }

        public void fft(ComplexArray ca, boolean invert) {
            double[] a = ca.re;
            double[] b = ca.im;
            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)) {
                    double t = a[i];
                    a[i] = a[rev[i] >> shift];
                    a[rev[i] >> shift] = t;

                    t = b[i];
                    b[i] = b[rev[i] >> shift];
                    b[rev[i] >> shift] = t;
                }
            }

            double multInv = invert ? -1 : 1;

            for (int k = 1; k < n; k <<= 1) {
                for (int i = 0; i < n; i += 2 * k) {
                    for (int j = 0; j < k; j++) {
                        double zR = a[i + j + k] * rootsR[j + k] - b[i + j + k] * rootsI[j + k] * multInv;
                        double zI = a[i + j + k] * rootsI[j + k] * multInv + b[i + j + k] * rootsR[j + k];
                        a[i + j + k] = a[i + j] - zR;
                        b[i + j + k] = b[i + j] - zI;

                        a[i + j] = a[i + j] + zR;
                        b[i + j] = b[i + j] + zI;
                    }
                }
            }

            if (invert) {
                for (int i = 0; i < n; i++) {
                    a[i] /= n;
                    b[i] /= n;
                }
            }
        }

    }

    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 FFTConvolution implements Convolution {
        private static FastFourierTransform FFT = new FastFourierTransform();


        public long[] convolve(long[] a, long[] b) {
            int sz = a.length + b.length - 1;
            int L = 1;
            while (L < sz) L <<= 1;
            ComplexArray ca = new ComplexArray(a, L);
            ComplexArray cb = new ComplexArray(b, L);
            FFT.fft(ca, false);
            FFT.fft(cb, false);
            ca.inplaceMultiply(cb);
            FFT.fft(ca, true);
            long[] ret = new long[sz];
            for (int i = 0; i < sz; i++) {
                ret[i] = Math.round(ca.re[i]);
            }
            return ret;
        }

    }

    static class ComplexArray {
        public double[] re;
        public double[] im;

        public ComplexArray(long[] re, int len) {
            this(len);
            for (int i = 0; i < re.length; i++) {
                this.re[i] = re[i];
            }
        }

        public ComplexArray(double[] re, double[] im) {
            this.re = re;
            this.im = im;
        }

        public ComplexArray(int len) {
            re = new double[len];
            im = new double[len];
        }

        public void inplaceMultiply(final ComplexArray o) {
            for (int i = 0; i < re.length; i++) {
                double real = re[i] * o.re[i] - im[i] * o.im[i];
                double imaginary = re[i] * o.im[i] + im[i] * o.re[i];
                re[i] = real;
                im[i] = imaginary;
            }
        }

    }
}