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;
long double PI = acosl(-1);
char str[500005];
int dp[2000000], vis[2000000], cs = 1;
struct base {
  long double a, b;
  base(long double a = 0, long double b = 0) : a(a), b(b) {}
  const base operator+(const base &c) const { return base(a + c.a, b + c.b); }
  const base operator-(const base &c) const { return base(a - c.a, b - c.b); }
  const base operator*(const base &c) const {
    return base(a * c.a - b * c.b, a * c.b + b * c.a);
  }
};
void fft(vector<base> &p, bool inv = 0) {
  int n = p.size(), i = 0;
  for (int j = 1; j < n - 1; ++j) {
    for (int k = n >> 1; k > (i ^= k); k >>= 1)
      ;
    if (j < i) swap(p[i], p[j]);
  }
  for (long long l = 1, m; (m = l << 1) <= n; l <<= 1) {
    long double ang = 2 * PI / m;
    base wn = base(cos(ang), (inv ? 1. : -1.) * sin(ang)), w;
    for (int i = 0, j, k; i < n; i += m) {
      for (w = base(1, 0), j = i, k = i + l; j < k; ++j, w = w * wn) {
        base t = w * p[j + l];
        p[j + l] = p[j] - t;
        p[j] = p[j] + t;
      }
    }
  }
  if (inv)
    for (int i = 0; i < n; ++i) p[i].a /= n, p[i].b /= n;
}
void multiply(vector<long long> &a, vector<long long> &b) {
  int n = a.size(), m = b.size(), t = n + m - 1, sz = 1;
  while (sz < t) sz <<= 1;
  vector<base> x(sz), y(sz), z(sz);
  for (int i = 0; i < sz; ++i) {
    x[i] = i < a.size() ? base(a[i], 0) : base(0, 0);
    y[i] = i < b.size() ? base(b[i], 0) : base(0, 0);
  }
  fft(x), fft(y);
  for (int i = 0; i < sz; ++i) z[i] = x[i] * y[i];
  fft(z, 1);
  vector<long long> ret(sz);
  for (int i = 0; i < sz; ++i) ret[i] = z[i].a + 0.5;
  while (ret.size() > 1 && ret.back() == 0) ret.pop_back();
  for (int i = 0; i < ret.size(); i++) {
    if (vis[i] != cs) {
      dp[i] = 0;
      vis[i] = cs;
    }
    dp[i] += ret[i];
  }
}
vector<long long> vc, rc;
int lim, sz;
void func(int ch, int ch2) {
  vc.clear();
  rc.clear();
  for (int i = 0, j = sz; str[i]; i++, j--) {
    if (str[i] == ch)
      vc.push_back(1);
    else
      vc.push_back(0);
    if (str[j] == ch2)
      rc.push_back(1);
    else
      rc.push_back(0);
  }
  multiply(vc, rc);
}
int main() {
  int i, j, k, l, m, n, ts;
  scanf("%d", &ts);
  while (ts--) {
    cin >> n;
    scanf("%s", &str);
    cs++;
    sz = n - 1;
    lim = (sz * 2) + 1;
    func('V', 'K');
    func('K', 'V');
    vector<int> dc;
    for (int i = 1; i <= sz; i++) {
      int ck = 0;
      for (int j = i; j < n; j += i) {
        if (dp[j + sz] && vis[j + sz] == cs) ck = 1;
      }
      if (ck == 0) dc.push_back(i);
    }
    dc.push_back(sz + 1);
    printf("%d\n", dc.size());
    for (int i = 0; i < dc.size(); i++) {
      printf("%d ", dc[i]);
    }
    printf("\n");
  }
}