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>
inline void read(T &x) {
  int f = 0;
  x = 0;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar()) f |= (ch == '-');
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  if (f) x = -x;
}
const int N = (1 << 20) + 5, mod = 998244353;
int power(int x, int p) {
  int res = 1;
  for (; p; p >>= 1, x = (long long)x * x % mod)
    if (p & 1) res = (long long)res * x % mod;
  return res;
}
void add(int &x, int y) { x = (x + y >= mod ? x + y - mod : x + y); }
namespace Poly {
void dft(vector<int> &A, int n) {
  static unsigned long long w[N << 1], *W = w, *H[30], mx = 0;
  for (; mx < n; mx++) {
    H[mx] = W;
    unsigned long long w = 1, wn = power(3, (mod - 1) >> (mx + 1));
    for (int i = 0; i < (1 << mx); i++) *W++ = w, w = w * wn % mod;
  }
  static unsigned long long a[N];
  A.resize(1 << n);
  for (int i = 0, j = 0; i < (1 << n); i++) {
    a[i] = A[j];
    for (int k = 1 << (n - 1); (j ^= k) < k; k >>= 1)
      ;
  }
  for (int k = 0, d = 1; k < n; k++, d <<= 1)
    for (int i = 0; i < (1 << n); i += d << 1) {
      unsigned long long *l = a + i, *r = a + i + d, *w = H[k];
      for (int j = 0; j < d; j++, l++, r++) {
        unsigned long long t = *r * (*w++) % mod;
        *r = *l + mod - t, *l += t;
      }
    }
  for (int i = 0; i < (1 << n); i++) A[i] = a[i] % mod;
}
void idft(vector<int> &a, int n) {
  a.resize(1 << n);
  reverse(a.begin() + 1, a.end());
  dft(a, n);
  unsigned long long inv = power(1 << n, mod - 2);
  for (int i = 0; i < (1 << n); i++) a[i] = a[i] * inv % mod;
}
vector<int> mul(vector<int> a, vector<int> b) {
  int aim = a.size() + b.size();
  int n = 0;
  while ((1 << n) < aim) n++;
  dft(a, n), dft(b, n);
  for (int i = 0; i < (1 << n); i++) a[i] = (long long)a[i] * b[i] % mod;
  idft(a, n), a.resize(aim - 1);
  return a;
}
}  // namespace Poly
int x[N], y[N], ans[N], n;
vector<int> A, B, C;
char s[N];
void rmain() {
  read(n), scanf("%s", s + 1);
  for (int i = (0); i <= (n + 1); i++) x[i] = y[i] = ans[i] = 0;
  for (int i = (1); i <= (n); i++) {
    if (s[i] == 'V')
      x[i] = 1;
    else if (s[i] == 'K')
      x[i] = 2;
    y[n + 1 - i] = x[i];
  }
  A.resize(n + 1);
  B.resize(n + 1);
  for (int i = (1); i <= (n); i++) {
    A[i] = x[i] * x[i] * x[i];
    B[i] = y[i];
  }
  C = Poly::mul(A, B);
  for (int i = (1); i <= (n); i++) add(ans[i], C[n + i]);
  for (int i = (1); i <= (n); i++) {
    A[i] = mod - 2 * x[i] * x[i];
    B[i] = y[i] * y[i];
  }
  C = Poly::mul(A, B);
  for (int i = (1); i <= (n); i++) add(ans[i], C[n + i]);
  for (int i = (1); i <= (n); i++) {
    A[i] = x[i];
    B[i] = y[i] * y[i] * y[i];
  }
  C = Poly::mul(A, B);
  for (int i = (1); i <= (n); i++) add(ans[i], C[n + i]);
  for (int i = (1); i <= (n); i++) ans[i] = ans[i + 1];
  for (int i = (1); i <= (n); i++) {
    for (int j = i + i; j <= n; j += i) add(ans[i], ans[j]);
  }
  vector<int> res;
  for (int i = (1); i <= (n); i++)
    if (!ans[i]) res.push_back(i);
  printf("%d\n", (int)res.size());
  for (auto x : res) printf("%d ", x);
  puts("");
}
int main() {
  int T;
  read(T);
  while (T--) rmain();
  return 0;
}