#P1594C. Make Them Equal

    ID: 295 Type: RemoteJudge 2000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>brute forcegreedymathstrings*1200

Make Them Equal

No submission language available for this problem.

Description

Theofanis has a string s1s2sns_1 s_2 \dots s_n and a character cc. He wants to make all characters of the string equal to cc using the minimum number of operations.

In one operation he can choose a number xx (1xn1 \le x \le n) and for every position ii, where ii is not divisible by xx, replace sis_i with cc.

Find the minimum number of operations required to make all the characters equal to cc and the xx-s that he should use in his operations.

The first line contains a single integer tt (1t1041 \le t \le 10^4) — the number of test cases.

The first line of each test case contains the integer nn (3n31053 \le n \le 3 \cdot 10^5) and a lowercase Latin letter cc — the length of the string ss and the character the resulting string should consist of.

The second line of each test case contains a string ss of lowercase Latin letters — the initial string.

It is guaranteed that the sum of nn over all test cases does not exceed 31053 \cdot 10^5.

For each test case, firstly print one integer mm — the minimum number of operations required to make all the characters equal to cc.

Next, print mm integers x1,x2,,xmx_1, x_2, \dots, x_m (1xjn1 \le x_j \le n) — the xx-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.

Input

The first line contains a single integer tt (1t1041 \le t \le 10^4) — the number of test cases.

The first line of each test case contains the integer nn (3n31053 \le n \le 3 \cdot 10^5) and a lowercase Latin letter cc — the length of the string ss and the character the resulting string should consist of.

The second line of each test case contains a string ss of lowercase Latin letters — the initial string.

It is guaranteed that the sum of nn over all test cases does not exceed 31053 \cdot 10^5.

Output

For each test case, firstly print one integer mm — the minimum number of operations required to make all the characters equal to cc.

Next, print mm integers x1,x2,,xmx_1, x_2, \dots, x_m (1xjn1 \le x_j \le n) — the xx-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.

Samples

Sample Input 1

3
4 a
aaaa
4 a
baaa
4 b
bzyx

Sample Output 1

0
1
2
2 
2 3

Note

Let's describe what happens in the third test case:

  1. x1=2x_1 = 2: we choose all positions that are not divisible by 22 and replace them, i. e. bzyx \rightarrow bzbx;
  2. x2=3x_2 = 3: we choose all positions that are not divisible by 33 and replace them, i. e. bzbx \rightarrow bbbb.