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;
template <class T>
bool ckmax(T &x, T y) {
  return x < y ? x = y, 1 : 0;
}
template <class T>
bool ckmin(T &x, T y) {
  return x > y ? x = y, 1 : 0;
}
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = 0;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return f ? x : -x;
}
inline int add(int x, int y) {
  return (x += y) >= 998244353 ? x - 998244353 : x;
}
inline int sub(int x, int y) {
  return (x += 998244353 - y) >= 998244353 ? x - 998244353 : x;
}
inline int qpow(int n, int k) {
  int res = 1;
  for (; k; k >>= 1, n = 1ll * n * n % 998244353)
    if (k & 1) res = 1ll * n * res % 998244353;
  return res;
}
const int N = 500005;
int rt[N << 2], rev[N << 2];
int lim, lg;
inline void initpoly(const int &n = (N - 5) << 1) {
  for (lim = 1, lg = 0; lim < n; lim <<= 1, ++lg)
    ;
  for (int i = 1; i < lim; i <<= 1) {
    rt[i] = 1;
    int w = qpow(3, (998244353 - 1) / (i << 1));
    for (int j = 1; j < i; ++j) rt[i + j] = 1ll * rt[i + j - 1] * w % 998244353;
  }
}
inline void initrev(const int &n) {
  for (lim = 1, lg = 0; lim < n; lim <<= 1, ++lg)
    ;
  for (int i = 0; i < lim; ++i)
    rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (lg - 1));
}
inline void NTT(vector<int> &a, int op) {
  a.resize(lim);
  if (!op) reverse(a.begin() + 1, a.end());
  for (int i = 0; i < lim; ++i)
    if (i > rev[i]) swap(a[i], a[rev[i]]);
  for (int i = 1; i < lim; i <<= 1) {
    for (int j = 0; j < lim; j += i << 1) {
      for (int k = 0; k < i; ++k) {
        int X = a[j + k], Y = 1ll * rt[i + k] * a[i + j + k] % 998244353;
        a[j + k] = (X + Y) % 998244353,
              a[i + j + k] = (X + 998244353 - Y) % 998244353;
      }
    }
  }
  if (!op) {
    for (int i = 0, j = qpow(lim, 998244353 - 2); i < lim; ++i)
      a[i] = 1ll * a[i] * j % 998244353;
  }
}
vector<int> operator*(vector<int> a, vector<int> b) {
  int n = a.size(), m = b.size();
  if (n < 64 || m < 64) {
    vector<int> res(n + m - 1, 0);
    for (int i = 0; i < n; ++i)
      for (int j = 0; j < m; ++j)
        res[i + j] = (res[i + j] + 1ll * a[i] * b[j]) % 998244353;
    return res;
  }
  initrev(n + m - 1), NTT(a, 1), NTT(b, 1);
  for (int i = 0; i < lim; ++i) a[i] = 1ll * a[i] * b[i] % 998244353;
  NTT(a, 0), a.resize(n + m - 1);
  return a;
}
int n, s[N], ans[N], tot;
char str[N];
bool vis[N];
void Main() {
  scanf("%d%s", &n, str), n = strlen(str), tot = 0;
  for (int i = 1; i <= n; ++i) vis[i] = 0;
  for (int i = 0; i < n; ++i) {
    if (str[i] == '?')
      s[i] = 0;
    else if (str[i] == 'V')
      s[i] = 1;
    else
      s[i] = 2;
  }
  vector<int> a(n), b(n), c, A(n), B(n), C(n);
  for (int i = 0; i < n; ++i) a[i] = s[i] * s[i] * s[i];
  for (int i = 0; i < n; ++i) b[i] = s[i];
  reverse(a.begin(), a.end());
  c = a * b;
  for (int i = 0; i < n; ++i) A[i] = c[i + n - 1];
  for (int i = 0; i < n; ++i) a[i] = s[i] * s[i];
  for (int i = 0; i < n; ++i) b[i] = s[i] * s[i];
  reverse(a.begin(), a.end());
  c = a * b;
  for (int i = 0; i < n; ++i) B[i] = sub(0, add(c[i + n - 1], c[i + n - 1]));
  for (int i = 0; i < n; ++i) a[i] = s[i];
  for (int i = 0; i < n; ++i) b[i] = s[i] * s[i] * s[i];
  reverse(a.begin(), a.end());
  c = a * b;
  for (int i = 0; i < n; ++i) C[i] = c[i + n - 1];
  for (int i = 1; i < n; ++i) {
    A[i] = add(A[i], add(B[i], C[i]));
    if (!A[i]) vis[i] = 1;
  }
  vis[n] = 1;
  for (int i = 1; i <= n; ++i) {
    if (vis[i]) {
      bool flg = 1;
      for (int j = i; j <= n; j += i)
        if (!vis[j]) {
          flg = 0;
          break;
        }
      if (!flg) vis[i] = 0;
    }
  }
  for (int i = 1; i <= n; ++i)
    if (vis[i]) ans[++tot] = i;
  printf("%d\n", tot);
  for (int i = 1; i <= tot; ++i) printf("%d%c", ans[i], " \n"[i == tot]);
}
signed main() {
  initpoly();
  for (int T = read(); T; --T) Main();
}