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 time
  import os,sys
  from datetime import datetime
  from math import floor,sqrt,gcd,factorial,ceil,log2
  from collections import Counter,defaultdict
  import bisect
  from itertools import chain
  from collections import deque
  from sys import maxsize as INT_MAX
  from itertools import permutations
  from collections import deque
  #import threading
  '''Dont use setrecursionlimit in pypy'''
  #sys.setrecursionlimit(int(1e9)+500)
  #threading.stack_size(0x2000000)
  ONLINE_JUDGE,INF,mod=False,float('inf'),int(1e9)+7
  if os.path.exists('D:\\vimstuff'):
  	ONLINE_JUDGE=True
  	sys.stdin=open('D:\\vimstuff\\inp.txt','r')
  	sys.stdout=open('D:\\vimstuff\\out.txt','w')
  '''def ceil(a,b):
  	return(int((a+b-1)/b))'''
  
  def readint():
  	return int(sys.stdin.readline())
  def readstr():
  	return sys.stdin.readline()
  def readlst():
  	return list(map(int, sys.stdin.readline().strip().split()))
  def readmul():
  	return map(int, sys.stdin.readline().strip().split())
  def mulfloat():	return map(float, sys.stdin.readline().strip().split())
  def flush():
  	return sys.stdout.flush()
  def power_two(x):
  	return (1<<x)
  def lcm(a,b):
  	return a*b//gcd(a,b)
  
  def countGreater(arr,n, k):
  	l = 0
  	r = n - 1
  	leftGreater = n
  	while (l <= r):
  		m = int(l + (r - l) / 2)
  		if (arr[m] >= k):
  			leftGreater = m
  			r = m - 1
  		else:
  			l = m + 1
  			return (n - leftGreater)
  
  def lower_bound(arr,n,val):
  	l,r=-1,n
  	while r>l+1:
  		m=int((l+r)>>1)
  		if arr[m]<val:
  			l=m
  		else:
  			r=m
  	return r
  
  def upper_bound(arr,n,val):
  	l,r=-1,n
  	while r>l+1:
  		m=int((l+r)>>1)
  		if arr[m]<=val:
  			l=m
  		else:
  			r=m
  	return l
  
  def binpow(a,n,mod):
  	res=1
  	while n:
  		if n&1:
  			res=(res*a)%mod
  			n-=1
  		a=(a*a)%mod
  		n=n>>1
  	return res
  
  def printmat(l,seperate=True):
  	for i in range(0,len(l)):
  		if(seperate):
  			print(*l[i],sep=" ")
  		else:
  			print(*l[i],sep="")
  
  def is_perfect_square(num):
  	#print(num)
  	temp = num**(0.5)
  	#print(temp)
  	return (temp//1)==temp
  
  def find(res):
  	n1=res
  	while par[n1]!=n1:
  		par[n1]=par[par[n1]]
  		n1=par[n1]
  	return n1
  
  def union(u,v):
  	p1,p2=find(u),find(v)
  	if p1==p2:
  		return 0
  	if(rank[p1]>rank[p2]):
  		p1,p2=p2,p1
  	par[p1]=p2
  	rank[p2]+=rank[p1]
  	return 1
  
  
  '''
  c-space = to copy
  o-space= to open file
  ,-space=to run prog
  :noh= to get rid of text highlight
  
  1. Implement after understanding properly don't do in vain.
  2. Check corner cases.
  3. Use python if there is recursion,try-catch,dictionary.
  4. Use pypy if heavy loop,list slice.
  '''
  def john_3_16(cnt):
      n,x=input().split()
      n=int(n)
      s='z'+input()
      yes=False
      pos=[]
      for i in range(1,n+1):
          if s[i]!=x:
              yes=True
      if not yes:
          print(0)
      else:
          for i in range(1,n+1):
              if s[i]==x and i>n//2:
                  print(1)
                  print(i)
                  return
          print(2)
          print(n-1,n)
      return
  	
  def main():
  	tc=readint()
  	#tc=1
  	#cnt=0
  	start=time.time()
  	cnt=1
  	while tc:
              john_3_16(cnt)
              tc-=1
              cnt+=1
  	if ONLINE_JUDGE:
  		print(f'{(time.time()-start)*1000}ms')
  		pass
  main()
  
  