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;
inline void read(int &x) {
  char ch;
  while ((ch = getchar()), (ch < '0' || ch > '9'))
    ;
  x = ch - '0';
  while ((ch = getchar()), (ch >= '0' && ch <= '9')) x = x * 10 + (ch - '0');
}
inline void readstr(char *p) {
  char ch;
  while ((ch = getchar()), (ch < 33 || ch > 127))
    ;
  *(p++) = ch;
  while ((ch = getchar()), (ch >= 33 && ch <= 127)) *(p++) = ch;
  *(p++) = 0;
}
const double PI = acos(-1.0);
struct virt {
  double r, i;
  inline virt operator+(virt rhs) const { return (virt){r + rhs.r, i + rhs.i}; }
  inline virt operator-(virt rhs) const { return (virt){r - rhs.r, i - rhs.i}; }
  inline virt operator*(virt rhs) const {
    return (virt){r * rhs.r - i * rhs.i, r * rhs.i + i * rhs.r};
  }
};
inline void rader(virt A[], int n) {
  int i, j = n >> 1, k;
  for (i = 1; i < (n - 1); i++) {
    if (i < j) swap(A[i], A[j]);
    k = n >> 1;
    while (j >= k) j -= k, k /= 2;
    j += k;
  }
}
inline void fft(virt A[], int n, int on = 1) {
  int i, h, k;
  rader(A, n);
  for (h = 2; h <= n; h <<= 1) {
    virt wn = {cos(-on * 2.0 * PI / h), sin(-on * 2.0 * PI / h)};
    for (k = 0; k < n; k += h) {
      virt w = {1, 0};
      for (i = k; i < k + h / 2; i++) {
        virt u = A[i];
        virt t = w * A[i + h / 2];
        A[i] = u + t;
        A[i + h / 2] = u - t;
        w = w * wn;
      }
    }
  }
  if (on < 0)
    for (i = 0; i < n; i++) A[i].r /= n;
}
inline void conv(virt A[], virt B[], virt R[], int n) {
  int i;
  fft(A, n, 1);
  fft(B, n, 1);
  for (i = 0; i < n; i++) R[i] = A[i] * B[i];
  fft(R, n, -1);
}
const int MAXN = 500010;
const int MAXC = 1048576;
char str[MAXN];
int N, C;
virt A[MAXC], B[MAXC], R[MAXC];
int Ans[MAXN];
int main() {
  int i, k, T;
  read(T);
  while (T--) {
    read(N);
    readstr(str);
    for (C = 1; C < N; C <<= 1)
      ;
    C <<= 1;
    for (i = 0; i < C; i++) A[i] = B[i] = (virt){0, 0};
    for (i = 0; i < N; i++) {
      if (str[i] == 'V')
        A[i].r = 1;
      else if (str[i] == 'K')
        B[N - i].r = 1;
    }
    conv(A, B, R, C);
    int Num = 0;
    for (k = 1; k <= N; k++) {
      bool ok = 1;
      for (i = k; i < N; i += k)
        if (((R[i + N].r) >= 0.5) || ((R[N - i].r) >= 0.5)) {
          ok = 0;
          break;
        }
      if (ok) Ans[++Num] = k;
    }
    printf("%d\n", Num);
    for (i = 1; i <= Num; i++) printf("%d ", Ans[i]);
    putchar('\n');
  }
}