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: /**
   * @author -- Sourav Joshi
   */
  import java.util.*;
  import java.io.*;
  
  import static java.lang.Math.*;
  
  public class Codeforces {
  /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
  static FastScanner s = new FastScanner();
  static FastWriter out = new FastWriter();
  final static int mod = 1000000000+7;
  final static int INT_MAX = Integer.MAX_VALUE;
  final static int INT_MIN = Integer.MIN_VALUE;
  final static long LONG_MAX = Long.MAX_VALUE;
  final static long LONG_MIN = Long.MIN_VALUE;
  final static double DOUBLE_MAX = Double.MAX_VALUE;
  final static double DOUBLE_MIN = Double.MIN_VALUE;
  final static float FLOAT_MAX = Float.MAX_VALUE;
  final static float FLOAT_MIN = Float.MIN_VALUE;
  /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
  static class FastScanner{BufferedReader br;StringTokenizer st;
  public FastScanner() {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;}}
  static class FastWriter{private final BufferedWriter bw;public FastWriter() {this.bw = new BufferedWriter(new OutputStreamWriter(System.out));}
  public void print(Object object) throws IOException{bw.append(""+ object);}
  public void println(Object object) throws IOException{print(object);bw.append("\n");}
  public void close() throws IOException{bw.close();}}
  /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
  public static ArrayList<Integer> seive(int n){ArrayList<Integer> list = new ArrayList<>();int arr[] = new int[n+1];for(int i = 2; i <= n; i++) {if(arr[i] == 1) {continue;}else {list.add(i);for(int j = i*i; j <= n; j = j + i) {arr[j] = 1;}}}return list;}
  public static long gcd(long a, long b){if(a > b) {a = (a+b)-(b=a);}if(a == 0L){return b;}return gcd(b%a, a);}
  public static void swap(int[] arr, int i, int j) {arr[i] = arr[i] ^ arr[j]; arr[j] = arr[j] ^ arr[i]; arr[i] = arr[i] ^ arr[j];}
  public static boolean isPrime(long n){if(n < 2){return false;}if(n == 2 || n == 3){return true;}if(n%2 == 0 || n%3 == 0){return false;}long sqrtN = (long)Math.sqrt(n)+1;for(long i = 6L; i <= sqrtN; i += 6) {if(n%(i-1) == 0 || n%(i+1) == 0) return false;}return true;}
  public static long mod_add(long a, long b){ return (a%mod + b%mod)%mod;}
  public static long mod_sub(long a, long b){ return (a%mod - b%mod + mod)%mod;}
  public static long mod_mul(long a, long b){ return (a%mod * b%mod)%mod;}
  public static long modInv(long a, long b){ return expo(a, b-2)%b;}
  public static long mod_div(long a, long b){return mod_mul(a, modInv(b, mod));}
  public static long expo (long a, long n){if(n == 0){return 1;}long recAns = expo(mod_mul(a,a), n/2);if(n % 2 == 0){return recAns;}else{return mod_mul(a, recAns);}}
  public static<T> void debug(T arr[]) throws IOException {for(int i = 0; i < arr.length; i++){out.print(arr[i]+" ");}out.println("");}
  public static<T> void debug(T arr[][]) throws IOException{for(int i = 0; i < arr.length; i++){for(int j = 0; j < arr[0].length; j++){out.print(arr[i][j]+" ");}out.println("");}}
  public static void takeInput(Integer arr[]){for(int i = 0; i < arr.length; i++){arr[i] = s.nextInt();}}
  public static void takeInput(Long arr[]){for(int i = 0; i < arr.length; i++){arr[i] = s.nextLong();}}
  public static void takeInput(Integer arr[][]){for(int i = 0; i < arr.length; i++){for(int j = 0; j < arr[0].length; j++){arr[i][j] = s.nextInt();}}}
  public static void takeInput(Long arr[][]){for(int i = 0; i < arr.length; i++){for(int j = 0; j < arr[0].length; j++){arr[i][j] = s.nextLong();}}}
  public static int[] copyArr(int arr[]){int ans[] = new int[arr.length];for(int i = 0; i < arr.length; i++){ans[i] = arr[i];}return ans;}
  /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
  
      public static boolean check(String str, char ch){
          for(int i = 0; i < str.length(); i++){
              if(ch != str.charAt(i)){
                  return false;
              }
          }
          return true;
      }
  
      public static boolean isValid(String str, char ch, int len, int i){
          for(int p = i; p <= len; p+=i){
              if(str.charAt(p-1) != ch){
  //                System.out.println(i+" isvalid");
                  return false;
              }
          }
          return true;
      }
  
      public static void main(String[] args) throws IOException {
          int test = s.nextInt();
          while (test-- > 0) {
             int n = s.nextInt();
             char ch = s.next().charAt(0);
             String str = s.next();
             if(check(str, ch)){
                 out.println(0);
             }else{
                 boolean one = false;
                 int idx = -1;
                 for(int i = 1; i <= n; i++){
                     if(isValid(str, ch, n, i)){
                         one = true;
                         idx = i;
                         break;
                     }
                 }
                 if(one){
                     out.println(1+"\n"+idx);
                 }else{
                     out.println("2\n"+n+" "+(n-1));
                 }
             }
          }
          out.close();
      }
  
  }