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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
struct cp {
  double a, b;
  cp operator+(const cp &o) const { return (cp){a + o.a, b + o.b}; }
  cp operator-(const cp &o) const { return (cp){a - o.a, b - o.b}; }
  cp operator*(const cp &o) const {
    return (cp){a * o.a - b * o.b, b * o.a + a * o.b};
  }
  cp operator*(const double &o) const { return (cp){a * o, b * o}; }
  cp operator!() const { return (cp){a, -b}; }
} w[524288 + 5];
int pos[524288 + 5];
void fft_init(int len) {
  int j = 0;
  while ((1 << j) < len) j++;
  j--;
  for (int i = 0; i < len; i++) pos[i] = pos[i >> 1] >> 1 | ((i & 1) << j);
}
void fft(cp *x, int len, int sta) {
  for (int i = 0; i < len; i++)
    if (i < pos[i]) swap(x[i], x[pos[i]]);
  w[0] = (cp){1, 0};
  for (unsigned i = 2; i <= len; i <<= 1) {
    cp g = (cp){cos(2 * pi / i), sin(2 * pi / i) * sta};
    for (int j = i >> 1; j >= 0; j -= 2) w[j] = w[j >> 1];
    for (int j = 1; j < i >> 1; j += 2) w[j] = w[j - 1] * g;
    for (int j = 0; j < len; j += i) {
      cp *a = x + j, *b = a + (i >> 1);
      for (int l = 0; l < i >> 1; l++) {
        cp o = b[l] * w[l];
        b[l] = a[l] - o;
        a[l] = a[l] + o;
      }
    }
  }
  if (sta == -1)
    for (int i = 0; i < len; i++) x[i].a /= len, x[i].b /= len;
}
cp x[524288 + 5], y[524288 + 5], z[524288 + 5];
void FFT(int *a, int *b, int n, int m, int *c) {
  int len = 1;
  while (len < (n + m) >> 1) len <<= 1;
  fft_init(len);
  for (int i = n / 2; i < len; i++) x[i].a = x[i].b = 0;
  for (int i = m / 2; i < len; i++) y[i].a = y[i].b = 0;
  for (int i = 0; i < n; i++) (i & 1 ? x[i >> 1].b : x[i >> 1].a) = a[i];
  for (int i = 0; i < m; i++) (i & 1 ? y[i >> 1].b : y[i >> 1].a) = b[i];
  fft(x, len, 1), fft(y, len, 1);
  for (int i = 0; i < len / 2; i++) {
    int j = len - 1 & len - i;
    z[i] = x[i] * y[i] -
           (x[i] - !x[j]) * (y[i] - !y[j]) * (w[i] + (cp){1, 0}) * 0.25;
  }
  for (int i = len / 2; i < len; i++) {
    int j = len - 1 & len - i;
    z[i] = x[i] * y[i] - (x[i] - !x[j]) * (y[i] - !y[j]) *
                             ((cp){1, 0} - w[i ^ len >> 1]) * 0.25;
  }
  fft(z, len, -1);
  for (int i = 0; i < n + m; i++)
    if (i & 1)
      c[i] = (int)(z[i >> 1].b + 0.5);
    else
      c[i] = (int)(z[i >> 1].a + 0.5);
}
int T, n, f[2 * 524288 + 5], g[524288 + 5], flag[524288 + 5], ans[524288 + 5];
char s[524288 + 5];
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) flag[i] = 1;
    scanf("%s", s);
    for (int i = 0; i < n; i++) {
      if (s[i] == 'V')
        f[i] = 1;
      else
        f[i] = 0;
      if (s[i] == 'K')
        g[n - 1 - i] = 1;
      else
        g[n - 1 - i] = 0;
    }
    FFT(f, g, n, n, f);
    for (int i = 1; i < n; i++)
      if (f[n - i - 1] || f[n + i - 1]) flag[i] = 0;
    for (int i = 1; i <= n; i++)
      if (flag[i])
        for (int j = 2 * i; j <= n; j += i) flag[i] &= flag[j];
    int res = 0;
    for (int i = 1; i <= n; i++)
      if (flag[i]) ans[res++] = i;
    printf("%d\n", res);
    for (int i = 0; i < res; i++)
      printf("%d%c", ans[i], i == res - 1 ? '\n' : ' ');
  }
  return 0;
}