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... As>
struct tpl : public std::tuple<As...> {
  using std::tuple<As...>::tuple;
  template <typename T = tuple<As...>>
  typename tuple_element<0, T>::type const& x() const {
    return get<0>(*this);
  }
  template <typename T = tuple<As...>>
  typename tuple_element<0, T>::type& x() {
    return get<0>(*this);
  }
  template <typename T = tuple<As...>>
  typename tuple_element<1, T>::type const& y() const {
    return get<1>(*this);
  }
  template <typename T = tuple<As...>>
  typename tuple_element<1, T>::type& y() {
    return get<1>(*this);
  }
  template <typename T = tuple<As...>>
  typename tuple_element<2, T>::type const& z() const {
    return get<2>(*this);
  }
  template <typename T = tuple<As...>>
  typename tuple_element<2, T>::type& z() {
    return get<2>(*this);
  }
  template <typename T = tuple<As...>>
  typename tuple_element<3, T>::type const& w() const {
    return get<3>(*this);
  }
  template <typename T = tuple<As...>>
  typename tuple_element<3, T>::type& w() {
    return get<3>(*this);
  }
};
using lli = long long int;
using llu = long long unsigned;
using pii = tpl<lli, lli>;
using piii = tpl<lli, lli, lli>;
using piiii = tpl<lli, lli, lli, lli>;
using vi = vector<lli>;
using vii = vector<pii>;
using viii = vector<piii>;
using vvi = vector<vi>;
using vvii = vector<vii>;
using vviii = vector<viii>;
template <class T>
using min_queue = priority_queue<T, vector<T>, greater<T>>;
template <class T>
using max_queue = priority_queue<T>;
template <size_t... I>
struct my_index_sequence {
  using type = my_index_sequence;
  static constexpr array<size_t, sizeof...(I)> value = {{I...}};
};
namespace my_index_sequence_detail {
template <typename I, typename J>
struct concat;
template <size_t... I, size_t... J>
struct concat<my_index_sequence<I...>, my_index_sequence<J...>>
    : my_index_sequence<I..., (sizeof...(I) + J)...> {};
template <size_t N>
struct make_index_sequence
    : concat<typename make_index_sequence<N / 2>::type,
             typename make_index_sequence<N - N / 2>::type>::type {};
template <>
struct make_index_sequence<0> : my_index_sequence<> {};
template <>
struct make_index_sequence<1> : my_index_sequence<0> {};
}  // namespace my_index_sequence_detail
template <class... A>
using my_index_sequence_for =
    typename my_index_sequence_detail::make_index_sequence<sizeof...(A)>::type;
