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 <typename T>
void _R(T &x) {
  cin >> x;
}
void _R(int &x) { scanf("%d", &x); }
void _R(int64_t &x) { scanf("%" PRId64, &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template <typename T, typename... U>
void R(T &head, U &...tail) {
  _R(head);
  R(tail...);
}
template <typename T>
void _W(const T &x) {
  cout << x;
}
void _W(const int &x) { printf("%d", x); }
void _W(const long long &x) { printf("%" PRId64, x); }
template <typename T>
void _W(const vector<T> &x) {
  for (auto i = x.cbegin(); i != x.cend(); i++) {
    if (i != x.cbegin()) putchar(' ');
    _W(*i);
  }
}
void W() {}
template <typename T, typename... U>
void W(const T &head, const U &...tail) {
  _W(head);
  putchar(sizeof...(tail) ? ' ' : '\n');
  W(tail...);
}
template <typename T>
inline bool chkmax(T &a, const T &b) {
  return b > a ? a = b, true : false;
}
template <typename T>
inline bool chkmin(T &a, const T &b) {
  return b < a ? a = b, true : false;
}
template <typename T, typename F>
inline void sort_uniq(vector<T> &v, F f) {
  sort(begin(v), end(v), f);
  v.resize(unqiue(begin(v), end(v)) - v.begin());
}
template <typename T>
using MaxHeap = priority_queue<T>;
template <typename T>
using MinHeap = priority_queue<T, vector<T>, greater<T>>;
namespace Mul {
const double pi = acos(-1.0);
struct Complex {
  double re, im;
  Complex(double _re = 0, double _im = 0) : re(_re), im(_im) {}
  Complex operator+(const Complex &x) const { return {re + x.re, im + x.im}; }
  Complex operator-(const Complex &x) const { return {re - x.re, im - x.im}; }
  Complex operator*(const Complex &x) const {
    return {re * x.re - im * x.im, re * x.im + im * x.re};
  }
};
void fft(vector<Complex> &a, int dir) {
  int n = a.size();
  for (int i = 0, j = 1; j < n - 1; j++) {
    for (int k = n >> 1; k > (i ^= k); k >>= 1)
      ;
    if (i < j) swap(a[i], a[j]);
  }
  for (int m = 1; m + m <= n; m <<= 1) {
    Complex wm(cos(dir * pi / m), sin(dir * pi / m));
    for (int k = 0; k < n; k += m + m) {
      Complex w = 1;
      for (int j = k; j < k + m; j++) {
        Complex u = a[j], v = a[j + m] * w;
        a[j] = u + v;
        a[j + m] = u - v;
        w = w * wm;
      }
    }
  }
}
void mul(int na, const int *a, int nb, const int *b, int *c) {
  static vector<Complex> x, y;
  assert(na > 0 && nb > 0);
  int n = 1;
  while (n < 2 * max(na, nb)) n *= 2;
  x.resize(n);
  y.resize(n);
  for (int i = 0; i < n; i++) x[i] = y[i] = 0;
  for (int i = 0; i < na; i++) x[i] = a[i];
  for (int i = 0; i < nb; i++) y[i] = b[i];
  fft(x, +1);
  fft(y, +1);
  for (int i = 0; i < n; i++) x[i] = x[i] * y[i];
  fft(x, -1);
  for (int i = 0; i < n; i++) x[i].re /= n;
  for (int i = 0; i < na + nb - 1; i++) c[i] = x[i].re + 0.5;
}
vector<int> mul(const vector<int> &a, const vector<int> &b) {
  int na = a.size(), nb = b.size();
  assert(na > 0 && nb > 0);
  vector<int> c(na + nb - 1);
  mul(na, a.data(), nb, b.data(), c.data());
  return c;
}
};  // namespace Mul
using Mul::mul;
const int N = 1e6 + 10;
int n, a[N], b[N], c[N];
char s[N];
bool z[N];
void go(char c1, char c2) {
  for (int i = 0; i < int(n); i++) a[i] = (s[i] == c1);
  for (int i = 0; i < int(n); i++) b[i] = (s[n - i - 1] == c2);
  mul(n, a, n, b, c);
  for (int i = 0; i < int(2 * n - 1); i++)
    if (c[i]) z[abs(i - n + 1)] |= 1;
}
int main() {
  int t;
  R(t);
  while (t--) {
    R(n, s);
    for (int i = (1); i <= int(n); i++) z[i] = 0;
    go('V', 'K');
    vector<int> sol;
    for (int i = (1); i <= int(n); i++) {
      bool zz = 0;
      for (int j = i; j < n && !zz; j += i) zz |= z[j];
      if (!zz) sol.push_back(i);
    }
    W(((int)(sol).size()));
    W(sol);
  }
  return 0;
}