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 = (119 << 23) + 1, root = 3;
long long modpow(long long a, long long e) {
  if (e == 0) return 1;
  long long x = modpow(a * a % mod, e >> 1);
  return e & 1 ? x * a % mod : x;
}
void ntt(long long* x, long long* temp, long long* roots, int N, int skip) {
  if (N == 1) return;
  int n2 = N / 2;
  ntt(x, temp, roots, n2, skip * 2);
  ntt(x + skip, temp, roots, n2, skip * 2);
  for (int i = 0; i < (N); ++i) temp[i] = x[i * skip];
  for (int i = 0; i < (n2); ++i) {
    long long s = temp[2 * i], t = temp[2 * i + 1] * roots[skip * i];
    x[skip * i] = (s + t) % mod;
    x[skip * (i + n2)] = (s - t) % mod;
  }
}
void ntt(vector<long long>& x, bool inv = false) {
  long long e = modpow(root, (mod - 1) / (int)(x).size());
  if (inv) e = modpow(e, mod - 2);
  vector<long long> roots((int)(x).size(), 1), temp = roots;
  for (int i = 1; i < ((int)(x).size()); ++i) roots[i] = roots[i - 1] * e % mod;
  ntt(&x[0], &temp[0], &roots[0], (int)(x).size(), 1);
}
vector<long long> conv(vector<long long> a, vector<long long> b) {
  int s = (int)(a).size() + (int)(b).size() - 1;
  if (s <= 0) return {};
  int L = s > 1 ? 32 - __builtin_clz(s - 1) : 0, n = 1 << L;
  if (s <= 200) {
    vector<long long> c(s);
    for (int i = 0; i < ((int)(a).size()); ++i)
      for (int j = 0; j < ((int)(b).size()); ++j)
        c[i + j] = (c[i + j] + a[i] * b[j]) % mod;
    return c;
  }
  a.resize(n);
  ntt(a);
  b.resize(n);
  ntt(b);
  vector<long long> c(n);
  long long d = modpow(n, mod - 2);
  for (int i = 0; i < (n); ++i) c[i] = a[i] * b[i] % mod * d % mod;
  ntt(c, true);
  c.resize(s);
  return c;
}
vector<long long> v1, v2, v3;
char str[550000];
int ok[550000];
int bad[550000];
int main() {
  int T;
  scanf("%d", &T);
  for (int t = 0; t < T; t++) {
    v1.clear();
    v2.clear();
    v3.clear();
    int n;
    scanf("%d%s", &n, str);
    for (int i = 1; i <= n; i++) {
      ok[i] = 1;
      bad[i] = 1;
    }
    for (int i = 0; i < n; i++) {
      v1.push_back(str[i] == 'V');
    }
    for (int i = 0; i < n; i++) {
      v2.push_back(str[n - 1 - i] == 'K');
    }
    v3 = conv(v1, v2);
    for (int i = 0; i < v3.size(); i++) {
      v3[i] %= mod;
      if (v3[i] == 0) continue;
      bad[abs(i - (n - 1))] = 0;
    }
    for (int i = 1; i <= n; i++) {
      for (int j = i; j <= n; j += i) {
        ok[i] &= bad[j];
      }
    }
    int ans = 0;
    for (int i = 1; i <= n; i++) {
      ans += ok[i];
    }
    printf("%d\n", ans);
    for (int i = 1; i <= n; i++) {
      if (ok[i]) {
        printf("%d", i);
        ans--;
        if (ans > 0) printf(" ");
      }
    }
    cout << endl;
  }
}