Theofanis has a string $s_1 s_2 \dots 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 \le x \le 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 \le t \le 10^4$) — the number of test cases.

The first line of each test case contains the integer $n$ ($3 \le n \le 3 \cdot 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 \cdot 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, \dots, x_m$ ($1 \le x_j \le 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.


-----Examples-----

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:

$x_1 = 2$: we choose all positions that are not divisible by $2$ and replace them, i. e. bzyx $\rightarrow$ bzbx;

$x_2 = 3$: we choose all positions that are not divisible by $3$ and replace them, i. e. bzbx $\rightarrow$ bbbb.

Source: codeforces | Difficulty: EASY
Tags: String algorithms

Complete search

Mathematics

Greedy algorithms


Solutions:
def g(a, b):
	if b == 0:
		return a
	return g(b, a % b)
for _ in range(int(input())):
	(n, c) = input().split()
	n = int(n)
	s = input()
	am = True
	i = n
	while i >= 1:
		if s[i - 1] == c:
			break
		i -= 1
	if s == c * n:
		print(0)
	elif i == 0:
		print(2)
		print(n, n - 1)
	elif 2 * i > n:
		print(1)
		print(i)
	else:
		print(2)
		print(n, n - 1)


import sys
import bisect
from bisect import bisect_left as lb
from bisect import bisect_right as rb
input_ = lambda : sys.stdin.readline().strip('\r\n')
from math import log
from math import gcd
from math import atan2, acos
from random import randint
sa = lambda : input_()
sb = lambda : int(input_())
sc = lambda : input_().split()
sd = lambda : list(map(int, input_().split()))
sflo = lambda : list(map(float, input_().split()))
se = lambda : float(input_())
sf = lambda : list(input_())
flsh = lambda : sys.stdout.flush()
mod = 10 ** 9 + 7
mod1 = 998244353
gp = []
cost = []
dp = []
mx = []
ans1 = []
ans2 = []
special = []
specnode = []
a = 0
kthpar = []

def dfs2(root, par):
	if par != -1:
		dp[root] = dp[par] + 1
	for i in range(1, 20):
		if kthpar[root][i - 1] != -1:
			kthpar[root][i] = kthpar[kthpar[root][i - 1]][i - 1]
	for child in gp[root]:
		if child == par:
			continue
		kthpar[child][0] = root
		dfs(child, root)
ans = 0
a = []
(n, k) = (0, 0)
b = []
vis = []
tot = 0
time = []
time1 = []
adj = []
mx = -1
eps = 1e-07
x = 0
pref = []
lvl = []

def update_it(bit, i, val):
	n = len(bit)
	while i < n:
		bit[i] += val
		i += i & -i

def get_ans(bit, i):
	n = len(bit)
	tot = 0
	while i > 0:
		tot += bit[i]
		i -= i & -i
	return tot

def hnbhai(tc):
	(n, a) = input().split()
	s = sa()
	n = int(n)
	if s.count(a) == n:
		print(0)
		return
	odd = 0
	x = s.count(a)
	x = n - x
	for i in range(0, n, 2):
		if s[i] != a:
			odd += 1
	if x == odd:
		print(1)
		print(2)
		return
	for i in range(1, n + 1):
		t = 1
		ind = i
		for j in range(i, n + 1, i):
			if s[j - 1] != a:
				t = 0
				break
		if t == 0:
			continue
		print(1)
		print(ind)
		return
	print(2)
	print(n, n - 1)
for _ in range(sb()):
	hnbhai(_ + 1)


t = int(input())
for _ in range(t):
	(n, c) = input().split()
	n = int(n)
	s = input()
	if s.count(c) == n:
		print(0)
	else:
		flag = 1
		for i in range(n // 2, n):
			if s[i] == c:
				print(1)
				print(i + 1)
				flag = 0
				break
		if flag:
			print(2)
			print(n - 1, n)


t = int(input())
for _ in range(t):
	(n, c) = input().split()
	n = int(n)
	s = input()
	idd = -1
	ctt = 0
	for i in range(n):
		if s[i] == c:
			idd = i + 1
			ctt += 1
	if idd == -1:
		print(2)
		print(n, n - 1)
	elif ctt == n:
		print(0)
	elif 2 * idd > n:
		print(1)
		print(idd)
	else:
		print(2)
		print(n, n - 1)


t = int(input())
for _ in range(t):
	nc = input()
	s = input()
	n = int(nc[0:-2])
	c = nc[-1]
	if c * n == s:
		print(0)
	elif c in s and s.rfind(c) + 1 > n / 2:
		print(1)
		print(s.rfind(c) + 1)
	else:
		print(2)
		print(n, n - 1)


from sys import stdin
from bisect import bisect
for _ in range(int(stdin.readline())):
	inp = list(input().split())
	s = input()
	n = int(inp[0])
	c = inp[1]
	ans = 0
	for i in range(n):
		if s[i] != c:
			ans = 1
			break
	if ans == 0:
		print(ans)
	else:
		ans = None
		for i in range(n):
			if (i + 1) * 2 > n and s[i] == c:
				ans = i + 1
				break
		if ans != None:
			print(1)
			print(ans)
		else:
			print(2)
			print(n - 1, n)


def check(a, k, c):
	i = k
	while i <= n:
		if a[i - 1] != c:
			return False
		i += k
	return True

def solve(a, n, c):
	if a == c * n:
		return 0
	ind = set()
	for i in range(n):
		if a[i] == c:
			ind.add(i + 1)
	for i in ind:
		res = check(a, i, c)
		if res:
			return [i]
	return [n, n - 1]
for _ in range(int(input())):
	(n, c) = map(str, input().split())
	n = int(n)
	a = input()
	res = solve(a, n, c)
	if res == 0:
		print(0)
		continue
	print(len(res))
	print(*res)


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
from bisect import bisect_left as lower_bound, bisect_right as upper_bound

def so():
	return int(input())

def st():
	return input()

def mj():
	return map(int, input().strip().split(' '))

def msj():
	return map(str, input().strip().split(' '))

def le():
	return list(map(int, input().split()))

def lebe():
	return list(map(int, input()))

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()

def joro(L):
	return ''.join(map(str, L))

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def isprime(n):
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			return False
	return True

def npr(n, r):
	return factorial(n) // factorial(n - r) if n >= r else 0

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(n - r)) if n >= r else 0

def lower_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = -1
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			answer = middle
			start = middle + 1
		else:
			end = middle - 1
	return answer

def tir(a, b, c):
	if 0 == c:
		return 1
	if len(a) <= b:
		return 0
	if c != -1:
		return tir(a, 1 + b, c + a[b]) or tir(a, b + 1, c - a[b]) or tir(a, 1 + b, c)
	else:
		return tir(a, 1 + b, a[b]) or tir(a, b + 1, -a[b]) or tir(a, 1 + b, -1)

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val, lb, ub):
	ans = -1
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = mid
			break
	return ans

def kadane(x):
	sum_so_far = 0
	current_sum = 0
	for i in x:
		current_sum += i
		if current_sum < 0:
			current_sum = 0
		else:
			sum_so_far = max(sum_so_far, current_sum)
	return sum_so_far

def pref(li):
	pref_sum = [0]
	for i in li:
		pref_sum.append(pref_sum[-1] + i)
	return pref_sum

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	li = []
	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, len(prime)):
		if prime[p]:
			li.append(p)
	return li

def primefactors(n):
	from math import sqrt
	factors = []
	while n % 2 == 0:
		factors.append(2)
		n //= 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			factors.append(i)
			n //= i
	if n > 2:
		factors.append(n)
	return factors

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def tr(n):
	return n * (n + 1) // 2

def ti(x):
	import math
	if x >= 0:
		s = math.sqrt(x)
	if s * s == x:
		return 1
	return 0
doi = int(1000000000.0 + 7)
boi = 998244353

def ryu(a, b):
	re = 1
	while b != 0:
		if b % 2 != 0:
			re *= a
			re %= boi
		b = b // 2
		a *= a
		a %= boi
	return re
fa = [0] * 100007

def pow(x, y, p):
	re = 1
	x = x % p
	while y > 0:
		if y % 2 != 0:
			re = re * x % p
		y = y // 2
		x = x * x % p
	return re

def mi(n, p):
	return pow(n, p - 2, p)

def ncr(n, r, p):
	if n < r:
		return 0
	if r == 0:
		return 1
	return fa[n] * mi(fa[r], p) % p * mi(fa[n - r], p) % p % p

def main():
	import re
	import sys
	input = sys.stdin.readline
	import math as my
	for i in range(so()):
		(a, b) = msj()
		p = int(a)
		t = st()
		d = 0
		for i in t:
			if i != b:
				d += 1
		if d == 0:
			print(0)
			continue
		v = -1
		for i in range(2, p + 1):
			po = 1
			for j in range(i, p + 1, i):
				if t[j - 1] != b:
					po = 0
					break
			if po == 1:
				v = i
				break
		if v != -1:
			print(1)
			print(v)
		elif t[p - 1] == b:
			print(1)
			print(p)
		elif d == 1:
			print(1)
			print(p - 1)
		else:
			print(2)
			print(p, p - 1)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


