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:  //package eround101;
  
  import java.util.*;
  import java.io.*;
  import java.lang.*;
  import java.util.StringTokenizer;
  
  public class C101 {
  
      static HritikScanner sc = new HritikScanner();
      static PrintWriter pw = new PrintWriter(System.out, true);
      final static int MOD = 1000000007;
      static StringBuilder sb = new StringBuilder();
  
      public static void main(String[] args) {
  
          int t = ni();
          while (t-- > 0) {
              solve();
          }
      }
  
      static void solve() {
          int n = ni();
          char c = sc.next().charAt(0);
          char[] arr = sc.next().toCharArray();
          char[] clone = arr.clone();
          Arrays.sort(clone);
          if(clone[0] == clone[n-1] && clone[0] == c && clone[n-1] == c)
          {
              pl(0);
              return;
          }
          if(arr[n-1] == c)
          {
              pl(1);
              pl(n);
              return;
          }
          for(int i = n-2; i >= 0; i--)
          {
              if(n%(i+1) != 0 && arr[i] == c)
              {
                  int chk = (i+1);
                  int num = chk;
                  int mult = 1;
                  boolean flag = false;
                  while(num <= n)
                  {
                      if(arr[num-1] != c)
                      {
                          flag = true;
                          break;
                      }
                      mult++;
                      num = chk*mult;
                  }
                  if(flag == false)
                  {
                      pl(1);
                      pl(i+1);
                      return;
                  }
              }
          }
          pl(2);
          pl(n-1 + " " + n);
      }
      
      /////////////////////////////////////////////////////////////////////////////////
      static class FenwickTree{ // Binary Index Tree
          int[] tree;
          static int size;
          
          public FenwickTree(int size)
          {
              this.size = size;
              tree = new int[size+5];
          }
          
          public void add(int i, int val)
          {
              while(i <= size)
              {
                  tree[i] += val;
                  i += i & -i;  // adding the decimal value of the last set bit.
              }
          }
          
          public int sum(int i)
          {
              int res = 0;
              while(i >= 1)
              {
                  res += tree[i];
                  i -= i & -i; // deleting the last set bit
              }
              return res;
          }
          
          public int sum(int l, int r)
          {
              return sum(r) - sum(l-1);
          }
      }
      
      /////////////////////////////////////////////////////////////////////////////////
      static int[] nextIntArray(int n) {
          int[] arr = new int[n];
          int i = 0;
          while (i < n) {
              arr[i++] = ni();
          }
          return arr;
      }
  
      static long[] nextLongArray(int n) {
          long[] arr = new long[n];
          int i = 0;
          while (i < n) {
              arr[i++] = nl();
          }
          return arr;
      }
  
      static int[] nextIntArray1(int n) {
          int[] arr = new int[n + 1];
          int i = 1;
          while (i <= n) {
              arr[i++] = ni();
          }
          return arr;
      }
  
      /////////////////////////////////////////////////////////////////////////////////
      static int ni() {
          return sc.nextInt();
      }
  
      static long nl() {
          return sc.nextLong();
      }
  
      static double nd() {
          return sc.nextDouble();
      }
  
      /////////////////////////////////////////////////////////////////////////////////
      static void pl() {
          pw.println();
      }
  
      static void p(Object o) {
          pw.print(o+ " ");
      }
  
      static void pl(Object o) {
          pw.println(o);
      }
  
      static void psb(StringBuilder sb) {
          pw.print(sb);
      }
  
      static void pa(Object arr[]) {
          for (Object o : arr) {
              p(o);
          }
          pl();
      }
  
      static void pa(int arr[]) {
          for (int o : arr) {
              p(o);
          }
          pl();
      }
  
      static void pa(long arr[]) {
          for (long o : arr) {
              p(o);
          }
          pl();
      }
  
      static void pa(double arr[]) {
          for (double o : arr) {
              p(o);
          }
          pl();
      }
  
      static void pa(char arr[]) {
          for (char o : arr) {
              p(o);
          }
          pl();
      }
  
      static void pa(List list) {
          for (Object o : list) {
              p(o);
          }
          pl();
      }
  
      static void pa(Object[][] arr) {
  
          for (int i = 0; i < arr.length; ++i) {
              for (Object o : arr[i]) {
                  p(o);
              }
              pl();
          }
      }
  
      static void pa(int[][] arr) {
          for (int i = 0; i < arr.length; ++i) {
              for (int o : arr[i]) {
                  p(o);
              }
              pl();
          }
      }
  
      static void pa(long[][] arr) {
          for (int i = 0; i < arr.length; ++i) {
              for (long o : arr[i]) {
                  p(o);
              }
              pl();
          }
      }
  
      static void pa(char[][] arr) {
          for (int i = 0; i < arr.length; ++i) {
              for (char o : arr[i]) {
                  p(o);
              }
              pl();
          }
      }
  
      static void pa(double[][] arr) {
          for (int i = 0; i < arr.length; ++i) {
              for (double o : arr[i]) {
                  p(o);
              }
              pl();
          }
      }
  
  /////////////////////////////////////////////////////////////////////////////////
      static void print(Object s) {
          System.out.println(s);
      }
  
      /////////////////////////////////////////////////////////////////////////////////
      //-----------HritikScanner class for faster input----------//
      static class HritikScanner {
  
          BufferedReader br;
          StringTokenizer st;
  
          public HritikScanner() {
              br = new BufferedReader(new InputStreamReader(System.in));
          }
  
          String next() {
              while (st == null || !st.hasMoreElements()) {
                  try {
                      st = new StringTokenizer(br.readLine());
                  } catch (IOException e) {
                      e.printStackTrace();
                  }
              }
              return st.nextToken();
          }
  
          int nextInt() {
              return Integer.parseInt(next());
          }
  
          long nextLong() {
              return Long.parseLong(next());
          }
  
          double nextDouble() {
              return Double.parseDouble(next());
          }
  
          String nextLine() {
              String str = "";
              try {
                  str = br.readLine();
              } catch (IOException e) {
                  e.printStackTrace();
              }
              return str;
          }
      }
  
      //////////////////////////////////////////////////////////////////
      public static class Pair implements Comparable<Pair> {
  
          int num, row,col;
  
          Pair(int num, int row, int col) {
              this.num = num;
              this.row = row;
              this.col = col;
          }
  
          public int get1() {
              return num;
          }
  
          public int get2() {
              return row;
          }
  
          public int compareTo(Pair A) {
              return this.num - A.num;
          }
          
          public String toString()
          {
              return num +" "+ row+" "+col;
          }
      }
  
      //////////////////////////////////////////////////////////////////
      // Function to return gcd of a and b time complexity O(log(a+b))
      static long gcd(long a, long b) {
          if (a == 0) {
              return b;
          }
          return gcd(b % a, a);
      }
  
      // method to return LCM of two numbers 
      static long lcm(int a, int b) {
          return (a / gcd(a, b)) * b;
      }
  
      //////////////////////////////////////////////////////////////////
      static boolean isPrime(long n) {
          // Corner cases 
          if (n <= 1) {
              return false;
          }
          if (n <= 3) {
              return true;
          }
  
          // This is checked so that we can skip  
          // middle five numbers in below loop 
          if (n % 2 == 0 || n % 3 == 0) {
              return false;
          }
  
          for (long i = 5; i * i <= n; i = i + 6) {
              if (n % i == 0 || n % (i + 2) == 0) {
                  return false;
              }
          }
  
          return true;
      }
      //////////////////////////////////////////////////////////////////
  
      static boolean isPowerOfTwo(long n) {
          if (n == 0) {
              return false;
          }
  
          return (long) (Math.ceil((Math.log(n) / Math.log(2))))
                  == (long) (Math.floor(((Math.log(n) / Math.log(2)))));
      }
  
      public static long getFact(int n) {
          long ans = 1;
          while (n > 0) {
              ans *= n;
              ans %= MOD;
              n--;
          }
          return ans;
      }
  
      public static long pow(long n, int pow) {
          if (pow == 0) {
              return 1;
          }
          long temp = pow(n, pow / 2) % MOD;
          temp *= temp;
          temp %= MOD;
          if (pow % 2 == 1) {
              temp *= n;
          }
          temp %= MOD;
          return temp;
  
      }
  
      public static long nCr(int n, int r) {
          long ans = 1;
          int temp = n - r;
          while (n > temp) {
              ans *= n;
              ans %= MOD;
              n--;
          }
          ans *= pow(getFact(r) % MOD, MOD - 2) % MOD;
          ans %= MOD;
          return ans;
      }
  
      //////////////////////////////////////////////////////////////////
      // method returns Nth power of A 
      static double nthRoot(int A, int N) {
  
          // intially guessing a random number between 
          // 0 and 9 
          double xPre = Math.random() % 10;
  
          // smaller eps, denotes more accuracy 
          double eps = 0.001;
  
          // initializing difference between two 
          // roots by INT_MAX 
          double delX = 2147483647;
  
          // xK denotes current value of x 
          double xK = 0.0;
  
          // loop untill we reach desired accuracy 
          while (delX > eps) {
              // calculating current value from previous 
              // value by newton's method 
              xK = ((N - 1.0) * xPre
                      + (double) A / Math.pow(xPre, N - 1)) / (double) N;
              delX = Math.abs(xK - xPre);
              xPre = xK;
          }
  
          return xK;
      }
  
  }
  