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 long long MOD = 1e9 + 7;
const double PI = acos(-1.);
const double eps = 1e-10;
const int INF = 0x3f3f3f3f;
const long long INFLL = 0x3f3f3f3f3f3f3f3f;
const int MAXN = 262144 * 8 + 5;
char s[MAXN];
char t[MAXN];
struct CP {
  double x, y;
  CP() {}
  CP(double x, double y) : x(x), y(y) {}
  inline double real() { return x; }
  inline CP operator*(const CP& r) const {
    return CP(x * r.x - y * r.y, x * r.y + y * r.x);
  }
  inline CP operator-(const CP& r) const { return CP(x - r.x, y - r.y); }
  inline CP operator+(const CP& r) const { return CP(x + r.x, y + r.y); }
  inline CP conj(const CP& r) { return CP(r.x, -r.y); }
};
CP a[MAXN], b[MAXN];
int r[MAXN], res[MAXN];
void fft_init(int nm, int k) {
  for (int i = 0; i < nm; ++i) r[i] = (r[i >> 1] >> 1) | ((i & 1) << (k - 1));
}
void fft(CP ax[], int nm, int op) {
  for (int i = 0; i < nm; ++i)
    if (i < r[i]) swap(ax[i], ax[r[i]]);
  for (int h = 2, m = 1; h <= nm; h <<= 1, m <<= 1) {
    CP wn = CP(cos(op * 2 * PI / h), sin(op * 2 * PI / h));
    for (int i = 0; i < nm; i += h) {
      CP w(1, 0);
      for (int j = i; j < i + m; ++j, w = w * wn) {
        CP t = w * ax[j + m];
        ax[j + m] = ax[j] - t;
        ax[j] = ax[j] + t;
      }
    }
  }
  if (op == -1)
    for (int i = 0; i < nm; ++i) ax[i].x /= nm;
}
void trans(int ax[], int bx[], int n, int m, int mul) {
  int nm = 1, k = 0;
  while (nm < 2 * n || nm < 2 * m) nm <<= 1, ++k;
  for (int i = 0; i < n; ++i) a[i] = CP(ax[i], 0);
  for (int i = 0; i < m; ++i) b[i] = CP(bx[i], 0);
  for (int i = n; i < nm; ++i) a[i] = CP(0, 0);
  for (int i = m; i < nm; ++i) b[i] = CP(0, 0);
  fft_init(nm, k);
  fft(a, nm, 1);
  fft(b, nm, 1);
  for (int i = 0; i < nm; ++i) a[i] = a[i] * b[i];
  fft(a, nm, -1);
  nm = n + m - 1;
  for (int i = 0; i < nm; ++i) res[i] += (int)(a[i].real() + 0.5) * mul;
}
int s1[MAXN], t1[MAXN];
int ans[MAXN];
int getid(char x) {
  if (x == 'V') return 1;
  if (x == 'K') return -1;
  return 0;
}
int main() {
  int T;
  cin >> T;
  while (T--) {
    int n;
    scanf("%d %s", &n, s);
    for (int i = 0; i <= 2 * n; i++) res[i] = 0;
    for (int i = 0; i < n; i++) {
      s1[i] = getid(s[i]) * getid(s[i]) * getid(s[i]);
      t1[i] = getid(s[i]);
    }
    reverse(t1, t1 + n);
    trans(s1, t1, n, n, 1);
    for (int i = 0; i < n; i++) {
      s1[i] = getid(s[i]);
      t1[i] = getid(s[i]) * getid(s[i]) * getid(s[i]);
    }
    reverse(t1, t1 + n);
    trans(s1, t1, n, n, 1);
    for (int i = 0; i < n; i++) {
      s1[i] = getid(s[i]) * getid(s[i]);
      t1[i] = getid(s[i]) * getid(s[i]);
    }
    reverse(t1, t1 + n);
    trans(s1, t1, n, n, -2);
    for (int i = 0; i <= n; i++) ans[i] = 0;
    for (int i = 0; i < n; i++)
      if (res[i] == 0) ans[n - i - 1] = 1;
    ans[n] = 1;
    vector<int> v;
    for (int i = n; i >= 1; i--) {
      for (int j = i + i; j <= n; j += i) ans[i] &= ans[j];
      if (ans[i]) v.push_back(i);
    }
    printf("%d\n", v.size());
    reverse(v.begin(), v.end());
    for (int i : v) printf("%d ", i);
    puts("");
  }
  return 0;
}