for I in range(int(input())):
	a = input().split()
	s = input()
	if s.rfind(a[1]) < (len(s) - 1) / 2:
		print('2')
		print(str(len(s) - 1) + ' ' + str(len(s)))
	elif s == a[1] * int(a[0]):
		print('0')
	else:
		print('1')
		print(str(s.rfind(a[1]) + 1))


from itertools import permutations as per
from math import factorial as fact
from difflib import SequenceMatcher
t = int(input())
for _ in range(t):
	(n, c) = input().split()
	n = int(n)
	s = input()
	if s == c * n:
		print(0)
	else:
		for i in range(n // 2, n):
			if s[i] == c:
				print(1)
				print(i + 1)
				break
		else:
			print(2)
			print(n, n - 1)


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
from collections import Counter
from collections import defaultdict as dd
flush = lambda : stdout.flush()
stdstr = lambda : stdin.readline()
stdint = lambda : int(stdin.readline())
stdpr = lambda x: stdout.write(str(x))
stdmap = lambda : map(int, stdstr().split())
stdarr = lambda : list(map(int, stdstr().split()))
mod = 1000000007

def SieveOfEratosthenes(n):
	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
	return prime
isPrime = SieveOfEratosthenes(3 * 10 ** 5)

def solve(n, c, s):
	for i in range(1, n + 1):
		cnt = 0
		for j in range(i - 1, n, i):
			if s[j] == c:
				cnt += 1
		if cnt == n // i:
			return (1, i)
	res = (-1, -1)
	for j in range(n // 2 + 1, n):
		if isPrime[j]:
			if s[j - 1] == c:
				return (1, j)
			res = (2, j)
	return res
for _ in range(stdint()):
	(n, c) = input().split()
	s = input()
	n = int(n)
	if s.count(c) == n:
		print(0)
		continue
	res = solve(n, c, s)
	m = res[0]
	print(m)
	if m == 1:
		print(res[1])
	else:
		x = res[1]
		if x == 2:
			print(2, 3)
		elif c == 3:
			print(3, 2)
		else:
			print(x, 2)


import traceback
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
sys.stdin = IOWrapper(sys.stdin)
input = lambda : sys.stdin.readline().rstrip('\r\n')

class SortedList:

	def __init__(self, iterable=[], _load=200):
		values = sorted(iterable)
		self._len = _len = len(values)
		self._load = _load
		self._lists = _lists = [values[i:i + _load] for i in range(0, _len, _load)]
		self._list_lens = [len(_list) for _list in _lists]
		self._mins = [_list[0] for _list in _lists]
		self._fen_tree = []
		self._rebuild = True

	def _fen_build(self):
		self._fen_tree[:] = self._list_lens
		_fen_tree = self._fen_tree
		for i in range(len(_fen_tree)):
			if i | i + 1 < len(_fen_tree):
				_fen_tree[i | i + 1] += _fen_tree[i]
		self._rebuild = False

	def _fen_update(self, index, value):
		if not self._rebuild:
			_fen_tree = self._fen_tree
			while index < len(_fen_tree):
				_fen_tree[index] += value
				index |= index + 1

	def _fen_query(self, end):
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		x = 0
		while end:
			x += _fen_tree[end - 1]
			end &= end - 1
		return x

	def _fen_findkth(self, k):
		_list_lens = self._list_lens
		if k < _list_lens[0]:
			return (0, k)
		if k >= self._len - _list_lens[-1]:
			return (len(_list_lens) - 1, k + _list_lens[-1] - self._len)
		if self._rebuild:
			self._fen_build()
		_fen_tree = self._fen_tree
		idx = -1
		for d in reversed(range(len(_fen_tree).bit_length())):
			right_idx = idx + (1 << d)
			if right_idx < len(_fen_tree) and k >= _fen_tree[right_idx]:
				idx = right_idx
				k -= _fen_tree[idx]
		return (idx + 1, k)

	def _delete(self, pos, idx):
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len -= 1
		self._fen_update(pos, -1)
		del _lists[pos][idx]
		_list_lens[pos] -= 1
		if _list_lens[pos]:
			_mins[pos] = _lists[pos][0]
		else:
			del _lists[pos]
			del _list_lens[pos]
			del _mins[pos]
			self._rebuild = True

	def _loc_left(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(lo, pos) = (-1, len(_lists) - 1)
		while lo + 1 < pos:
			mi = lo + pos >> 1
			if value <= _mins[mi]:
				pos = mi
			else:
				lo = mi
		if pos and value <= _lists[pos - 1][-1]:
			pos -= 1
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value <= _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def _loc_right(self, value):
		if not self._len:
			return (0, 0)
		_lists = self._lists
		_mins = self._mins
		(pos, hi) = (0, len(_lists))
		while pos + 1 < hi:
			mi = pos + hi >> 1
			if value < _mins[mi]:
				hi = mi
			else:
				pos = mi
		_list = _lists[pos]
		(lo, idx) = (-1, len(_list))
		while lo + 1 < idx:
			mi = lo + idx >> 1
			if value < _list[mi]:
				idx = mi
			else:
				lo = mi
		return (pos, idx)

	def add(self, value):
		_load = self._load
		_lists = self._lists
		_mins = self._mins
		_list_lens = self._list_lens
		self._len += 1
		if _lists:
			(pos, idx) = self._loc_right(value)
			self._fen_update(pos, 1)
			_list = _lists[pos]
			_list.insert(idx, value)
			_list_lens[pos] += 1
			_mins[pos] = _list[0]
			if _load + _load < len(_list):
				_lists.insert(pos + 1, _list[_load:])
				_list_lens.insert(pos + 1, len(_list) - _load)
				_mins.insert(pos + 1, _list[_load])
				_list_lens[pos] = _load
				del _list[_load:]
				self._rebuild = True
		else:
			_lists.append([value])
			_mins.append(value)
			_list_lens.append(1)
			self._rebuild = True

	def discard(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_right(value)
			if idx and _lists[pos][idx - 1] == value:
				self._delete(pos, idx - 1)

	def remove(self, value):
		_len = self._len
		self.discard(value)
		if _len == self._len:
			raise ValueError('{0!r} not in list'.format(value))

	def pop(self, index=-1):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		value = self._lists[pos][idx]
		self._delete(pos, idx)
		return value

	def bisect_left(self, value):
		(pos, idx) = self._loc_left(value)
		return self._fen_query(pos) + idx

	def bisect_right(self, value):
		(pos, idx) = self._loc_right(value)
		return self._fen_query(pos) + idx

	def count(self, value):
		return self.bisect_right(value) - self.bisect_left(value)

	def __len__(self):
		return self._len

	def __getitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		return self._lists[pos][idx]

	def __delitem__(self, index):
		(pos, idx) = self._fen_findkth(self._len + index if index < 0 else index)
		self._delete(pos, idx)

	def __contains__(self, value):
		_lists = self._lists
		if _lists:
			(pos, idx) = self._loc_left(value)
			return idx < len(_lists[pos]) and _lists[pos][idx] == value
		return False

	def __iter__(self):
		return (value for _list in self._lists for value in _list)

	def __reversed__(self):
		return (value for _list in reversed(self._lists) for value in reversed(_list))

	def __repr__(self):
		return 'SortedList({0})'.format(list(self))
import math
from collections import defaultdict as dfd, defaultdict, Counter, deque
from functools import lru_cache
from itertools import accumulate
from heapq import *
import bisect

def geti():
	return int(input())

def gets():
	return input()

def getil():
	return list(map(int, input().split()))

def getsl():
	return input().split()

def getinps(s):
	inps = s.split()
	m = {'i': geti, 's': gets, 'il': getil, 'sl': getsl}
	if len(inps) == 1:
		return m[s]()
	return [m[k]() for k in inps]

def get2d(nrows, ncols, n=0):
	return [[n] * ncols for r in range(nrows)]

def get_acc(a):
	return list(accumulate(a))

def get_ncr(n, r, mod=10 ** 9 + 7):
	num = den = 1
	r = min(r, n - r)
	for i in range(r):
		num = num * (n - i) % mod
		den = den * (i + 1) % mod
	return num * pow(den, mod - 2, mod) % mod

def get_nc2(n):
	return n * (n - 1) // 2

def get_npr(n, r):
	if n < r:
		return 0
	return math.factorial(n) // math.factorial(r)

def put(a):
	return ' '.join(map(str, a))
ALPHABETS = 'abcdefghijklmnopqrstuvwxyz'
VOWELS = 'aeiou'
CONSONANTS = 'bcdfghjklmnpqrstvwxyz'
inf = float('inf')
mod = 10 ** 9 + 7

class Solution:

	def main(self):
		(N, t) = getsl()
		N = int(N)
		s = gets()
		if s == t * N:
			print(0)
			return
		for i in range(1, N + 1):
			for j in range(i, N + 1, i):
				if s[j - 1] != t:
					break
			else:
				print(1)
				print(i)
				return
		print(2)
		print(N, N - 1)
try:
	Sol = Solution()
	Test = geti()
	for Case in range(Test):
		ans = Sol.main()
except Exception as e:
	print(e)
	traceback.print_exc()


import sys, os, io
input = sys.stdin.readline
PI = 3.141592653589793
INF = float('inf')
MOD = 1000000007

def bin32(num):
	return '{0:032b}'.format(num)

def add(x, y):
	return (x + y) % MOD

def sub(x, y):
	return (x - y + MOD) % MOD

def mul(x, y):
	return x * y % MOD

def gcd(x, y):
	if y == 0:
		return x
	return gcd(y, x % y)

def lcm(x, y):
	return x * y // gcd(x, y)

def power(x, y):
	res = 1
	x %= MOD
	while y != 0:
		if y & 1:
			res = mul(res, x)
		y >>= 1
		x = mul(x, x)
	return res

def mod_inv(n):
	return power(n, MOD - 2)

def prob(p, q):
	return mul(p, power(q, MOD - 2))

def ii():
	return int(input())

def li():
	return [int(i) for i in input().split()]

def ls():
	return [i for i in input().split()]
store = [2 ** i for i in range(32)]
for t in range(ii()):
	t += 1
	(n, c) = ls()
	n = int(n)
	s = input().strip()
	s = list(s)
	last = -1
	for i in range(n - 1, -1, -1):
		if s[i] == c:
			last = i + 1
			break
	if s.count(c) == n:
		print(0)
		continue
	if s[-1] == c:
		print(1)
		print(n)
		continue
	elif last == -1 or 2 * last <= n:
		print(2)
		print(n, n - 1)
	else:
		print(1)
		print(last)


import sys, os, io
input = sys.stdin.readline
for _ in range(int(input())):
	(n, c) = [i for i in input().split()]
	n = int(n)
	a = list(input().strip())
	last = -1
	if a.count(c) == n:
		print(0)
		continue
	for i in range(n - 1, -1, -1):
		if a[i] == c:
			last = i + 1
			break
	if last <= n // 2:
		print(2)
		print(n, n - 1)
	else:
		print(1)
		print(last)


t = int(input())
for _ in range(t):
	(n, c) = map(str, input().split())
	n = int(n)
	s = str(input())
	all_eq = True
	for i in range(n):
		if s[i] != c:
			all_eq = False
			break
	if all_eq:
		print(0)
		continue
	if s[-1] == c:
		print(1)
		print(n)
	else:
		ok = -1
		for i in range(2, n):
			y = 0
			for j in range(i - 1, n, i):
				if s[j] != c:
					break
			else:
				ok = i
		if ok != -1:
			print(1)
			print(ok)
		else:
			print(2)
			g = 0
			for i in range(2, n):
				if n % i != 0:
					g = i
					break
			print(g, n)


import math
import bisect

def binary(arr, x):
	l = 0
	r = len(arr) - 1
	while l <= r:
		mid = l + (r - l) // 2
		if arr[mid] == x:
			return True
		elif arr[mid] < x:
			l = mid + 1
		else:
			r = mid - 1
	return False
for i in range(int(input())):
	n = input().split()
	x = int(n[0])
	c = n[1]
	s = input()
	p = []
	for i in range(len(s)):
		if s[i] != c:
			p.append(i + 1)
	if len(p) == 0:
		print(0)
		continue
	flag = 0
	flag2 = 0
	for i in range(len(p)):
		if p[i] % 2 != 0:
			flag = 1
		if p[i] % 2 == 0:
			flag2 = 1
	if flag == 1 and flag2 == 0:
		print(1)
		print(2)
		continue
	if flag == 0 and flag2 == 1:
		if x > p[-1]:
			print(1)
			print(x)
			continue
		else:
			print(1)
			print(x - 1)
			continue
	if flag == 1 and flag2 == 1:
		if x > p[-1]:
			print(1)
			print(x)
			continue
		flag3 = 0
		for u in range(x // 2 + 1, x + 1):
			if not binary(p, u):
				print(1)
				print(u)
				flag3 = 1
				break
		if flag3 == 0:
			print(2)
			if x % 2 == 0:
				print(2, x - 1)
			else:
				print(2, x)
			continue


t = int(input())
for _ in range(t):
	(n, c) = input().split()
	n = int(n)
	s = input()
	if len(set(s)) == 1 and s[0] == c:
		print(0)
	else:
		p = n - 1
		while p >= n // 2:
			if s[p] == c:
				print(1)
				print(p + 1)
				break
			p -= 1
		else:
			print(2)
			print(n - 1, n)


for u in range(int(input())):
	(n, k) = input().split()
	n = int(n)
	s = input()
	c = 0
	l = len(set(s))
	if l == 1 and s[0] == k:
		print(0)
	elif s[-1] == k:
		print(1)
		print(n)
	else:
		f = 0
		for i in range(n - 1, n // 2 - 1, -1):
			if s[i] == k:
				f = i + 1
				break
		if f == 0:
			print(2)
			print(n - 1, n)
		else:
			print(1)
			print(f)


import sys

def debug(*a):
	print(a, file=sys.stderr, flush=True)

def read(typ=str):
	return typ(input())

def read_arr(typ):
	return list(map(typ, input().split()))

def solve():
	(n, c) = input().split()
	n = int(n)
	s = read(str)
	s = '$' + s
	ok = 1
	for i in s[1:]:
		if i != c[0]:
			ok = 0
			break
	if ok == 1:
		print(0)
		return
	for i in range(1, n + 1):
		if s[i] == c[0]:
			x = 1
			j = i
			while j * x <= n and s[j * x] == c[0]:
				x += 1
			if j * x > n:
				print(1)
				print(i)
				return
	print(2)
	print(n - 1, n)
t = int(input())
for i in range(1, t + 1):
	solve()


def solve_case():
	(n, c) = input().split()
	s = input()
	n = int(n)
	count_c = 0
	for si in s:
		if si == c:
			count_c += 1
	if count_c == n:
		print(0)
		return
	if s[len(s) - 1] == c:
		print(1)
		print(n)
		return
	elif count_c == n - 1:
		print(1)
		print(n - 1)
		return
	for i in range(2, n + 1):
		if s[i - 1] == c and 2 * i > n:
			print(1)
			print(i)
			return
	print(2)
	print(f'{n} {n - 1}')
T = int(input())
for t in range(T):
	solve_case()


try:
	import sys
	from functools import lru_cache, cmp_to_key
	from heapq import merge, heapify, heappop, heappush
	from collections import defaultdict as dd, deque, Counter as C
	from itertools import combinations as comb, permutations as perm
	from bisect import bisect_left as bl, bisect_right as br, bisect, insort
	from time import perf_counter
	from fractions import Fraction
	import copy
	from copy import deepcopy
	import time
	starttime = time.time()
	mod = int(pow(10, 9) + 7)
	mod2 = 998244353

	def data():
		return sys.stdin.readline().strip()

	def out(*var, end='\n'):
		sys.stdout.write(' '.join(map(str, var)) + end)

	def L():
		return list(sp())

	def sl():
		return list(ssp())

	def sp():
		return map(int, data().split())

	def ssp():
		return map(str, data().split())

	def l1d(n, val=0):
		return [val for i in range(n)]

	def l2d(n, m, val=0):
		return [l1d(n, val) for j in range(m)]

	def A2(n, m):
		return [[0] * m for i in range(n)]

	def A(n):
		return [0] * n
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
except:
	pass
for _ in range(L()[0]):
	X = input().split()
	n = int(X[0])
	c = X[1]
	s = input()
	i = n - 1
	if c not in s:
		print(2)
		print(n - 1, n)
	elif s.count(c) == n:
		print(0)
	else:
		while s[i] != c:
			i -= 1
		i += 1
		if i * 2 <= n:
			print(2)
			print(n - 1, n)
		else:
			print(1)
			print(i)


t = int(input())
for _ in range(t):
	(n, c) = input().split()
	n = int(n)
	s = input().strip()
	if all((s[i] == c for i in range(n))):
		print(0)
	elif c in s:
		lastc = n - s[::-1].index(c)
		if lastc <= n / 2:
			print(2)
			print(n - 1, n)
		else:
			print(1)
			print(lastc)
	else:
		print(2)
		print(n - 1, n)


inf = float('inf')
import sys
import pprint
import logging
from logging import getLogger
import array

def input():
	return sys.stdin.readline().rstrip('\r\n')

def maps():
	return [int(i) for i in input().split()]
logging.basicConfig(format='%(message)s', level=logging.WARNING)
logger = getLogger(__name__)
logger.setLevel(logging.INFO)

def debug(msg, *args):
	logger.info(f'{msg}={pprint.pformat(args)}')

def divs(n):
	se = set()
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			se.add(i)
			se.add(n // i)
	return se
for _ in range(*maps()):
	ss = input().split()
	(n, c) = (int(ss[0]), ss[1])
	s = input()
	if s == c * n:
		print(0)
		continue
	badpos = []
	for i in range(n):
		if s[i] != c:
			badpos.append(i)
	ok = True
	for i in badpos:
		if i % 2:
			ok = False
	if ok:
		print(1)
		print(2)
		continue
	if s[n - 2] == c:
		print(1)
		print(n - 1)
		continue
	if badpos[-1] == n - 1:
		check = [True] * n
		for i in badpos:
			for j in divs(i + 1):
				check[j - 1] = False
		ok = False
		for i in range(n):
			if check[i]:
				print(1)
				print(i + 1)
				ok = True
				break
		if not ok:
			if n % 2 == 0:
				print(2)
				print(2, n - 1)
			else:
				print(2)
				print(2, n)
	else:
		print(1)
		print(badpos[-1] + 2)


import math
for _ in range(int(input())):
	(n, c) = map(str, input().split())
	n = int(n)
	s = input()
	at = []
	for i in range(n):
		if s[i] == c:
			at.append(i + 1)
	if len(at) == 0:
		print(2)
		print(n, n - 1)
	elif len(at) == n:
		print(0)
	elif at[-1] == n:
		print(1)
		print(n)
	elif at[-1] == n - 1:
		print(1)
		print(n - 1)
	else:
		done = False
		for i in range(2, n + 1):
			yes = True
			for j in range(i, n + 1, i):
				if s[j - 1] != c:
					yes = False
					break
			if yes:
				done = True
				print(1)
				print(i)
				break
		if not done:
			print(2)
			print(n, n - 1)


def I():
	return input().strip()

def II():
	return int(input().strip())

def LI():
	return [*map(int, input().strip().split())]
import sys, os, copy, string, math, time, functools, fractions
from io import BytesIO, IOBase
from heapq import heappush, heappop, heapify
from bisect import bisect_left, bisect_right
from collections import deque, defaultdict, Counter, OrderedDict
from itertools import permutations, chain, combinations, groupby
from operator import itemgetter
from types import GeneratorType
from typing import Iterable, TypeVar, Union
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def bootstrap(f, stack=[]):

	def wrappedfunc(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		else:
			to = f(*args, **kwargs)
			while True:
				if type(to) is GeneratorType:
					stack.append(to)
					to = next(to)
				else:
					stack.pop()
					if not stack:
						break
					to = stack[-1].send(to)
			return to
	return wrappedfunc

def main():
	(n, c) = I().split()
	n = int(n)
	s = I()
	if s.count(c) == n:
		print(0)
		return
	if s[-1] == c:
		print(1)
		print(n)
		return
	if s[:-1].count(c) == n - 1:
		print(1)
		print(n - 1)
		return
	defect = set()
	for i in range(n):
		if s[i] != c:
			defect.add(i + 1)
	for i in range(1, n + 1):
		if i not in defect:
			flag = True
			for j in range(i, n + 1, i):
				if j in defect:
					flag = False
			if flag:
				print(1)
				print(i)
				return
	print(2)
	print(n, n - 1)
for _ in range(II()):
	main()


import math
for _ in range(int(input())):
	(n, c) = input().split()
	n = int(n)
	s = input()
	if c * n == s:
		print(0)
	elif s[-1] == c:
		print(1)
		print(n)
	else:
		g = 0
		for i in range(n // 2, n):
			if s[i] == c:
				g = i + 1
				break
		if g > 0:
			print(1)
			print(g)
		else:
			print(2)
			print(n, n - 1)


for _ in range(int(input())):
	(n, c) = input().split()
	n = int(n)
	arr = input()
	if arr == c * n:
		print(0)
		continue
	val = -1
	for x in range(n - 1, -1, -1):
		if arr[x] == c:
			val = x + 1
			break
	if val > n // 2:
		print(1)
		print(val)
	else:
		print(2)
		print(n - 1, n)


def make_divisors(n):
	(lower_divisors, upper_divisors) = ([], [])
	i = 1
	while i * i <= n:
		if n % i == 0:
			lower_divisors.append(i)
			if i != n // i:
				upper_divisors.append(n // i)
		i += 1
	return lower_divisors + upper_divisors[::-1]

def answer():
	(n, c) = input().split()
	n = int(n)
	s = list(input())
	from collections import Counter
	C = Counter(s)
	if C[c] == n:
		print(0)
		return
	if C[c] == n - 1:
		print(1)
		for i in range(n):
			if s[i] != c:
				if i == 0:
					print(2)
				elif i == 1:
					print(3)
				else:
					print(i)
				return
	for i in range(n // 2, n + 1):
		if i * 2 <= n:
			continue
		if s[i - 1] == c:
			print(1)
			print(i)
			return
	print(2)
	print(n - 1, n)
	return
t = int(input())
for _ in range(t):
	answer()


cases = int(input())
for _ in range(cases):
	(n, char) = input().split()
	num = int(n)
	s = input()
	if s == num * char:
		print(0)
	elif s[-1] == char:
		print(1)
		print(num)
	else:
		md = num // 2
		s = s[md:]
		if char in s:
			print(1)
			print(md + s.index(char) + 1)
		else:
			print(2)
			print(num - 1, num)


import io, os

def main(t):
	(n, target) = input().split()
	s = input()
	n = int(n)
	ans = n
	num = 2
	if s == target * n:
		print(0)
		return
	for i in range(2, n + 1):
		flag = True
		for j in range(i, n + 1, i):
			if s[j - 1] != target:
				flag = False
				break
		if flag:
			ans = j
			num = 1
			break
	if num == 1:
		print(1)
		print(ans)
	else:
		print(2)
		print(ans, ans - 1)
T = int(input())
t = 1
while t <= T:
	main(t)
	t += 1


def make_them_equal(s, n, c):
	if s[-1] == c:
		for ch in s:
			if ch != c:
				print(1)
				print(n)
				return
		print(0)
		return
	for i in range(1, n):
		if n - 2 * i <= 0:
			break
		if s[n - 1 - i] == c:
			print(1)
			print(n - i)
			return
	print(2)
	print(f'{n} {n - 1}')
	return
t = int(input())
for _ in range(t):
	(n, c) = input().split()
	n = int(n)
	s = input()
	make_them_equal(s, n, c)


try:
	t = int(input())
	for i in range(t):
		(n, c) = input().split()
		n = int(n)
		s = input()
		totChange = 0
		firstSame = -1
		for j in range(n):
			if s[j] != c:
				totChange += 1
		for j in range(n - 1, -1, -1):
			if s[j] == c:
				firstSame = j
				break
		if totChange == 0:
			print(0)
		elif firstSame == n - 1:
			print(1)
			print(n)
		elif firstSame >= n // 2:
			print(1)
			print(firstSame + 1)
		else:
			print(2)
			print(n, n - 1)
except:
	pass


from collections import Counter, deque
from re import L
from sys import stdin, stdout
import math
from collections import defaultdict
from typing import AnyStr, DefaultDict
for _ in range(int(stdin.readline())):
	(n, k) = input().split(' ')
	s = list(input())
	odd = []
	even = []
	n = int(n)
	for i in range(int(n)):
		if s[i] != k:
			if (i + 1) % 2 == 0:
				even.append(i + 1)
			else:
				odd.append(i + 1)
	if len(even) == 0 and len(odd) == 0:
		print(0)
	elif len(even) == 0 and len(odd) != 0:
		print(1)
		if n % 2 == 0:
			print(n)
		else:
			print(n - 1)
	elif len(even) != 0 and len(odd) == 0:
		print(1)
		if n % 2 == 0:
			print(n - 1)
		else:
			print(n)
	elif s[-1] == k:
		print(1)
		print(n)
	else:
		ind = -1
		for i in range(n - 2, -1, -1):
			if s[i] == k:
				ind = i
				break
		if ind == -1:
			print(2)
			print(n, n - 1)
		else:
			cc = False
			for j in range(ind + 2, n + 1):
				if j % (ind + 1) == 0:
					cc = True
					break
			if cc == False:
				print(1)
				print(ind + 1)
			else:
				print(2)
				print(n, n - 1)


for _ in range(int(input())):
	(n, c) = input().split()
	n = int(n)
	s = input()
	if s.count(c) == n:
		print(0)
	else:
		flag = 0
		for ind in range(n - 1, -1, -1):
			if s[ind] == c:
				if ind + 1 >= n // 2 + 1:
					print(1)
					print(ind + 1)
					flag = 1
					break
		if not flag:
			print(2)
			print(n - 1, n)


for _ in range(int(input())):
	(n, k) = input().split()
	n = int(n)
	s = input()
	g = s.count(k)
	if g == n:
		print(0)
		continue
	ind = s.rfind(k) + 1
	if ind * 2 > n:
		print(1)
		print(ind)
		continue
	if s[-1] == k:
		print(1)
		print(n)
		continue
	if g == n - 1:
		print(1)
		print(n - 1)
		continue
	print(2)
	print(n - 1, n)


from sys import stdin
input = stdin.readline

def func():
	if s.count(c) == n:
		print(0)
		return
	i = 1
	while i < n:
		if s[i] == c:
			curr_ans = True
			for j in range(i, n, i):
				if s[j] != c:
					curr_ans = False
					break
			if curr_ans:
				print(1)
				print(i)
				return
		i += 1
	print(2)
	print(n - 2, n - 1)
for _ in range(int(input())):
	(n, c) = input().split()
	s = c + input()
	n = int(n) + 1
	func()


t = int(input())
for i in range(t):
	z = str(input())
	q = z.split()
	n = int(q[0])
	c = str(q[1])
	s = str(input())
	sum = 0
	for j in range(n):
		if s[j] == c:
			sum = sum + 1
	if sum == n:
		print(0)
	else:
		e = 0
		for j in range(n // 2, n):
			if s[j] == c:
				print(1)
				print(j + 1)
				e = 1
				break
		if e == 0:
			print(2)
			print(n - 1, n)


import decimal
import heapq
import math
import os
import sys
from collections import Counter, deque
from io import BytesIO, IOBase
import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def ints_get():
	return map(int, input().strip().split())

def list_get():
	return list(map(int, sys.stdin.readline().strip().split()))

def chars_get():
	return list(map(str, sys.stdin.readline().strip().split()))

def output(to_be_printed, end='\n'):
	sys.stdout.write(str(to_be_printed) + end)

def ipn():
	return int(input())

def main():
	for _ in range(ipn()):
		(n, c) = [x for x in input().split()]
		n = int(n)
		s = [x for x in input()]
		val = n // 2
		count = 0
		pos = None
		for i in range(n):
			if s[i] != c:
				count += 1
			elif i >= val:
				pos = i
		if count == 0:
			output(0)
		elif pos is None:
			output(2)
			print(n, n - 1)
		else:
			output(1)
			print(pos + 1)
	return
main()


def solve():
	(n, c) = input().split(' ')
	s = input()
	if not any((ch != c for ch in s)):
		print(0)
		return
	for i in range(int(n) // 2, int(n)):
		if s[i] == c:
			print(1)
			print(i + 1)
			return
	print(2)
	print(int(n) - 1, int(n))
for _ in range(int(input())):
	solve()


for _ in range(int(input())):
	(n, c) = input().split()
	n = int(n)
	s = input()
	for i in s:
		if i != c:
			flag = True
			break
	else:
		flag = False
	if flag:
		for i in range(1, n + 1):
			if s[i - 1] == c:
				j = i
				while j <= n:
					if s[j - 1] != c:
						break
					j += i
				else:
					ans = 1
					arr = [i]
					break
		else:
			ans = 2
			arr = [n, n - 1]
		print(ans)
		for i in arr:
			print(i, end=' ')
		print()
	else:
		print(0)


t = int(input())
while t != 0:
	(a, b) = input().split()
	s = input()
	if s == int(a) * b:
		print(0)
	elif s[-1] == b:
		print(1)
		print(int(a))
	else:
		i = int(a) - 2
		for i in range(int(a) - 1, -1, -1):
			if s[i] == b:
				val = i
				break
		if i > 0:
			f = 0
			val = i
			for i in range(int(a)):
				if (i + 1) % (val + 1) == 0 and s[i] != b:
					f = 1
					break
			if f == 1:
				print(2)
				print(a, int(a) - 1)
			else:
				print(1)
				print(val + 1)
		else:
			print(2)
			print(a, int(a) - 1)
	t -= 1


import math

def divisorGenerator(n):
	large_divisors = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			yield i
			if i * i != n:
				large_divisors.append(int(n / i))
	for divisor in reversed(large_divisors):
		yield int(divisor)
t = int(input())
for tt in range(t):
	qq = input().split()
	n = int(qq[0])
	c = qq[1]
	s = input()
	c_count = 0
	for i in range(len(s)):
		if s[i] == c:
			c_count += 1
	if c_count == n:
		print(0)
	elif s[-1] == c:
		print(1)
		print(n)
	else:
		wrong_pos = set()
		for i in range(len(s)):
			if s[i] != c:
				wrong_pos.add(i + 1)
		cands = set([i for i in range(1, n + 1) if i not in wrong_pos])
		used = [0 for _ in range(n)]
		for el in wrong_pos:
			divs = list(divisorGenerator(el))
			for el in divs:
				used[el - 1] += 1
		ans = -1
		for i in range(len(used)):
			if used[i] == 0 and i + 1 in cands:
				ans = i + 1
				break
		if ans > -1:
			print(1)
			print(ans)
		else:
			print(2)
			print(n - 1, n)


N = int(input())
import sys
for _ in range(N):
	(n, c) = input().split()
	n = int(n)
	S = list(input())
	obj = set()
	if S.count(c) == len(S):
		print(0)
		continue
	for (i, s) in enumerate(S):
		if s == c:
			continue
		obj.add(i + 1)
	flag_2 = False
	for i in range(1, n + 1):
		flag = False
		for j in range(i, n + 1, i):
			if j in obj:
				flag = True
				break
		if flag:
			continue
		print(1)
		print(i)
		flag_2 = True
		break
	if flag_2:
		continue
	print(2)
	print(n, n - 1)


from sys import stdin, stdout
input = stdin.readline
t = int(input())
for _ in range(t):
	(n, c) = input().split()
	n = int(n)
	s = input().strip()
	if s == c * n:
		print(0)
		continue
	if s[-1] == c:
		print(1)
		print(n)
		continue
	if s[0:-1] == c * (n - 1):
		print(1)
		print(n - 1)
		continue
	for i in range(n // 2 + 1, n + 1):
		if s[i - 1] == c:
			print(1)
			print(i)
			break
	else:
		print(2)
		print(n, n - 1)


import math
import heapq
import string
from collections import deque
from bisect import bisect, bisect_left, bisect_right, insort
import sys
input = sys.stdin.readline
S = lambda : input().rstrip()
I = lambda : int(S())
M = lambda : map(int, S().split())
L = lambda : list(M())
H = 1000000000 + 7
for _ in range(I()):
	(n, c) = input().split()
	n = int(n)
	s = S()
	if s == c * n:
		print(0)
	else:
		for i in range(n // 2, n):
			if s[i] == c:
				print(1)
				print(i + 1)
				break
		else:
			print(2)
			print(n, n - 1)


for _ in range(int(input())):
	(n, k) = map(str, input().split())
	n = int(n)
	A = input()
	ok = False
	for i in range(n):
		if A[i] != k:
			ok = True
	if not ok:
		print(0)
	else:
		for x in range(2, n + 1):
			zz = True
			i = x
			while x <= n:
				if A[x - 1] != k:
					zz = False
					break
				x += i
			if zz:
				print(1)
				print(i)
				break
		if not zz:
			print(2)
			print(n, n - 1)


from collections import defaultdict as df
from collections import deque as dq
from heapq import heappush, heappop

def prime_sieve(n):
	flag = n % 6 == 2
	sieve = bytearray((n // 3 + flag >> 3) + 1)
	for i in range(1, int(n ** 0.5) // 3 + 1):
		if not sieve[i >> 3] >> (i & 7) & 1:
			k = 3 * i + 1 | 1
			for j in range(k * k // 3, n // 3 + flag, 2 * k):
				sieve[j >> 3] |= 1 << (j & 7)
			for j in range(k * (k - 2 * (i & 1) + 4) // 3, n // 3 + flag, 2 * k):
				sieve[j >> 3] |= 1 << (j & 7)
	return sieve

def prime_list(n):
	res = []
	if n > 1:
		res.append(2)
	if n > 2:
		res.append(3)
	if n > 4:
		sieve = prime_sieve(n + 1)
		res.extend((3 * i + 1 | 1 for i in range(1, (n + 1) // 3 + (n % 6 == 1)) if not sieve[i >> 3] >> (i & 7) & 1))
	return res
from math import ceil
t = int(input())
prime_set = prime_list(300001)
for _ in range(t):
	(n, a) = input().split()
	n = int(n)
	s = input()
	pos = []
	for i in range(n):
		if s[i] != a:
			pos.append(i + 1)
	if len(pos) == 0:
		print(0)
	else:
		for i in range(n - 1, -1, -1):
			if s[i] == a:
				if n % 2:
					if i >= n // 2:
						print(1)
						print(i + 1)
					else:
						print(2)
						print(n - 1, n)
				elif i >= n // 2:
					print(1)
					print(i + 1)
				else:
					print(2)
					print(n - 1, n)
				break
		else:
			print(2)
			print(n - 1, n)


t = int(input())
mod = 10 ** 9 + 7
for _ in range(t):
	(n, c) = input().split()
	n = int(n)
	s = input()
	if s == c * n:
		print(0)
		continue
	ci = n - 1
	while ci >= 0 and s[ci] != c:
		ci -= 1
	if ci == -1:
		print(2)
		print(n, n - 1)
	elif ci * 2 + 2 <= n:
		print(2)
		print(n, n - 1)
	else:
		print(1)
		print(ci + 1)


import os
import sys
from io import BytesIO, IOBase

def main():
	pass
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()
T = int(input())
for _ in range(T):
	(n, c) = input().split()
	n = int(n)
	s = list(input())
	flag = 1
	for i in range(n):
		if s[i] != c:
			flag = 0
			break
	if flag == 1:
		print(0)
	else:
		for i in range((n + 1) // 2):
			if s[-(i + 1)] == c:
				print(1)
				print(n - i)
				flag = 1
				break
		if flag == 0:
			print(2)
			print(n, n - 1)


def test():
	(n, c) = input().split(maxsplit=1)
	n = int(n)
	string = list(input())
	correct_str = list(c * len(string))
	if string == correct_str:
		print(0)
		return
	for i in range(int(n / 2), n):
		if string[i] == c:
			print(f'1\n{i + 1}')
			return
	print(f'2\n{n - 1} {n}')
t = int(input())
for i in range(t):
	test()


t = int(input())
for _ in range(t):
	(n, c) = input().split()
	n = int(n)
	s = input()
	if all((x == c for x in s)):
		print(0)
	else:
		b = False
		for i in range(2, n + 1):
			if all((s[q * i - 1] == c for q in range(1, 1 + n // i))):
				b = True
				break
		if b:
			print(1)
			print(i)
		else:
			print(2)
			print(n - 1, n)


from __future__ import division, print_function
import math
import sys
import os
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input().strip()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())
for _ in range(inp()):
	(n, c) = input().strip().split()
	n = int(n)
	l = insr()
	diff = []
	for i in range(n):
		if l[i] != c:
			diff.append(i)
	if len(diff) == 0:
		print(0)
	elif diff[-1] != n - 1:
		print(1)
		print(n)
	else:
		cnt = 2
		idx = 0
		for i in range(n // 2, n):
			if l[i] == c:
				cnt = 1
				idx = i + 1
				break
		print(cnt)
		if cnt == 2:
			print(n, n - 1)
		else:
			print(idx)


t = int(input())
for tests in range(t):
	(n, ch) = input().split()
	n = int(n)
	s = input()
	if s == ch * n:
		print(0)
		continue
	for i in range(2, n + 1):
		ck = False
		for j in range(i - 1, n, i):
			if s[j] != ch:
				ck = True
				break
		if ck == False:
			print(1)
			print(i)
			break
	else:
		print(2)
		print(n - 1, n)


from math import gcd
from sys import stdout
output = []
for _t in range(int(input())):
	(n, c) = input().split(' ')
	n = int(n)
	s = input()
	if all((ch == c for ch in s)):
		output.append('0')
	else:
		for i in range(n, n // 2, -1):
			if s[i - 1] == c:
				output.append('1')
				output.append(str(i))
				break
		else:
			output.append('2')
			output.append(str(n - 1) + ' ' + str(n))
stdout.write('\n'.join(output))


t = int(input())
for _ in range(t):
	(n, c) = input().split()
	n = int(n)
	s = input()
	if s == c * n:
		ans = 0
		print(0)
	else:
		x = 2
		m = 0
		ans = 2
		while x <= n:
			for i in range(x - 1, n, x):
				if s[i] != c:
					break
			else:
				ans = 1
				m = x
				break
			x += 1
		print(ans)
		if ans == 1:
			print(m)
		else:
			print(n, n - 1)


t = int(input())
for _ in range(t):
	(n, c) = input().split()
	n = int(n)
	s = input()
	a = 0
	for i in range(len(s) - 1):
		if s[i] != c:
			a += 1
			break
	if a == 0:
		if s[-1] == c:
			print(0)
			continue
		else:
			print(1)
			print(n - 1)
			continue
	ind = -1
	for i in range(len(s) - 1, -1, -1):
		if s[i] == c:
			ind = i + 1
			break
	if ind * 2 <= n:
		print(2)
		print(n, end=' ')
		print(n - 1)
		continue
	else:
		print(1)
		print(ind)


t = int(input())
for _ in range(t):
	(n, c) = list(input().split())
	s = list(input())
	n = int(n)
	count = 0
	flag = 0
	if all((s[i] == c for i in range(n))):
		print(0)
		continue
	for i in range(n // 2, n):
		if s[i] == c:
			print(1)
			print(i + 1)
			flag = 1
			break
	if flag == 0:
		print(2)
		print(n // 2 + 1, n // 2 + 2)


import os, sys
from io import BytesIO, IOBase

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, 8192))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, 8192))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
inp = lambda dtype: [dtype(x) for x in input().split()]
inp_2d = lambda dtype, n: [dtype(input()) for _ in range(n)]
inp_2ds = lambda dtype, n: [inp(dtype) for _ in range(n)]
inp_enu = lambda dtype: [(i, x) for (i, x) in enumerate(inp(dtype))]
inp_enus = lambda dtype, n: [[i] + inp(dtype) for i in range(n)]
ceil1 = lambda a, b: (a + b - 1) // b
for _ in range(int(input())):
	(n, c) = inp(str)
	(s, n) = (input(), int(n))
	(su, ans) = (n - s.count(c), [n, n - 1])
	if not su:
		print(0)
		continue
	for j in range(2, n + 1):
		tem = 0
		for i in range(j - 1, n, j):
			if s[i] != c:
				tem += 1
		if tem == 0:
			ans = [j]
			break
	print(len(ans))
	print(*ans)


def solve():
	(n, c) = map(str, input().split())
	n = int(n)
	s = input()
	if all((x == c for x in s)):
		print(0)
		return
	for k in range(n, n // 2, -1):
		if s[k - 1] == c:
			print(1)
			print(k)
			return
	print(2)
	print(n - 1, n)
import sys
input = lambda : sys.stdin.readline().rstrip()
t = int(input())
for i in range(t):
	solve()


import os
import sys
import math
import collections
import functools
import itertools
import heapq
import bisect
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
ALPHA = 'abcde'
MOD = 10 ** 9 + 7
EPS = 1e-06
INF = 10 ** 18

def Ceil(a, b):
	return a // b + int(a % b > 0)

def INT():
	return int(input())

def STR():
	return input()

def INTS():
	return tuple(map(int, input().split()))

def ARRINT():
	return [int(i) for i in input().split()]

def ARRSTR():
	return [i for i in input().split()]

def solve(n, c, s):
	zero = True
	idx = None
	for i in range(n):
		if s[i] != c:
			zero = False
		elif (i + 1) * 2 > n and s[i] == c:
			idx = i
	if zero:
		print(0)
	elif idx:
		print(1)
		print(idx + 1)
	else:
		print(2)
		print(*[n - 1, n])
for t in range(INT()):
	tmp = ARRSTR()
	(n, c) = (int(tmp[0]), tmp[1])
	s = STR()
	solve(n, c, s)


t = int(input())
for _ in range(t):
	(n, c) = input().split()
	n = int(n)
	s = input()
	if s == c * n:
		print(0)
	elif c in s[n // 2:]:
		s = s[n // 2:][::-1]
		print(1)
		print(n - s.index(c))
	else:
		print(2)
		print(n - 1, n)


from collections import Counter, defaultdict
import sys
readline = sys.stdin.readline
T = int(readline())
for _ in range(T):
	(N, c) = readline().split()
	N = int(N)
	S = readline().rstrip()
	if S.count(c) == N:
		print(0)
		continue
	for i in range(N):
		if (i + 1) * 2 > N and S[i] == c:
			print(1)
			print(i + 1)
			break
	else:
		print(2)
		print(N, N - 1)


for _ in range(int(input())):
	(num, let) = input().split()
	s = input()
	l0 = []
	l1 = []
	if s.count(let) == len(s):
		print(0)
	elif s.count(let) == 0:
		print(2)
		print(num, int(num) - 1)
	else:
		for i in range(int(num)):
			if s[i] == let:
				l0.append(i + 1)
			else:
				l1.append(i + 1)
		l2 = [x % l0[-1] for x in l1]
		print(2 - (l2.count(0) == 0))
		print(*[int(num), l0[-1], int(num) - 1][l2.count(0) == 0::2])


for tc in range(int(input())):
	(n, c) = input().split()
	n = int(n)
	s = input()
	if s == c * n:
		print(0)
		continue
	ans = -1
	for i in range(1, n + 1):
		solved = True
		for k in range(i, n + 1, i):
			if s[k - 1] != c:
				solved = False
				break
		if solved:
			ans = i
			break
	if solved:
		print(1)
		print(ans)
		continue
	print(2)
	print(n, n - 1)


t = int(input())
for i in range(t):
	line = input().split()
	n = int(line[0])
	c = line[1]
	pos = [char == c for char in input()]
	if all(pos):
		print(0)
	elif pos[-1]:
		print(1)
		print(len(pos))
	else:
		possible = False
		for x in range(2, len(pos)):
			if all(pos[x - 1::x]):
				possible = True
				print(1)
				print(x)
				break
		if not possible:
			print(2)
			print(str(len(pos)) + ' ' + str(len(pos) - 1))


import os
from io import BytesIO, IOBase
import sys
import math

def split(word):
	return [char for char in word]

def ncr(n, r, p):
	num = den = 1
	for i in range(r):
		num = num * (n - i) % p
		den = den * (i + 1) % p
	return num * pow(den, p - 2, p) % p

def main():
	for i in range(int(input())):
		(n, x) = input().split()
		s = input()
		n = int(n)
		c = 0
		for j in range(n):
			if s[j] != x:
				c = c + 1
				break
		if c == 0:
			print('0')
		else:
			k = 0
			for j in range(n // 2, n):
				if s[j] == x:
					k = k + 1
					break
			if k == 0:
				print('2')
				print(n - 1, n)
			else:
				print('1')
				print(j + 1)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import sys
import os.path
from collections import *
import math
import bisect
import heapq as hq
from fractions import Fraction
from random import randint
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
input = sys.stdin.readline
st = set()

def printDivisors(n):
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				st.add(i)
			else:
				st.add(i)
				st.add(n // i)
		i = i + 1

def solve():
	(n, c) = [x for x in input().split()]
	n = int(n)
	s = input().rstrip('\n')
	if s.count(c) == n:
		print(0)
		return
	if s[-1] == c:
		print(1)
		print(n)
		return
	x = -1
	for i in range(1, n + 1):
		if n % i:
			x = i
			break
	arr = [1]
	for i in range(n):
		if s[i] != c:
			arr.append(i + 1)
	y = -1
	for i in arr:
		printDivisors(i)
	arr = list(st)
	arr.sort()
	for i in range(len(arr)):
		if arr[i] != i + 1:
			y = i + 1
			break
	if y == -1:
		print(2)
		print(x, n)
	else:
		print(1)
		print(y)
	st.clear()
t = int(input())
while t:
	t -= 1
	solve()


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
(ONLINE_JUDGE, INF, mod) = (False, float('inf'), int(1000000000.0) + 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 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):
	temp = num ** 0.5
	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

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()
	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()


for _ in range(int(input())):
	l = list(input().split())
	n = int(l[0])
	c = l[1]
	s = input()
	a = 0
	for i in range(n):
		if s[i] != c:
			a += 1
			k = i
	if a == 0:
		print(0)
	elif a == 1:
		if k == n - 1:
			print(1)
			print(k)
		else:
			print(1)
			print(k + 2)
	else:
		flag = 0
		for i in range(n - 1, n // 2 - 1, -1):
			if s[i] == c:
				flag = i
				break
		if flag:
			print(1)
			print(flag + 1)
		else:
			print(2)
			print(n, n - 1)


for t in range(int(input())):
	(n, c) = input().rstrip().split()
	n = int(n)
	s = input().rstrip()
	best_idx = -1
	if all((cc == c for cc in s)):
		print(0)
		continue
	for (i, cc) in enumerate(s, start=1):
		if cc == c:
			best_idx = i
	if best_idx * 2 > n:
		print(1)
		print(best_idx)
	else:
		print(2)
		print(n, n - 1)


def solve():
	(n, c) = input().split()
	n = int(n)
	s = input()
	no_work = True
	for i in s:
		if i != c:
			no_work = False
	if no_work:
		print(0)
		return
	for i in range(n - 1, n // 2 - 1, -1):
		if s[i] == c:
			print(1)
			print(i + 1)
			return
	print(2)
	print(n - 1, n)
for _ in range(int(input())):
	solve()


def solve():
	y = input()
	y = y.split(' ')
	n = int(y[0])
	c = y[1]
	s = input()
	index = -1
	ans = True
	for i in range(len(s)):
		if s[i] == c:
			index = i
		else:
			ans = False
	if ans:
		print(0)
		return
	if index == -1:
		print(2)
		print(f'{n} {n - 1}')
		return
	if index == n - 1:
		print(1)
		print(n)
		return
	if index >= n // 2:
		print(1)
		print(f'{index + 1}')
		return
	else:
		print(2)
		print(f'{n} {n - 1}')
		return
t = int(input())
while t > 0:
	solve()
	t -= 1


from sys import stdin as sin

def aint():
	return int(input())

def amap():
	return map(int, sin.readline().split())

def alist():
	return list(map(int, sin.readline().split()))

def astr():
	return input()
for _ in range(aint()):
	(n, c) = map(str, sin.readline().split())
	n = int(n)
	s = input()
	f = -1
	for i in range(n - 1, n // 2 - 1, -1):
		if s[i] == c:
			f = i
			break
	if s.count(c) == n:
		print(0)
	elif f != -1:
		print(1)
		print(f + 1)
	else:
		print(2)
		print(n - 1, n)


from collections import Counter, deque
import math
from random import randint
from bisect import bisect
import sys
import re
import copy
MOD = 1000000007
MAX = sys.maxsize
MIN = -sys.maxsize

class get:

	def int():
		return list(map(int, input().split()))

	def str():
		return input().split()

	def float():
		return list(map(float, input().split()))

	def map():
		return map(int, input().split())

def sqrt(x):
	return int(math.sqrt(x)) + 1

def gcd(*args):
	result = args[0]
	for item in args:
		result = math.gcd(result, item)
	return result

def LCM(a, b):
	return a * b // math.gcd(a, b)

def value(n):
	if n % 2 == 1:
		return 2
	else:
		for i in range(3, n, 2):
			if n % i != 0:
				return i

def solve():
	(n, c) = input().split()
	n = int(n)
	s = input()
	if n == s.count(c):
		print(0)
		return
	k = n
	try:
		k = s[::-1].index(c)
		k = n - k
	except:
		pass
	temp = True
	for i in range(n):
		if (i + 1) % k == 0 and s[i] != c:
			print(2)
			print(n, n - 1)
			temp = False
			break
	if temp == True:
		print(1)
		print(k)
for _ in range(int(input())):
	solve()


import math

def SieveOfEratosthenes():
	prime_number = [True for _ in range(10 ** 6 + 1)]
	p = 2
	while p * p <= 10 ** 12:
		if prime_number[p]:
			for i in range(p * p, 10 ** 6 + 1, p):
				prime_number[i] = False
		p += 1
	for p in range(2, 10 ** 6 + 1):
		if prime_number[p]:
			Prime.add(p)
Prime = set()
SieveOfEratosthenes()
for _ in range(int(input())):
	(n, c) = input().split(' ')
	s = input()
	n = int(n)
	(maxPrime, minPrime) = (3, 1)
	for i in range(3, n + 1, 2):
		if i in Prime:
			maxPrime = i
	for i in range(n - 1, 0, -1):
		if s[i] == c:
			minPrime = max(minPrime, i)
			break
	if ''.join(set(s)) == c:
		print(0)
	elif (minPrime + 1) * 2 <= n:
		print(f'2\n{minPrime + 1} {maxPrime}')
	elif s[maxPrime - 1] == c:
		print(f'1\n{maxPrime}')
	elif s[minPrime] == c:
		print(f'1\n{minPrime + 1}')
	else:
		print(f'2\n{minPrime + 1} {maxPrime}')


for _ in range(int(input())):
	(n, c) = map(str, input().split())
	n = int(n)
	s = input().strip('\n')
	if s.count(c) == n:
		print(0)
		continue
	f = -1
	for i in range(n - 1, n // 2 - 1, -1):
		if s[i] == c:
			f = i
			break
	if f != -1:
		print(1)
		print(f + 1)
	else:
		print(2)
		print(n, n - 1)


from sys import stdin, stdout
from collections import defaultdict, Counter
import bisect
import math
input = stdin.readline

def inp():
	return map(str, input().split())
mod = 10 ** 9 + 7
for _ in range(int(input())):
	(n, c) = inp()
	s = input()
	n = int(n)
	cnt = 0
	flag = 0
	p = -1
	for i in range(n):
		if s[i] == c:
			cnt += 1
			if i + 1 > n // 2:
				p = i + 1
				flag = 1
	if cnt == n:
		print(0)
		continue
	if flag:
		print(1)
		print(p)
		continue
	print(2)
	print(n, n - 1)


t = int(input())
for _ in range(t):
	(n, c) = map(str, input().split())
	n = int(n)
	s = input()
	bruh = 0
	diff = 0
	save_index = -1
	for i in range(n // 2, n):
		if s[i] == c:
			save_index = i
			bruh = 1
			break
	for i in range(n):
		if s[i] != c:
			diff = 1
			break
	if bruh == 1:
		if diff == 0:
			print(0)
		else:
			print(1)
			print(save_index + 1)
	else:
		print(2)
		print(n - 1, n)


from collections import defaultdict

def il():
	return list(map(int, input().split()))

def ii():
	return int(input())

def imi():
	return map(int, input().split())

def ist():
	return input()
t = ii()
for _ in range(t):
	st = ist().split()
	n = int(st[0])
	c = st[1]
	st = list(ist())
	se = set(st)
	if len(se) == 1 and list(se)[0] == c:
		print(0)
	else:
		dd = defaultdict(lambda : -1)
		mi = n + 1
		mx = 0
		for i in range(n):
			if st[i] != c:
				dd[i + 1] = 1
		for j in range(2, n + 1):
			for i in range(j, n + 1, j):
				if dd[i] == 1:
					break
			else:
				print(1)
				print(j)
				break
		else:
			print(2)
			print(n, n - 1)


def getlistint():
	return list(map(int, stdin.readline().split()))

def getmapint():
	return map(int, stdin.readline().split())

def getliststr():
	return list(stdin.readline().split())

def getint():
	return int(stdin.readline().strip())

def getstr():
	return stdin.readline().strip()

def pr(s):
	stdout.write(str(s) + '\n')

def prlist(l):
	stdout.write(' '.join(list(map(str, l))) + '\n')
from sys import stdin, stdout
for _ in range(getint()):
	a = getliststr()
	(n, c) = (int(a[0]), a[1])
	s = getstr()
	st = c * len(s)
	if st == s:
		pr(0)
		continue
	if s[-1] == c:
		pr(1)
		pr(n)
		continue
	for i in range(n, n // 2, -1):
		if s[i - 1] == c:
			pr(1)
			pr(i)
			break
	else:
		pr(2)
		pr(str(n) + ' ' + str(n - 1))


import os, sys
from io import BytesIO, IOBase
from types import GeneratorType
from bisect import *
from collections import defaultdict, deque, Counter
import math, string
from heapq import *
from operator import add
from itertools import accumulate
BUFSIZE = 8192
sys.setrecursionlimit(10 ** 5)

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
inf = float('inf')
en = lambda x: list(enumerate(x))
ceil_ = lambda a, b: (a + b - 1) // b
ii = lambda : int(input())
r = lambda : map(int, input().split())
rr = lambda : list(r())

def solve():
	(n, k) = input().split()
	n = int(n)
	s = input()
	if s.count(k) == n:
		print(0)
		return
	for i in range(n // 2, n):
		if s[i] == k:
			print(1)
			print(i + 1)
			return
	print(2)
	print(n, n - 1)
for _ in ' ' * ii():
	solve()


n = int(input())
for _ in range(n):
	(str_len, target_char) = input().split()
	str_len = int(str_len)
	s = input()
	middle = str_len >> 1
	left_len = middle
	right_len = str_len - middle
	left_ok_num = s.count(target_char, 0, middle)
	right_ok_num = s.count(target_char, middle)
	right_ok_pos = s.find(target_char, middle)
	if 0 < right_ok_num < right_len:
		print(1)
		print(right_ok_pos + 1)
	elif right_ok_num == 0:
		print(2)
		print(str_len - 1, str_len)
	elif right_ok_num == right_len:
		if left_ok_num == left_len:
			print(0)
		else:
			print(1)
			print(str_len)


import sys, math, bisect
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 = 1e+19
	low = 0
	high = len(arr) - 1
	closest_num = None
	if len(arr) == 0:
		return None
	if len(arr) == 1:
		return arr[0]
	while low <= high:
		mid = (low + high) // 2
		min_diff_left = 1e+19
		min_diff_right = 1e+19
		if mid + 1 < len(arr):
			min_diff_right = abs(arr[mid + 1] - target)
		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
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)


import sys
from math import cos, pi, ceil, pi, tan, floor, gcd, sqrt, log2, factorial, log10
from collections import Counter
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase
from statistics import mean, median, mode
from bisect import *
alpha = ascii_lowercase
beta = ascii_uppercase

def nextPowerOf2(n):
	p = 1
	if n and (not n & n - 1):
		return n
	while p < n:
		p <<= 1
	return p

def get_Divisors(n):
	arr = []
	i = 1
	while i <= sqrt(n):
		if n % i == 0:
			if n / i == i:
				arr.append(i)
			else:
				arr.append(i)
				arr.append(n // i)
		i = i + 1
	return arr

def isprime(n):
	if n == 1:
		return 0
	i = 2
	while i * i <= n:
		if n % i == 0:
			return 0
		i += 1
	return 1

def Sieve(n):
	prime = [True for i in range(n + 1)]
	prime[0] = False
	prime[1] = False
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def create_matrix(n, m):
	mat = [[] for i in range(n)]
	for i in range(n):
		for j in range(m):
			mat[i].append(0)
	return mat

def main():
	for ttt in range(int(input())):
		(n, k) = map(str, input().split())
		s = input()
		n = int(n)
		if s == k * n:
			print(0)
			continue
		ok = 0
		ind = -1
		for i in range(n):
			if s[i] == k:
				ok = 1
				ind = i
		if ok == 0:
			print(2)
			print(n - 1, n)
		elif ind == n - 1:
			print(1)
			print(n)
		elif ind >= n // 2:
			print(1)
			print(ind + 1)
		else:
			print(2)
			print(n - 1, n)
main()


import itertools
from collections import defaultdict
import itertools
import math
import sys
import bisect
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.buffer.readline())

def MI():
	return map(int, sys.stdin.buffer.readline().split())

def LI():
	return list(map(int, sys.stdin.buffer.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def BI():
	return sys.stdin.buffer.readline().rstrip()

def SI():
	return sys.stdin.buffer.readline().rstrip().decode()

def li():
	return [int(i) for i in input().split()]

def lli(rows):
	return [li() for _ in range(rows)]

def si():
	return input()

def ii():
	return int(input())

def ins():
	return input().split()
mod = 10 ** 9 + 7

def solve():
	(n, c) = input().split()
	n = int(n)
	s = si()
	for i in range(n):
		if s[i] != c:
			break
	else:
		return print(0)
	for j in range(n // 2, n):
		if s[j] == c:
			print(1)
			return print(j + 1)
	print(2)
	return print(n, n - 1)

def main():
	for _ in range(ii()):
		solve()
main()


for _ in range(int(input())):
	(n, l) = input().split()
	n = int(n)
	s = input()
	hit = False
	if s.count(l) == n:
		print(0)
	elif s[-1] == l:
		print(1)
		print(n)
	else:
		for i in range(n // 2, n):
			if s[i] == l:
				print(1)
				print(i + 1)
				hit = True
				break
		if not hit:
			print(2)
			print(n - 1, n)


def solve():
	st = input().split()
	(n, c) = (int(st[0]), st[1])
	s = input()
	if s.count(c) == n:
		print(0)
		return
	gde = n // 2
	for i in range(gde, n):
		if s[i] == c:
			print(1)
			print(i + 1)
			return
	print(2)
	print(str(n - 1) + ' ' + str(n))
for _ in range(0, int(input())):
	solve()


for i in range(int(input())):
	(n, c) = map(str, input().split())
	n = int(n)
	s = input()
	l = []
	a = 0
	for i in range(n):
		if s[i] != c:
			l.append(i + 1)
		else:
			a = i + 1
	if c * n == s:
		print(0)
	elif a == 0:
		print(2)
		print(n, end=' ')
		for i in range(2, n):
			if n % i != 0:
				print(i)
				break
	else:
		ans = 0
		for i in l:
			if i % a == 0:
				ans = 1
		if s[n - 1] == c:
			print(1)
			print(n)
		elif ans == 0:
			print(1)
			print(a)
		else:
			print(2)
			print(n, end=' ')
			for i in range(2, n):
				if n % i != 0:
					print(i)
					break


from collections import Counter
import string
import math
import bisect
import sys
from fractions import Fraction

def array_int():
	return [int(i) for i in sys.stdin.readline().split()]

def vary(arrber_of_variables):
	if arrber_of_variables == 1:
		return int(sys.stdin.readline())
	if arrber_of_variables >= 2:
		return map(int, sys.stdin.readline().split())

def makedict(var):
	return dict(Counter(var))
testcases = vary(1)
for _ in range(testcases):
	(n, c) = input().split()
	n = int(n)
	st = input()
	if len(set(st)) == 1 and st[0] == c:
		print(0)
	else:
		for i in range(n // 2, n):
			if st[i] == c:
				print(1)
				print(i + 1)
				break
		else:
			print(2)
			print(n, n - 1)


import io, os
import sys
from sys import stdin
from bisect import bisect_left, bisect_right
from collections import defaultdict, deque, namedtuple
from math import gcd, ceil, floor, sqrt
from itertools import combinations, permutations
input = sys.stdin.readline

def work(n, s, ch):
	inds = []
	idx = []
	for (i, c) in enumerate(s):
		if c != ch:
			inds.append(i + 1)
		else:
			idx.append(i + 1)
	if len(inds) == 0:
		return (0, [])
	if n not in inds:
		return (1, [n])
	m = len(idx)
	for i in range(m - 1, -1, -1):
		flag = True
		j = 2
		while idx[i] * j <= n:
			index = idx[i] * j - 1
			if s[index - 1] != ch:
				flag = False
				break
			j += 1
		if flag:
			return (1, [idx[i]])
	st = [True] * (n + 1)
	for i in range(1, int(sqrt(n)) + 1):
		if n % i == 0:
			st[i] = False
			st[n // i] = False
	for i in range(1, n + 1):
		if st[i] == True:
			return (2, [i, n])

def main():
	test = int(input())
	for idt in range(test):
		(n, ch) = input().split()
		n = int(n)
		s = input().strip('\r\n')
		(ans, ops) = work(n, s, ch)
		if ans == 0:
			print(ans)
		else:
			print(ans)
			for i in ops:
				print(i, end=' ')
			print()
	return
main()


import re
t = int(input())
for i in range(t):
	(n, letter) = input().split()
	n = int(n)
	string = input()
	rev = string[::-1]
	if re.fullmatch(letter + '*', string):
		print(0)
	elif letter in string:
		index = rev.find(letter)
		realindex = n - 1 - index
		if realindex >= n // 2:
			print(1)
			print(realindex + 1)
		else:
			print(2)
			print(n, ' ', n - 1)
	else:
		print(2)
		print(n, ' ', n - 1)


from math import gcd
for _ in range(int(input())):
	(n, c) = input().split()
	s = input()
	n = int(n)
	k = 0
	kk = 0
	for i in range(n):
		if s[i] == c:
			k = i
	i = 1
	b = True
	while i * (k + 1) <= n:
		if s[i * (k + 1) - 1] != c:
			b = False
			break
		i += 1
	if s.count(c) == n:
		print(0)
	elif k != 0 and b:
		print(1)
		print(k + 1)
	else:
		print(2)
		print(n - 1, n)


t = int(input())
for i in range(t):
	(n, c) = list(input().split())
	n = int(n)
	s = input()
	if all((i == c for i in s)):
		print(0)
		continue
	for i in range(n - 1, n // 2 - 1, -1):
		if s[i] == c:
			print(1)
			print(i + 1)
			break
	else:
		print(2)
		print(n - 1, n)