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>
#pragma GCC optimize(3)
using namespace std;
const long long mod = 998244353, G = 3;
inline long long qpow(long long a, long long b, long long p) {
  long long k = 1;
  if (b < 0) b += p - 1;
  while (b) {
    if (b & 1) k = k * a % p;
    a = a * a % p;
    b >>= 1;
  }
  return k;
}
const int N = 2e6 + 10;
long long rev[N], f[N], g[N], ans[N];
inline void upmod(long long &x) {
  if (x < 0) x += mod;
  if (x >= mod) x -= mod;
}
long long va[100], vb[100];
inline void ntt(long long *a, int lim, int flag) {
  for (int i = 1; i < lim; i++)
    if (i < rev[i]) swap(a[i], a[rev[i]]);
  for (int mid = 1, t = 0; mid < lim; mid <<= 1, t++) {
    long long wn = 0;
    if (flag == 1)
      wn = va[t];
    else
      wn = vb[t];
    for (int j = 0; j < lim; j += (mid << 1)) {
      long long w = 1;
      for (int k = 0; k < mid; k++, w = w * wn % mod) {
        long long x = a[j + k], y = w * a[j + k + mid] % mod;
        a[j + k] = x + y;
        a[j + k + mid] = x - y;
        upmod(a[j + k]), upmod(a[j + k + mid]);
      }
    }
  }
  if (flag == -1) {
    long long inv = qpow(lim, mod - 2, mod);
    for (int i = 0; i < lim; i++) a[i] = a[i] * inv % mod;
  }
}
int t, n, lim;
char s[N];
int ch[200];
int ck[200];
signed main() {
  for (int mid = 1, t = 0; (mod - 1) % (mid << 1) == 0; mid <<= 1, t++) {
    long long wn = qpow(G, (mod - 1) / (mid << 1), mod);
    va[t] = wn;
  }
  for (int mid = 1, t = 0; (mod - 1) % (mid << 1) == 0; mid <<= 1, t++) {
    long long wn = qpow(G, -(mod - 1) / (mid << 1), mod);
    vb[t] = wn;
  }
  ch['V'] = 1;
  ch['K'] = 2;
  ck['V'] = ck['K'] = 1;
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    scanf("%s", s);
    lim = 1;
    while (lim <= (n * 2)) lim <<= 1;
    memset(ans, 0, lim * 8);
    for (int i = 1; i < lim; i++) {
      rev[i] = rev[i >> 1] >> 1;
      rev[i] |= (i & 1) ? (lim >> 1) : 0;
    }
    for (int i = 0; i <= 2 * n; i++)
      f[i] = ch[s[i]] * ch[s[i]] * ck[s[i]], g[i] = ck[s[2 * n - i]];
    for (int i = 2 * n + 1; i < lim; i++) f[i] = g[i] = 0;
    ntt(f, lim, 1), ntt(g, lim, 1);
    for (int i = 0; i < lim; i++) ans[i] += f[i] * g[i];
    for (int i = 0; i <= 2 * n; i++)
      f[i] = ch[s[i]] * ck[s[i]], g[i] = ck[s[2 * n - i]] * ch[s[2 * n - i]];
    for (int i = 2 * n + 1; i < lim; i++) f[i] = g[i] = 0;
    ntt(f, lim, 1), ntt(g, lim, 1);
    for (int i = 0; i < lim; i++) ans[i] -= 2 * f[i] * g[i];
    for (int i = 0; i <= 2 * n; i++)
      f[i] = ck[s[i]],
      g[i] = ch[s[2 * n - i]] * ck[s[2 * n - i]] * ch[s[2 * n - i]];
    for (int i = 2 * n + 1; i < lim; i++) f[i] = g[i] = 0;
    ntt(f, lim, 1), ntt(g, lim, 1);
    for (int i = 0; i < lim; i++) ans[i] += f[i] * g[i], ans[i] %= mod;
    ntt(ans, lim, -1);
    vector<int> pt;
    for (int i = 1; i <= n; i++) {
      if (ans[2 * n - i]) continue;
      bool f = 1;
      for (int j = i; j <= n; j += i) {
        if (ans[2 * n - j] != 0) {
          f = 0;
          break;
        }
      }
      if (f) pt.push_back(i);
    }
    printf("%d\n", pt.size());
    for (auto x : pt) printf("%d ", x);
    puts("");
    for (int i = 0; i < n; i++) s[i] = 0;
  }
}