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;
int fpow(int base, int exponent) {
  int ans = 1;
  int cur = base;
  while (exponent) {
    if (exponent & 1) ans = (((long long)(ans) * (long long)(cur)) % 998244353);
    cur = (((long long)(cur) * (long long)(cur)) % 998244353);
    exponent >>= 1;
  }
  return ans;
}
int siz;
int rev[1050000];
int n;
void prentt(int s) {
  siz = 1;
  while (siz < s * 2) siz <<= 1;
  for (int i = 0; i < siz; i++) {
    rev[i] = (i & 1 ? rev[i - 1] | (siz >> 1) : rev[i >> 1] >> 1);
  }
}
void ntt(int* poly, bool inv) {
  for (int i = 0; i < siz; i++) {
    if (i < rev[i]) {
      int t = poly[i];
      poly[i] = poly[rev[i]];
      poly[rev[i]] = t;
    }
  }
  for (int csiz = 2; csiz <= siz; csiz <<= 1) {
    int root = fpow(3, (998244353 - 1) / csiz);
    if (inv) root = fpow(root, 998244353 - 2);
    for (int st = 0; st < siz; st += csiz) {
      int curr = 1;
      for (int cur = st; cur < st + (csiz >> 1); cur++) {
        int tmp = (((long long)(curr) * (long long)(poly[cur + (csiz >> 1)])) %
                   998244353);
        poly[cur + (csiz >> 1)] = poly[cur] - tmp + 998244353;
        if (poly[cur + (csiz >> 1)] >= 998244353)
          poly[cur + (csiz >> 1)] -= 998244353;
        poly[cur] = poly[cur] + tmp;
        if (poly[cur] >= 998244353) poly[cur] -= 998244353;
        curr = (((long long)(curr) * (long long)(root)) % 998244353);
      }
    }
  }
  if (inv) {
    int invs = fpow(siz, 998244353 - 2);
    for (int i = 0; i < siz; i++)
      poly[i] = (((long long)(poly[i]) * (long long)(invs)) % 998244353);
  }
}
int a[1050000];
int b[1050000];
int a2[1050000];
int b2[1050000];
int a3[1050000];
int b3[1050000];
int ans[1050000];
char s[1050000];
void work(void) {
  scanf("%d", &n);
  scanf("%s", s);
  for (int i = 0; i < n; i++) {
    a[i] = (s[i] == 'V' ? 1 : (s[i] == 'K' ? 2 : 0));
    b[n - i - 1] = a[i];
  }
  for (int i = 0; i < n; i++) {
    a2[i] = (((long long)(a[i]) * (long long)(a[i])) % 998244353);
    a3[i] = (((long long)(a2[i]) * (long long)(a[i])) % 998244353);
    b2[i] = (((long long)(b[i]) * (long long)(b[i])) % 998244353);
    b3[i] = (((long long)(b2[i]) * (long long)(b[i])) % 998244353);
  }
  prentt(n);
  ntt(a, false);
  ntt(b, false);
  ntt(a2, false);
  ntt(b2, false);
  ntt(a3, false);
  ntt(b3, false);
  for (int i = 0; i < siz; i++) {
    long long ansv = (long long)a3[i] * (long long)b[i] -
                     2LL * (long long)a2[i] * (long long)b2[i] +
                     (long long)a[i] * (long long)b3[i];
    ans[i] = ((ansv % 998244353) + 998244353) % 998244353;
  }
  ntt(ans, true);
  vector<int> output;
  for (int i = 1; i <= n; i++) {
    bool good = true;
    for (int j = i; j <= n; j += i) {
      if (j != n && ans[n - j - 1]) good = false;
    }
    if (good) output.push_back(i);
  }
  printf("%d\n", (int)output.size());
  for (int i = 0; i < output.size(); i++) {
    printf("%d ", output[i]);
  }
  printf("\n");
  for (int i = 0; i < siz; i++) {
    a[i] = b[i] = a2[i] = b2[i] = a3[i] = b3[i] = 0;
  }
}
int main() {
  int T;
  scanf("%d", &T);
  for (int i = 1; i <= T; i++) {
    work();
  }
  return 0;
}