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 N = 500050;
const int mod = 998244353;
int powmod(int x, int k) {
  int ret = 1;
  for (; k; k >>= 1, x = (long long)x * x % mod)
    if (k & 1) ret = (long long)ret * x % mod;
  return ret;
}
vector<int> v;
void fft(vector<int> &a, bool inv) {
  v.clear();
  v.resize(a.size());
  int i, j, k;
  for (i = 2; i <= a.size(); i <<= 1) {
    int block = a.size() / i;
    int ang = powmod(3, (mod - 1) / i);
    if (inv) ang = powmod(ang, mod - 2);
    for (j = 0; j < block; j++) {
      for (k = 0; k < i; k++) {
        v[k] = a[j + k * block];
      }
      int cur = 1;
      for (k = 0; k < i / 2; k++) {
        int tmp1 = v[k * 2], tmp2 = (long long)cur * v[k * 2 + 1] % mod;
        a[j + k * block] = (tmp1 + tmp2) % mod;
        int id = j + k * block + a.size() / 2;
        a[id] = tmp1 - tmp2;
        if (a[id] < 0) a[id] += mod;
        cur = (long long)cur * ang % mod;
      }
    }
  }
  if (inv) {
    int mul = powmod(a.size(), mod - 2);
    for (i = 0; i < a.size(); i++) a[i] = (long long)a[i] * mul % mod;
  }
}
vector<int> operator*(vector<int> a, vector<int> b) {
  int sz = 1;
  while (sz < a.size() || sz < b.size()) sz <<= 1;
  sz <<= 1;
  a.resize(sz);
  b.resize(sz);
  fft(a, 0);
  fft(b, 0);
  for (int i = 0; i < sz; i++) a[i] = (long long)a[i] * b[i] % mod;
  fft(a, 1);
  return a;
}
char s[N];
vector<int> a, b, c, sol;
bool bad[N];
void Solve() {
  int n, i, j;
  scanf("%i", &n);
  scanf("%s", s + 1);
  a.clear();
  b.clear();
  a.resize(n);
  b.resize(n);
  for (i = 1; i <= n; i++) {
    if (s[i] == 'V') a[i - 1] = 1;
    if (s[i] == 'K') b[n - i] = 1;
  }
  for (i = 0; i <= n; i++) bad[i] = 0;
  c = a * b;
  for (i = 0; i < 2 * n; i++) {
    if (c[i] > 0) bad[abs(n - i - 1)] = 1;
  }
  sol.clear();
  for (i = 1; i <= n; i++) {
    bool was = 0;
    for (j = i; j <= n; j += i) was |= bad[j];
    if (!was) sol.push_back(i);
  }
  printf("%i\n", sol.size());
  for (i = 0; i < sol.size(); i++) printf("%i ", sol[i]);
  printf("\n");
}
int main() {
  int t;
  scanf("%i", &t);
  while (t--) Solve();
  return 0;
}