template <class T, size_t... I>
void print_tuple(ostream& s, T const& a, my_index_sequence<I...>) {
  using swallow = int[];
  (void)swallow{0, (void(s << (I == 0 ? "" : ", ") << get<I>(a)), 0)...};
}
template <class T>
ostream& print_collection(ostream& s, T const& a);
template <class... A>
ostream& operator<<(ostream& s, tpl<A...> const& a);
template <class... A>
ostream& operator<<(ostream& s, tuple<A...> const& a);
template <class A, class B>
ostream& operator<<(ostream& s, pair<A, B> const& a);
template <class T, size_t I>
ostream& operator<<(ostream& s, array<T, I> const& a) {
  return print_collection(s, a);
}
template <class T>
ostream& operator<<(ostream& s, vector<T> const& a) {
  return print_collection(s, a);
}
template <class T, class U>
ostream& operator<<(ostream& s, multimap<T, U> const& a) {
  return print_collection(s, a);
}
template <class T>
ostream& operator<<(ostream& s, multiset<T> const& a) {
  return print_collection(s, a);
}
template <class T, class U>
ostream& operator<<(ostream& s, map<T, U> const& a) {
  return print_collection(s, a);
}
template <class T>
ostream& operator<<(ostream& s, set<T> const& a) {
  return print_collection(s, a);
}
template <class T>
ostream& print_collection(ostream& s, T const& a) {
  s << '[';
  for (auto it = begin(a); it != end(a); ++it) {
    s << *it;
    if (it != prev(end(a))) s << " ";
  }
  return s << ']';
}
template <class... A>
ostream& operator<<(ostream& s, tpl<A...> const& a) {
  s << '(';
  print_tuple(s, a, my_index_sequence_for<A...>{});
  return s << ')';
}
template <class... A>
ostream& operator<<(ostream& s, tuple<A...> const& a) {
  s << '(';
  print_tuple(s, a, my_index_sequence_for<A...>{});
  return s << ')';
}
template <class A, class B>
ostream& operator<<(ostream& s, pair<A, B> const& a) {
  return s << "(" << get<0>(a) << ", " << get<1>(a) << ")";
}
namespace std {
namespace {
template <class T>
inline void hash_combine(size_t& seed, T const& v) {
  seed ^= hash<T>()(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
}
template <class Tuple, size_t Index = tuple_size<Tuple>::value - 1>
struct HashValueImpl {
  static void apply(size_t& seed, Tuple const& tuple) {
    HashValueImpl<Tuple, Index - 1>::apply(seed, tuple);
    hash_combine(seed, get<Index>(tuple));
  }
};
template <class Tuple>
struct HashValueImpl<Tuple, 0> {
  static void apply(size_t& seed, Tuple const& tuple) {
    hash_combine(seed, get<0>(tuple));
  }
};
}  // namespace
template <typename... TT>
struct hash<tuple<TT...>> {
  size_t operator()(tuple<TT...> const& tt) const {
    size_t seed = 0;
    HashValueImpl<tuple<TT...>>::apply(seed, tt);
    return seed;
  }
};
template <typename... TT>
struct hash<tpl<TT...>> {
  size_t operator()(tpl<TT...> const& tt) const {
    size_t seed = 0;
    HashValueImpl<tuple<TT...>>::apply(seed, tt);
    return seed;
  }
};
}  // namespace std
lli read_positive() {
  char c;
  lli x = 0;
  do {
    c = getchar();
  } while (c < '0' || c > '9');
  while (c >= '0' && c <= '9') {
    x = 10 * x + (c - '0');
    c = getchar();
  }
  return x;
}
using cpx = complex<double>;
struct FFT {
  vector<double> COS, SIN;
  inline cpx EXP(int MAXK, int dir, int i) {
    return cpx(COS[i * ((1 << 20) / MAXK)], dir * SIN[i * ((1 << 20) / MAXK)]);
  }
  FFT() : COS((1 << 20) + 1), SIN((1 << 20) + 1) {
    for (lli i = 0; i < (lli)((1 << 20) + 1); ++i) {
      COS[i] = cos(2 * 3.141592653589793 * i / (double)(1 << 20));
      SIN[i] = sin(2 * 3.141592653589793 * i / (double)(1 << 20));
    }
  }
  void fft(int MAXK, cpx* in, cpx* out, int step, int size, int dir) {
    if (size == 1) {
      out[0] = in[0];
      return;
    }
    fft(MAXK, in, out, step * 2, size / 2, dir);
    fft(MAXK, in + step, out + size / 2, step * 2, size / 2, dir);
    for (lli i = 0; i < (lli)(size / 2); ++i) {
      cpx even = out[i];
      cpx odd = out[i + size / 2];
      out[i] = even + odd * EXP(MAXK, dir, i * step);
      out[i + size / 2] = even + odd * EXP(MAXK, dir, i * step + MAXK / 2);
    }
  }
};
const int N = 1 << 20;
cpx V0[N], K0[N];
cpx V2[N], K2[N];
cpx VK2[N];
cpx VK[N];
int main() {
  FFT fft;
  int T_;
  scanf("%d", &T_);
  for (lli t_ = 0; t_ < (lli)(T_); ++t_) {
    int n = -1;
  l2:;
    scanf("%d", &n);
    if (n == -1) goto l2;
    int size = N;
    while (size > 8 && n <= size / 4) {
      size /= 2;
    }
    for (lli i = 0; i < (lli)(size); ++i) V0[i] = 0;
    for (lli i = 0; i < (lli)(size); ++i) K0[i] = 0;
    for (lli i = 0; i < (lli)(n); ++i) {
      char c;
    l1:;
      scanf("%c", &c);
      if (c == 'K') {
        K0[i] = 1;
      } else if (c == 'V') {
        V0[n - i - 1] = 1;
      } else if (c == '?') {
      } else
        goto l1;
    }
    vi OK(n + 1, 1);
    OK[0] = 0;
    fft.fft(size, V0, V2, 1, size, 1);
    fft.fft(size, K0, K2, 1, size, 1);
    for (lli i = 0; i < (lli)(size); ++i) VK2[i] = V2[i] * K2[i];
    fft.fft(size, VK2, VK, 1, size, -1);
    for (lli i = 0; i < (lli)(2 * n - 1); ++i)
      if (VK[i].real() > size / 2) OK[abs(n - 1 - i)] = 0;
    for (lli i = (1); i <= (lli)(n - 1); ++i) {
      for (lli j = i; j < n; j += i) {
        OK[i] &= OK[j];
      }
    }
    int n0 = 1;
    for (lli d = (1); d <= (lli)(n - 1); ++d)
      if (OK[d]) n0++;
    printf("%d\n", n0);
    for (lli d = (1); d <= (lli)(n - 1); ++d)
      if (OK[d]) {
        printf("%d ", (int)d);
      }
    printf("%d\n", (int)n);
  }
  return 0;
}