description: Theofanis has a string s_1 s_2 ... s_n and a character c. He wants to make all characters of the string equal to c using the minimum number of operations.
  
  In one operation he can choose a number x (1 ≤ x ≤ n) and for every position i, where i is not divisible by x, replace s_i with c. 
  
  Find the minimum number of operations required to make all the characters equal to c and the x-s that he should use in his operations.
  
  Input
  
  The first line contains a single integer t (1 ≤ t ≤ 10^4) — the number of test cases.
  
  The first line of each test case contains the integer n (3 ≤ n ≤ 3 ⋅ 10^5) and a lowercase Latin letter c — the length of the string s and the character the resulting string should consist of.
  
  The second line of each test case contains a string s of lowercase Latin letters — the initial string.
  
  It is guaranteed that the sum of n over all test cases does not exceed 3 ⋅ 10^5.
  
  Output
  
  For each test case, firstly print one integer m — the minimum number of operations required to make all the characters equal to c.
  
  Next, print m integers x_1, x_2, ..., x_m (1 ≤ x_j ≤ n) — the x-s that should be used in the order they are given.
  
  It can be proved that under given constraints, an answer always exists. If there are multiple answers, print any.
  
  Example
  
  Input
  
  
  3
  4 a
  aaaa
  4 a
  baaa
  4 b
  bzyx
  
  
  Output
  
  
  0
  1
  2
  2 
  2 3
  
  Note
  
  Let's describe what happens in the third test case: 
  
    1. x_1 = 2: we choose all positions that are not divisible by 2 and replace them, i. e. bzyx → bzbx; 
    2. x_2 = 3: we choose all positions that are not divisible by 3 and replace them, i. e. bzbx → bbbb. 
solution: import java.io.*;
  import java.util.*;
  
  import static java.lang.Math.max;
  import static java.lang.Math.min;
  
  public class Main {
  
  
      static int[] readArray(int size, InputReader in, boolean subOne) {
          int[] a = new int[size];
          for (int i = 0; i < size; i++) {
              a[i] = in.nextInt() + (subOne ? -1 : 0);
          }
          return a;
      }
  
      static long[] readLongArray(int size, InputReader in) {
          long[] a = new long[size];
          for (int i = 0; i < size; i++) {
              a[i] = in.nextLong();
          }
          return a;
      }
  
      static void sortArray(long[] a) {
          Random random = new Random();
  
          for (int i = 0; i < a.length; i++) {
              int randomPos = random.nextInt(a.length);
              long t = a[i];
              a[i] = a[randomPos];
              a[randomPos] = t;
          }
          Arrays.sort(a);
      }
  
      static int[] sieveOfEuler(int size, List<Integer> primes) {
          int[] lp = new int[size];
  
          lp[1] = 1;
  
          for (int j = 2; j < lp.length; ++j) {
              if (lp[j] == 0) {
                  lp[j] = j;
                  primes.add(j);
              }
              for (Integer p : primes) {
                  if (p > lp[j] || p * j >= size) {
                      break;
                  }
                  lp[p * j] = p;
              }
          }
          return lp;
      }
  
  
      public static void main(String[] args) throws FileNotFoundException {
  //        long startTime = System.currentTimeMillis();
  
  //        PrintWriter out = new PrintWriter(new BufferedOutputStream(new FileOutputStream("cowrect.out")));
          InputReader in = new InputReader(System.in);
  //        InputReader in = new InputReader(new FileInputStream("input.txt"));
          PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
          int t = in.nextInt();
  
  //        ArrayList<Integer> primes = new ArrayList<>();
  //        int[] sieve = sieveOfEuler(3 * 100005, primes);
  
          outer:
          for (int ii = 0; ii < t; ii++) {
              int n = in.nextInt();
              char c = in.nextChar();
              String s = in.nextString();
  
              boolean allGood = true;
              boolean[] bad = new boolean[n];
              for (int i = 0; i < n; i++) {
                  if (s.charAt(i) != c) {
                      bad[i] = true;
                      allGood = false;
                  }
              }
  
              if (allGood) {
                  out.println(0);
                  continue;
              }
  
              if (!bad[n - 1]) {
                  out.println(1);
                  out.println(n);
                  continue;
              }
  
              for (int i = n-2; i >= 0; i--) {
                  if ((i + 1) * 2 <= n) {
                      break;
                  }
                  if (!bad[i]) {
                      out.println(1);
                      out.println(i+1);
                      continue outer;
                  }
              }
  
              for (int i = 2; i <= n; i++) {
                  if (n % i != 0) {
                      out.println(2);
                      out.println(n + " " + i);
                      continue outer;
                  }
              }
  
  
          }
  
  
          out.close();
      }
  
      private static void outputArray(Iterable<Integer> ans, PrintWriter out, boolean addOne) {
          StringBuilder str = new StringBuilder();
          for (long an : ans) {
              str.append(addOne ? (an + 1) : an).append(" ");
          }
          out.println(str);
  //        out.flush();
      }
  
      private static class InputReader {
          public BufferedReader reader;
          public StringTokenizer tokenizer;
  
          public InputReader(InputStream stream) {
              reader = new BufferedReader(new InputStreamReader(stream), 32768);
              tokenizer = null;
          }
  
          public String next() {
              while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                  try {
                      tokenizer = new StringTokenizer(reader.readLine());
                  } catch (IOException e) {
                      throw new RuntimeException(e);
                  }
              }
              return tokenizer.nextToken();
          }
  
          public String nextString() {
              try {
                  return reader.readLine();
              } catch (IOException e) {
                  throw new RuntimeException(e);
              }
          }
  
          public int nextInt() {
              return Integer.parseInt(next());
          }
  
          public long nextLong() {
              return Long.parseLong(next());
          }
  
          public double nextDouble() {
              return Double.parseDouble(next());
          }
  
          public char nextChar() {
              return next().charAt(0);
          }
  
          public String nextWord() {
              return next();
          }
  
          private List<Integer>[] readTree(int n) {
              return readGraph(n, n - 1);
          }
  
          private List<Integer>[] readGraph(int n, int m) {
              List<Integer>[] result = new List[n];
              for (int i = 0; i < n; i++) {
                  result[i] = new ArrayList<>();
              }
              for (int i = 0; i < m; i++) {
                  int u = nextInt() - 1;
                  int v = nextInt() - 1;
                  result[u].add(v);
                  result[v].add(u);
              }
              return result;
          }
  
          private Map<Integer, Long>[] readWeightedGraph(int n, int m) {
              Map<Integer, Long>[] result = new HashMap[n];
              for (int i = 0; i < n; i++) {
                  result[i] = new HashMap<>();
              }
              for (int i = 0; i < m; i++) {
                  int u = nextInt() - 1;
                  int v = nextInt() - 1;
                  long w = nextLong();
                  result[u].put(v, min(w, result[u].getOrDefault(v, Long.MAX_VALUE)));
                  result[v].put(u, min(w, result[v].getOrDefault(u, Long.MAX_VALUE)));
              }
              return result;
          }
  
      }
  }