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>
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
using namespace std;
struct pdd {
  double first, second;
  pdd() : first(0), second(0) {}
  pdd(double _x, double _y) : first(_x), second(_y) {}
};
inline pdd operator+(const pdd &a, const pdd &b) {
  return pdd(a.first + b.first, a.second + b.second);
}
inline pdd operator-(const pdd &a, const pdd &b) {
  return pdd(a.first - b.first, a.second - b.second);
}
inline pdd operator*(const pdd &a, const pdd &b) {
  return pdd(a.first * b.first - a.second * b.second,
             a.first * b.second + a.second * b.first);
}
inline pdd operator/(const pdd &a, const double &b) {
  return pdd(a.first / b, a.second / b);
}
inline pdd conj(const pdd &a) { return pdd(a.first, -a.second); }
int rv[1 << 21];
pdd w[1 << 21];
pdd tmp[1 << 20];
void fft(pdd *a, int n, bool inv) {
  static int SN = -1;
  int cc = 0;
  for (int _n((30) - 1), i(0); i <= _n; i++) {
    if (n & 1 << i) cc = i;
  }
  if (cc != SN) {
    SN = cc;
    rv[0] = 0;
    rv[1] = 1;
    for (int _n((SN - 1)), st(1); st <= _n; st++) {
      int k = 1 << st;
      for (int _n((k)-1), i(0); i <= _n; i++) {
        rv[i + k] = rv[i] * 2 + 1;
        rv[i] *= 2;
      }
    }
    for (int _n((1 << SN) - 1), i(0); i <= _n; i++) {
      w[i] = pdd(cos(2.0 * 3.1415926535897932384626433832795028841971 * i / n),
                 sin(2.0 * 3.1415926535897932384626433832795028841971 * i / n));
    }
  }
  for (int _n((n)-1), i(0); i <= _n; i++) {
    if (rv[i] <= i) swap(a[i], a[rv[i]]);
  }
  for (int st = 2; st <= n; st *= 2) {
    int d = n / st, o = st / 2;
    for (int j = 0; j < o; ++j) {
      tmp[j] = inv ? conj(w[j * d]) : w[j * d];
    }
    for (int i = 0; i < n; i += st) {
      for (int j = 0; j < o; ++j) {
        pdd u = a[i + j], v = a[i + j + o] * tmp[j];
        a[i + j] = u + v;
        a[i + j + o] = u - v;
      }
    }
  }
  if (inv) {
    for (int _n((n)-1), i(0); i <= _n; i++) a[i] = a[i] / n;
  }
}
void fft_unpack(pdd *z, pdd *first, pdd *second, int n) {
  for (int i = 1; i < n; ++i) {
    first[i] = (z[i] + conj(z[n - i])) / 2;
    second[i] = (z[i] - conj(z[n - i])) / 2;
    swap(second[i].first, second[i].second);
    second[i].second = -second[i].second;
  }
  first[0] = (z[0] + conj(z[0])) / 2;
  second[0] = (z[0] - conj(z[0])) / 2;
  swap(second[0].first, second[0].second);
  second[0].second = -second[0].second;
}
void fft_pack(pdd *first, pdd *second, pdd *z, int n) {
  for (int i = 1; i < n; ++i) {
    z[i] = first[i] + second[i] * pdd(0, 1);
    z[n - i] = conj(first[i] - second[i] * pdd(0, 1));
  }
  z[0].first = first[0].first;
  z[0].second = second[0].first;
}
int a, b, c, d, n, m, k, kolt;
char str[500002];
bool ans[500002];
pdd A[1 << 21], B[1 << 21], C[1 << 21];
int pr[1 << 21];
void check() {
  int t = 1;
  while (t < 2 * n) t *= 2;
  for (int _n((t * 2) - 1), i(0); i <= _n; i++)
    A[i] = pdd(0, 0), B[i] = pdd(0, 0), C[i] = pdd(0, 0);
  for (int _n((n)-1), i(0); i <= _n; i++) {
    if (str[i] == 'V') {
      C[i].first = 1;
      C[i + n].first = 0;
    } else if (str[i] == 'K') {
      C[n - i - 1].second = 1;
      C[2 * n - i - 1].second = 1;
    }
  }
  fft(C, t * 2, 0);
  fft_unpack(C, A, B, t * 2);
  for (int _n((2 * t) - 1), i(0); i <= _n; i++) {
    C[i] = A[i] * B[i];
  }
  fft(C, t * 2, 1);
  for (int _n((t * 2) - 1), i(0); i <= _n; i++) {
    pr[i] = (int)(C[i].first + 0.5);
  }
  for (int _n((n - 1)), len(1); len <= _n; len++) {
    if (!ans[len]) continue;
    bool ok = 1;
    for (int i = 0; i < n; i += len) {
      if (pr[2 * n - 1 + i]) {
        ok = 0;
        break;
      }
    }
    if (!ok) {
      ans[len] = 0;
    }
  }
}
int main() {
  scanf("%d", &kolt);
  for (int _n((kolt)), hod(1); hod <= _n; hod++) {
    scanf("%d", &n);
    scanf("%s", str);
    for (int _n((n)), i(1); i <= _n; i++) ans[i] = 1;
    check();
    for (int _n((n)-1), i(0); i <= _n; i++)
      if (str[i] == 'V')
        str[i] = 'K';
      else if (str[i] == 'K')
        str[i] = 'V';
    check();
    int cnt = 0;
    for (int _n((n)), i(1); i <= _n; i++)
      if (ans[i]) ++cnt;
    printf("%d\n", cnt);
    bool was = 0;
    for (int _n((n)), i(1); i <= _n; i++) {
      if (!ans[i]) continue;
      if (was)
        printf(" ");
      else
        was = 1;
      printf("%d", i);
    }
    printf("\n");
  }
}