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 currentContest;
  
  import java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.util.ArrayDeque;
  import java.util.ArrayList;
  import java.util.Arrays;
  import java.util.HashSet;
  import java.util.Random;
  import java.util.StringTokenizer;
  
  public class P3 {
  	static final int MAXN = 300001;
      
      // stores smallest prime factor for every number
      static int spf[] = new int[MAXN];
        
      // Calculating SPF (Smallest Prime Factor) for every
      // number till MAXN.
      // Time Complexity : O(nloglogn)
      static void sieve()
      {
          spf[1] = 1;
          for (int i=2; i<MAXN; i++)
        
              // marking smallest prime factor for every
              // number to be itself.
              spf[i] = i;
        
          // separately marking spf for every even
          // number as 2
          for (int i=4; i<MAXN; i+=2)
              spf[i] = 2;
        
          for (int i=3; i*i<MAXN; i++)
          {
              // checking if i is prime
              if (spf[i] == i)
              {
                  // marking SPF for all numbers divisible by i
                  for (int j=i*i; j<MAXN; j+=i)
        
                      // marking spf[j] if it is not
                      // previously marked
                      if (spf[j]==j)
                          spf[j] = i;
              }
          }
      }
        
      // A O(log n) function returning primefactorization
      // by dividing by smallest prime factor at every step
      static ArrayList<Integer> getFactorization(int x)
      {
      	ArrayList<Integer> ret = new ArrayList<>();
          while (x != 1)
          {
          	//System.out.println(x+" "+spf[x]);
              ret.add(spf[x]);
              x = x / spf[x];
          }
          return ret;
      }
  	public static void main(String[] args) {
  		// TODO Auto-generated method stub
  		FastReader sc = new FastReader();
  		sieve();
  		int t=sc.nextInt();
  		StringBuilder st = new StringBuilder();
  		while (t-- != 0) {
  			String s=sc.nextLine();
  			int n=Integer.parseInt(s.substring(0,s.length()-2));
  			char ch=s.charAt(s.length()-1);
  			String str=sc.nextLine();
  			int flag=0;
  			for(int i=0;i<str.length();i++) {
  				if(str.charAt(i)!=ch) {
  					flag=1;
  					break;
  				}
  			}
  			if(flag==0) {
  				st.append("0\n");
  			}else {
  				flag=0;
  				int c=1;
  				for(int i=1;i<=str.length();i++) {
  					flag=0;
  					c=1;
  					while(i*c<=str.length()) {
  						if(str.charAt(i*c-1)!=ch) {
  							flag=-1;
  						}
  						c++;
  					}
  					if(flag!=-1) {
  						flag=i;
  						break;
  					}
  				}
  				if(flag>0) {
  					st.append("1\n");
  					st.append(flag+"\n");
  				}else {
  					st.append("2\n");
  					st.append(str.length()-1+" "+str.length()+"\n");
  				}
  			}
  		}
  		System.out.println(st);
  	}
  
  	static FastReader sc = new FastReader();
  
  	public static void solvegraph() {
  		int n = sc.nextInt();
  
  		int edge[][] = new int[n - 1][2];
  		for (int i = 0; i < n - 1; i++) {
  			edge[i][0] = sc.nextInt() - 1;
  			edge[i][1] = sc.nextInt() - 1;
  		}
  		ArrayList<ArrayList<Integer>> ad = new ArrayList<>();
  		for (int i = 0; i < n; i++) {
  			ad.add(new ArrayList<Integer>());
  		}
  		for (int i = 0; i < n - 1; i++) {
  			ad.get(edge[i][0]).add(edge[i][1]);
  			ad.get(edge[i][1]).add(edge[i][0]);
  		}
  		int parent[] = new int[n];
  		Arrays.fill(parent, -1);
  		parent[0] = n;
  		ArrayDeque<Integer> queue = new ArrayDeque<>();
  		queue.add(0);
  		int child[] = new int[n];
  		Arrays.fill(child, 0);
  		ArrayList<Integer> lv = new ArrayList<Integer>();
  		while (!queue.isEmpty()) {
  			int toget = queue.getFirst();
  			queue.removeFirst();
  			child[toget] = ad.get(toget).size() - 1;
  			for (int i = 0; i < ad.get(toget).size(); i++) {
  				if (parent[ad.get(toget).get(i)] == -1) {
  					parent[ad.get(toget).get(i)] = toget;
  					queue.addLast(ad.get(toget).get(i));
  				}
  			}
  			lv.add(toget);
  		}
  
  		child[0]++;
  	}
  
  	static void sort(int[] A) {
  		int n = A.length;
  		Random rnd = new Random();
  		for (int i = 0; i < n; ++i) {
  			int tmp = A[i];
  			int randomPos = i + rnd.nextInt(n - i);
  			A[i] = A[randomPos];
  			A[randomPos] = tmp;
  		}
  		Arrays.sort(A);
  	}
  
  	static void sort(long[] A) {
  		int n = A.length;
  		Random rnd = new Random();
  		for (int i = 0; i < n; ++i) {
  			long tmp = A[i];
  			int randomPos = i + rnd.nextInt(n - i);
  			A[i] = A[randomPos];
  			A[randomPos] = tmp;
  		}
  		Arrays.sort(A);
  	}
  
  	static String sort(String s) {
  		Character ch[] = new Character[s.length()];
  		for (int i = 0; i < s.length(); i++) {
  			ch[i] = s.charAt(i);
  		}
  		Arrays.sort(ch);
  		StringBuffer st = new StringBuffer("");
  		for (int i = 0; i < s.length(); i++) {
  			st.append(ch[i]);
  		}
  		return st.toString();
  	}
  
  	public static long gcd(long a, long b) {
  		if (a == 0) {
  			return b;
  		}
  		return gcd(b % a, a);
  	}
  
  	static class FastReader {
  		BufferedReader br;
  		StringTokenizer st;
  
  		public FastReader() {
  			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;
  		}
  	}
  }
  