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.BufferedReader;
  import java.io.InputStreamReader;
  import java.util.StringTokenizer;
  import java.util.*;
  import java.io.*;
  public class Main {
      // Graph
      // prefix sums
      //inputs
      public static void main(String args[])throws Exception{
          //Input sc=new Input();
          precalculates p=new precalculates();
          StringBuilder sb=new StringBuilder();
          Scanner sc=new Scanner(System.in);
          int t=sc.nextInt();
          for(int f=0;f<t;f++){
              int n=sc.nextInt();
              String c=sc.next();
              char ch=c.charAt(0);
              String str=sc.next();
              //System.out.println(n+" "+c+" "+str);
              int count=0;
              int cc=0;
              for(int i=0;i<n-1;i++){
                  if(str.charAt(i)!=ch){
                      count++;
                  }
                  if(str.charAt(n-1)!=ch){
                      cc++;
                  }
              }
              if(cc==0 && count==0){
                  sb.append("0\n");
              }else if(count!=0 && cc==0){
                  sb.append("1\n"+(n)+"\n");
              }else {
                  int kk=-1;
                  for(int i=n-1;i>=0;i--){
                      if(n<(2*(i+1)) && str.charAt(i)==ch){
                          sb.append("1\n"+(i+1)+"\n");
                          kk=1;
                          break;
                      }
                  }
                  if(kk==1)
                      continue;
                  else
                  sb.append("2\n"+ (n-1)+" "+(n)+"\n");
              }
  
          }
          System.out.print(sb);
      }
      public static boolean isPrime(int n){
          int val=(int)Math.sqrt(n);
          for(int i=2;i<=val;i++){
              if(n%i==0)
                  return true;
          }
          return false;
      }
  }
  class Input{
      BufferedReader br;
      StringTokenizer st;
      Input(){
          br=new BufferedReader(new InputStreamReader(System.in));
          st=new StringTokenizer("");
      }
      public int[] readArray() throws Exception{
          st=new StringTokenizer(br.readLine());
          int a[]=new int[st.countTokens()];
          for(int i=0;i<a.length;i++){
              a[i]=Integer.parseInt(st.nextToken());
          }
          return a;
      }
      public long[] readArrayLong() throws Exception{
          st=new StringTokenizer(br.readLine());
          long a[]=new long[st.countTokens()];
          for(int i=0;i<a.length;i++){
              a[i]=Long.parseLong(st.nextToken());
          }
          return a;
      }
      public int readInt() throws Exception{
          st=new StringTokenizer(br.readLine());
          return Integer.parseInt(st.nextToken());
      }
      public long readLong() throws Exception{
          st=new StringTokenizer(br.readLine());
          return Long.parseLong(st.nextToken());
      }
      public String readString() throws Exception{
          return br.readLine();
      }
      public int[][] read2dArray(int n,int m)throws Exception{
          int a[][]=new int[n][m];
          for(int i=0;i<n;i++){
              st=new StringTokenizer(br.readLine());
              for(int j=0;j<m;j++){
                  a[i][j]=Integer.parseInt(st.nextToken());
              }
          }
          return a;
      }
  }
  class precalculates{
      public int[] prefixSumOneDimentional(int a[]){
          int n=a.length;
          int dp[]=new int[n];
          for(int i=0;i<n;i++){
              if(i==0)
                  dp[i]=a[i];
              else
                  dp[i]=dp[i-1]+a[i];
          }
          return dp;
      }
      public int[] postSumOneDimentional(int a[]) {
          int n = a.length;
          int dp[] = new int[n];
          for (int i = n - 1; i >= 0; i--) {
              if (i == n - 1)
                  dp[i] = a[i];
              else
                  dp[i] = dp[i + 1] + a[i];
          }
          return dp;
      }
      public int[][] prefixSum2d(int a[][]){
          int n=a.length;int m=a[0].length;
          int dp[][]=new int[n+1][m+1];
          for(int i=1;i<=n;i++){
              for(int j=1;j<=m;j++){
                  dp[i][j]=a[i-1][j-1]+dp[i-1][j]+dp[i][j-1]-dp[i-1][j-1];
              }
          }
          return dp;
      }
      public long pow(long a,long b){
          long mod=1000000007;
          long ans=0;
          if(b<=0)
              return 1;
          if(b%2==0){
              ans=pow(a,b/2)%mod;
              return ((ans%mod)*(ans%mod))%mod;
          }else{
              return ((a%mod)*(ans%mod))%mod;
          }
      }
  
  }
  class GraphInteger{
      HashMap<Integer,vertex> vtces;
      class vertex{
          HashMap<Integer,Integer> children;
          public vertex(){
              children=new HashMap<>();
          }
      }
      public GraphInteger(){
          vtces=new HashMap<>();
      }
      public void addVertex(int a){
          vtces.put(a,new vertex());
      }
      public void addEdge(int a,int b,int cost){
          if(!vtces.containsKey(a)){
              vtces.put(a,new vertex());
          }
          if(!vtces.containsKey(b)){
              vtces.put(b,new vertex());
          }
          vtces.get(a).children.put(b,cost);
  //        vtces.get(b).children.put(a,cost);
      }
      public boolean isCyclicDirected(){
          boolean isdone[]=new boolean[vtces.size()+1];
          boolean check[]=new boolean[vtces.size()+1];
          for(int i=1;i<=vtces.size();i++) {
              if (!isdone[i] && isCyclicDirected(i,isdone, check)) {
                  return true;
              }
          }
          return false;
      }
      private boolean isCyclicDirected(int i,boolean isdone[],boolean check[]){
          if(check[i])
              return true;
          if(isdone[i])
              return false;
          check[i]=true;
          isdone[i]=true;
          Set<Integer> set=vtces.get(i).children.keySet();
          for(Integer ii:set){
              if(isCyclicDirected(ii,isdone,check))
                  return true;
          }
          check[i]=false;
          return false;
      }
  }
  
  
  
  
  