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;
constexpr int md = (int)998244353;
inline int add(int a, int b) {
  a += b;
  if (a >= md) a -= md;
  return a;
}
inline int sub(int a, int b) {
  a -= b;
  if (a < 0) a += md;
  return a;
}
inline int mul(int a, int b) { return (int)((long long)a * b % md); }
inline int powmod(int a, long long b) {
  int res = 1;
  while (b > 0) {
    if (b & 1) res = mul(res, a);
    a = mul(a, a);
    b >>= 1;
  }
  return res;
}
inline int inv(int a) {
  a %= md;
  if (a < 0) a += md;
  int b = md, u = 0, v = 1;
  while (a) {
    int t = b / a;
    b -= t * a;
    swap(a, b);
    u -= t * v;
    swap(u, v);
  }
  assert(b == 1);
  if (u < 0) u += md;
  return u;
}
constexpr int mod = 998244353;
std::vector<int> rev, roots{0, 1};
void dft(std::vector<int>& a) {
  int n = a.size();
  if (int(rev.size()) != n) {
    int k = __builtin_ctz(n) - 1;
    rev.resize(n);
    for (int i = 0; i < n; ++i) rev[i] = rev[i >> 1] >> 1 | (i & 1) << k;
  }
  for (int i = 0; i < n; ++i)
    if (rev[i] < i) std::swap(a[i], a[rev[i]]);
  if (int(roots.size()) < n) {
    int k = __builtin_ctz(roots.size());
    roots.resize(n);
    while ((1 << k) < n) {
      int e = powmod(3, (mod - 1) >> (k + 1));
      for (int i = 1 << (k - 1); i < (1 << k); ++i) {
        roots[2 * i] = roots[i];
        roots[2 * i + 1] = 1ll * roots[i] * e % mod;
      }
      ++k;
    }
  }
  for (int k = 1; k < n; k *= 2) {
    for (int i = 0; i < n; i += 2 * k) {
      for (int j = 0; j < k; ++j) {
        int u = a[i + j];
        int v = 1ll * a[i + j + k] * roots[k + j] % mod;
        int x = u + v;
        if (x >= mod) x -= mod;
        a[i + j] = x;
        x = u - v;
        if (x < 0) x += mod;
        a[i + j + k] = x;
      }
    }
  }
}
void idft(std::vector<int>& a) {
  int n = a.size();
  std::reverse(a.begin() + 1, a.end());
  dft(a);
  int inv = powmod(n, mod - 2);
  for (int i = 0; i < n; ++i) a[i] = 1ll * a[i] * inv % mod;
}
struct Poly {
  std::vector<int> a;
  Poly() {}
  Poly(int a0) {
    if (a0) a = {a0};
  }
  Poly(const std::vector<int>& a1) : a(a1) {}
  int size() const { return a.size(); }
  int operator[](int idx) const {
    if (idx < 0 || idx >= size()) return 0;
    return a[idx];
  }
  Poly mulxk(int k) const {
    auto b = a;
    b.insert(b.begin(), k, 0);
    return Poly(b);
  }
  Poly modxk(int k) const {
    k = std::min(k, size());
    return Poly(std::vector<int>(a.begin(), a.begin() + k));
  }
  Poly divxk(int k) const {
    if (size() <= k) return Poly();
    return Poly(std::vector<int>(a.begin() + k, a.end()));
  }
  friend Poly operator+(const Poly a, const Poly& b) {
    std::vector<int> res(std::max(a.size(), b.size()));
    for (int i = 0; i < int(res.size()); ++i) {
      res[i] = a[i] + b[i];
      if (res[i] >= mod) res[i] -= mod;
    }
    return Poly(res);
  }
  friend Poly operator-(const Poly a, const Poly& b) {
    std::vector<int> res(std::max(a.size(), b.size()));
    for (int i = 0; i < int(res.size()); ++i) {
      res[i] = a[i] - b[i];
      if (res[i] < 0) res[i] += mod;
    }
    return Poly(res);
  }
  friend Poly operator*(Poly a, Poly b) {
    int sz = 1, tot = a.size() + b.size() - 1;
    while (sz < tot) sz *= 2;
    a.a.resize(sz);
    b.a.resize(sz);
    dft(a.a);
    dft(b.a);
    for (int i = 0; i < sz; ++i) a.a[i] = 1ll * a[i] * b[i] % mod;
    idft(a.a);
    return Poly(a.a);
  }
  Poly& operator+=(Poly b) { return (*this) = (*this) + b; }
  Poly& operator-=(Poly b) { return (*this) = (*this) - b; }
  Poly& operator*=(Poly b) { return (*this) = (*this) * b; }
  Poly deriv() const {
    if (a.empty()) return Poly();
    std::vector<int> res(size() - 1);
    for (int i = 0; i < size() - 1; ++i)
      res[i] = 1ll * (i + 1) * a[i + 1] % mod;
    return Poly(res);
  }
  Poly integr() const {
    if (a.empty()) return Poly();
    std::vector<int> res(size() + 1);
    for (int i = 0; i < size(); ++i)
      res[i + 1] = 1ll * a[i] * powmod(i + 1, mod - 2) % mod;
    return Poly(res);
  }
  Poly inv(int m) const {
    Poly x(powmod(a[0], mod - 2));
    int k = 1;
    while (k < m) {
      k *= 2;
      x = (x * (2 - modxk(k) * x)).modxk(k);
    }
    return x.modxk(m);
  }
  Poly log(int m) const { return (deriv() * inv(m)).integr().modxk(m); }
  Poly exp(int m) const {
    Poly x(1);
    int k = 1;
    while (k < m) {
      k *= 2;
      x = (x * (1 - x.log(k) + modxk(k))).modxk(k);
    }
    return x.modxk(m);
  }
  Poly mulT(Poly b) const {
    if (b.size() == 0) return Poly();
    int n = b.size();
    std::reverse(b.a.begin(), b.a.end());
    return ((*this) * b).divxk(n - 1);
  }
  std::vector<int> eval(std::vector<int> x) const {
    if (size() == 0) return std::vector<int>(x.size(), 0);
    const int n = std::max(int(x.size()), size());
    std::vector<Poly> q(4 * n);
    std::vector<int> ans(x.size());
    x.resize(n);
    std::function<void(int, int, int)> build = [&](int p, int l, int r) {
      if (r - l == 1) {
        q[p] = std::vector<int>{1, (mod - x[l]) % mod};
      } else {
        int m = (l + r) / 2;
        build(2 * p, l, m);
        build(2 * p + 1, m, r);
        q[p] = q[2 * p] * q[2 * p + 1];
      }
    };
    build(1, 0, n);
    std::function<void(int, int, int, const Poly&)> work =
        [&](int p, int l, int r, const Poly& num) {
          if (r - l == 1) {
            if (l < int(ans.size())) ans[l] = num[0];
          } else {
            int m = (l + r) / 2;
            work(2 * p, l, m, num.mulT(q[2 * p + 1]).modxk(m - l));
            work(2 * p + 1, m, r, num.mulT(q[2 * p]).modxk(r - m));
          }
        };
    work(1, 0, n, mulT(q[1].inv(n)));
    return ans;
  }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    string s;
    cin >> s;
    auto rs = s;
    reverse(rs.begin(), rs.end());
    vector<int> va(n, 0);
    vector<int> vb(n, 0);
    for (int i = 0; i < n; i++) {
      if (s[i] == 'V') va[i] = 1;
      if (rs[i] == 'K') vb[i] = 1;
    }
    Poly pa(va);
    Poly pb(vb);
    pa = pa * pb;
    vector<int> res;
    for (int i = 1; i <= n; i++) {
      bool f = true;
      for (int j = i; j < n; j += i) {
        if (pa.a[n - 1 - j] || pa.a[n - 1 + j]) {
          f = false;
          break;
        }
      }
      if (f) res.push_back(i);
    }
    cout << res.size() << '\n';
    for (auto i : res) cout << i << " ";
    cout << '\n';
  }
  return 0;
}