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 int MAXSIZE = 10000020;
const int mod = 998244353;
int bufpos;
char buf[MAXSIZE];
void init() {
  buf[fread(buf, 1, MAXSIZE, stdin)] = ' ';
  bufpos = 0;
}
int readint() {
  int val = 0;
  for (; !isdigit(buf[bufpos]); bufpos++)
    ;
  for (; isdigit(buf[bufpos]); bufpos++) val = val * 10 + buf[bufpos] - '0';
  return val;
}
char readchar() {
  for (; isspace(buf[bufpos]); bufpos++)
    ;
  return buf[bufpos++];
}
int readstr(char* s) {
  int cur = 0;
  for (; isspace(buf[bufpos]); bufpos++)
    ;
  for (; !isspace(buf[bufpos]); bufpos++) s[cur++] = buf[bufpos];
  s[cur] = '\0';
  return cur;
}
long long power(long long x, long long y) {
  long long ans = 1;
  while (y) {
    if (y & 1) ans = ans * x % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
const int maxn = (1 << 20) + 2;
struct fft {
  int n, k;
  int bitrev[maxn];
  long long omega[maxn];
  void init(int l) {
    n = 1, k = 0;
    while (n <= l) n <<= 1, k++;
    omega[0] = 1;
    long long wn = power(3, (mod - 1) / n);
    for (int i = 1; i < n; i++) {
      omega[i] = omega[i - 1] * wn % mod;
      bitrev[i] = (bitrev[i >> 1] >> 1) | ((i & 1) << (k - 1));
    }
  }
  long long wn[maxn];
  void trans(long long* a, bool rev) {
    for (int i = 0; i < n; i++)
      if (bitrev[i] < i) swap(a[bitrev[i]], a[i]);
    for (int i = 1, qwq = k - 1; i < n; i <<= 1, qwq--) {
      for (int j = 0; j < i; j++) wn[j] = omega[j << qwq];
      for (int j = 0; j < n; j += (i << 1))
        for (int k = j; k < j + i; k++) {
          long long t = wn[k - j] * a[k + i];
          a[k + i] = (a[k] - t) % mod;
          a[k] = (a[k] + t) % mod;
        }
    }
    if (rev) {
      long long inv = power(n, mod - 2);
      for (int i = 0; i < n; i++) a[i] = a[i] * inv % mod;
      reverse(a + 1, a + n);
    }
  }
  void test() {
    init(8);
    static long long a[maxn], b[maxn];
    a[0] = 1, a[1] = 2, a[2] = 1;
    b[0] = 1, b[1] = 1;
    trans(a, 0);
    trans(b, 0);
    for (int i = 0; i < n; i++) a[i] = a[i] * b[i] % mod;
    trans(a, 1);
    for (int i = 0; i <= 5; i++) printf("%lld ", (a[i] % mod + mod) % mod);
  }
} t;
char s[maxn];
long long f[maxn], g[maxn];
bool chk[maxn];
int stk[maxn], tp;
int main() {
  init();
  int T = readint();
  while (T--) {
    int n = readint();
    readstr(s + 1);
    t.init(n * 2 + 2);
    memset(f, 0, t.n * 8);
    memset(g, 0, t.n * 8);
    for (int i = 1; i <= n; i++)
      if (s[i] == 'V')
        f[i] = 1;
      else if (s[i] == 'K')
        g[n + 1 - i] = 1;
    t.trans(f, 0);
    t.trans(g, 0);
    for (int i = 0; i < t.n; i++) f[i] = f[i] * g[i] % mod;
    t.trans(f, 1);
    for (int i = 0; i <= n; i++) chk[i] = !f[n + 1 - i] && !f[n + 1 + i];
    tp = 0;
    for (int i = 1; i < n; i++) {
      for (int j = i; j <= n; j += i) chk[i] &= chk[j];
      if (chk[i]) stk[++tp] = i;
    }
    stk[++tp] = n;
    printf("%d\n", tp);
    for (int i = 1; i <= tp; i++) printf("%d%c", stk[i], " \n"[i == tp]);
  }
}