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, class V>
ostream &operator<<(ostream &s, pair<T, V> a) {
  s << a.first << ' ' << a.second;
  return s;
}
struct FFT {
  struct cd {
    double a, b;
    cd(double _a = 0, double _b = 0) : a(_a), b(_b) {}
    cd operator+(cd &o) { return cd(a + o.a, b + o.b); }
    cd operator-(cd &o) { return cd(a - o.a, b - o.b); }
    cd operator*(cd &o) { return cd(a * o.a - b * o.b, a * o.b + b * o.a); }
    cd operator/(double d) { return cd(a / d, b / d); }
    cd pw(long long int n) {
      if (n == 0) return cd(1);
      cd ans(1);
      cd temp = *this;
      while (n) {
        if (n & 1) ans = ans * temp;
        temp = temp * temp;
        n >>= 1;
      }
      return ans;
    }
  };
  vector<cd> w[2];
  vector<int> r;
  int M = 1;
  void pre(int n) {
    M = 1;
    int u = 0;
    while (M < n) M <<= 1, u++;
    r.resize(M);
    w[0].resize(M, cd(1));
    w[1].resize(M, cd(1));
    for (int i = 1; i < M; i++) {
      int l = __builtin_ctz(i);
      r[i] = r[i ^ (1 << l)] | (1 << (u - l - 1));
      double d = 2 * (acos(-1)) * i / M;
      w[0][i] = cd(cos(d), sin(d));
      w[1][i] = cd(cos(d), -sin(d));
    }
  }
  void fft(vector<cd> &a, bool inv = false) {
    for (int i = 0; i < M; i++)
      if (i < r[i]) swap(a[i], a[r[i]]);
    for (int len = 2, l2 = 1; len <= M; len <<= 1, l2 <<= 1) {
      for (int i = 0, inc = M / len; i < M; i += len) {
        for (int j = 0, l = 0; j < l2; j++, l += inc) {
          cd u = a[i + j], v = a[i + j + l2] * w[inv][l];
          a[i + j] = u + v;
          a[i + j + l2] = u - v;
        }
      }
    }
    if (inv) {
      for (auto &x : a) x = x / (double)M;
    }
  }
  void fft2D(vector<vector<cd>> &v, bool inv = false) {
    pre(v[0].size());
    for (auto &x : v) fft(x, inv);
    pre(v.size());
    for (int i = 0; i < v[0].size(); i++) {
      vector<cd> temp(v.size());
      for (int j = 0; j < v.size(); j++) temp[j] = v[j][i];
      fft(temp, inv);
      for (int j = 0; j < v.size(); j++) v[j][i] = temp[j];
    }
  }
  template <class T>
  void multiply(vector<T> &a, vector<T> &b, vector<T> &res) {
    vector<cd> v1(M), v2(M);
    for (int i = 0; i < a.size(); i++) v1[i].a = a[i];
    for (int i = 0; i < b.size(); i++) v2[i].a = b[i];
    fft(v1);
    fft(v2);
    for (int i = 0; i < M; i++) v1[i] = v1[i] * v2[i];
    fft(v1, 1);
    res.resize(M);
    for (int i = 0; i < M; i++) res[i] = round(v1[i].a);
  }
  template <class T>
  void multiply2D(vector<vector<T>> &a, vector<vector<T>> &b,
                  vector<vector<T>> &res) {
    int n = max(a.size(), b.size());
    int m = max(a[0].size(), b[0].size());
    int Mxn = 1, Mxm = 1;
    while (Mxn < n) Mxn <<= 1;
    Mxn <<= 1;
    while (Mxm < m) Mxm <<= 1;
    Mxm <<= 1;
    vector<vector<cd>> v1(Mxn, vector<cd>(Mxm)), v2(Mxn, vector<cd>(Mxm));
    for (int i = 0; i < a.size(); i++) {
      for (int j = 0; j < a[i].size(); j++) v1[i][j] = a[i][j];
    }
    for (int i = 0; i < b.size(); i++) {
      for (int j = 0; j < b[i].size(); j++) v2[i][j] = b[i][j];
    }
    fft2D(v1);
    fft2D(v2);
    for (int i = 0; i < Mxn; i++)
      for (int j = 0; j < Mxm; j++) v1[i][j] = v1[i][j] * v2[i][j];
    fft2D(v1, 1);
    res.resize(Mxn);
    for (int i = 0; i < Mxn; i++) {
      res[i].resize(Mxm);
      for (int j = 0; j < Mxm; j++) res[i][j] = v1[i][j];
    }
  }
  void POWER(vector<long long int> &a, long long int n,
             vector<long long int> &res) {
    vector<cd> v1(M);
    for (int i = 0; i < a.size(); i++) v1[i].a = a[i];
    fft(v1);
    for (int i = 0; i < M; i++) v1[i] = v1[i].pw(n);
    fft(v1, 1);
    res.resize(M);
    for (int i = 0; i < M; i++) res[i] = round(v1[i].a);
  }
} ft;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int T = 1;
  cin >> T;
  for (int qq = 1; qq <= T; qq++) {
    int n;
    cin >> n;
    string s;
    cin >> s;
    vector<int> v1(n), v2(n);
    for (int i = 0; i < n; i++) {
      if (s[i] == 'V')
        v1[i] = 1;
      else if (s[i] == 'K')
        v2[n - i - 1] = 1;
    }
    vector<int> v3, v4;
    ft.pre(2 * n);
    ft.multiply(v1, v2, v3);
    reverse(v1.begin(), v1.end());
    reverse(v2.begin(), v2.end());
    ft.multiply(v2, v1, v4);
    vector<long long int> ans;
    for (int i = 1; i <= n; i++) {
      bool ok = true;
      for (int j = i; j < n; j += i) ok &= (v3[n - j - 1] + v4[n - j - 1] == 0);
      if (ok) ans.push_back(i);
    }
    printf("%d\n", (int)ans.size());
    for (auto x : ans) printf("%lld ", x);
    printf("\n");
  }
}