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 sys,math,bisect
  # sys.setrecursionlimit(10**6)
  from random import randint
  inf = float('inf')
  mod = 10**9+7
  "========================================"
  def nCr(n, r):
      return (fact(n) / (fact(r)
                  * fact(n - r)))
  def fact(n):
      res = 1
      for i in range(2, n+1):
          res = res * i
      return res
  def lcm(a,b):
      return int((a/math.gcd(a,b))*b)
  def gcd(a,b):
      return int(math.gcd(a,b))
  def tobinary(n):
      return bin(n)[2:]
  def binarySearch(a,x):
      i = bisect.bisect_left(a,x)
      if i!=len(a) and a[i]==x:
          return i
      else:
          return -1
  def lowerBound(a, x):
      i = bisect.bisect_left(a, x)
      if i:
          return (i-1)
      else:
          return -1
  def upperBound(a,x):
      i = bisect.bisect_right(a,x)
      if i!= len(a)+1 and a[i-1]==x:
          return (i-1)
      else:
          return -1
  def primesInRange(n):
      ans = []
      prime = [True for i in range(n+1)]
      p = 2
      while (p * p <= n):
          if (prime[p] == True):
              for i in range(p * p, n+1, p):
                  prime[i] = False
          p += 1
      for p in range(2, n+1):
          if prime[p]:
              ans.append(p)
      return ans
  def primeFactors(n):
      factors = []
      while n % 2 == 0:
          factors.append(2)
          n = n // 2
      for i in range(3,int(math.sqrt(n))+1,2):
          while n % i== 0:
              factors.append(i)
              n = n // i
      if n > 2:
          factors.append(n)
      return factors
  def isPrime(n,k=5):
      if (n <2):
          return True
      for i in range(0,k):
          a = randint(1,n-1)
          if(pow(a,n-1,n)!=1):
              return False
      return True
  def find_closest(arr,target):
          min_diff = 1e19
          low = 0
          high = len(arr)-1
          closest_num = None
  
          # if length of list is zero
          if len(arr)==0:
              return None
          # if length of list is one
          if len(arr)==1:
              return arr[0]
  
          while low <= high:
              mid = (low+high)//2
              min_diff_left = 1e19
              min_diff_right = 1e19
              # right of the midPoint
              if mid +1 < len(arr):
                  min_diff_right = abs(arr[mid+1]-target)
  
  
              # left of the midPoint
              if mid -1 >= 0:
                  min_diff_left = abs(arr[mid-1]-target)
  
              if min_diff_left < min_diff:
                  min_diff = min_diff_left
                  closest_num = arr[mid-1]
  
              if min_diff_right < min_diff:
                  min_diff = min_diff_right
                  closest_num = arr[mid+1]
              if arr[mid]<target:
                  low = mid+1
              elif arr[mid]>target:
                  high = mid-1
              else:
                  return arr[mid]
          return closest_num
  "========================================="
  """
  n = int(input())
  n,k = map(int,input().split())
  arr = list(map(int,input().split()))
  """
  from collections import deque,defaultdict,Counter
  from heapq import heappush, heappop,heapify
  import string
  
  
  for _ in range(int(input())):
      n,c = input().split()
      n = int(n)
      s = input()
      last_ind = -1
      for i in range(n-1,-1,-1):
          if s[i]==c:
              last_ind = (i+1)
              break
      if set(s)==set(c):
          print(0)
          continue
      if last_ind > n//2:
          print(1)
          print(last_ind)
          continue
      else:
          print(2)
          print(n-1,n)
  