Problem: Your friend Salem is Warawreh's brother and only loves math and geometry problems. He has solved plenty of such problems, but according to Warawreh, in order to graduate from university he has to solve more graph problems. Since Salem is not good with graphs he asked your help with the following problem.

<image>

You are given a complete directed graph with n vertices without self-loops. In other words, you have n vertices and each pair of vertices u and v (u ≠ v) has both directed edges (u, v) and (v, u).

Every directed edge of the graph is labeled with a single character: either 'a' or 'b' (edges (u, v) and (v, u) may have different labels).

You are also given an integer m > 0. You should find a path of length m such that the string obtained by writing out edges' labels when going along the path is a palindrome. The length of the path is the number of edges in it.

You can visit the same vertex and the same directed edge any number of times.

Input

The first line contains a single integer t (1 ≤ t ≤ 500) — the number of test cases.

The first line of each test case contains two integers n and m (2 ≤ n ≤ 1000; 1 ≤ m ≤ 10^{5}) — the number of vertices in the graph and desirable length of the palindrome.

Each of the next n lines contains n characters. The j-th character of the i-th line describes the character on the edge that is going from node i to node j.

Every character is either 'a' or 'b' if i ≠ j, or '*' if i = j, since the graph doesn't contain self-loops.

It's guaranteed that the sum of n over test cases doesn't exceed 1000 and the sum of m doesn't exceed 10^5.

Output

For each test case, if it is possible to find such path, print "YES" and the path itself as a sequence of m + 1 integers: indices of vertices in the path in the appropriate order. If there are several valid paths, print any of them.

Otherwise, (if there is no answer) print "NO".

Example

Input


5
3 1
*ba
b*b
ab*
3 3
*ba
b*b
ab*
3 4
*ba
b*b
ab*
4 6
*aaa
b*ba
ab*a
bba*
2 6
*a
b*


Output


YES
1 2
YES
2 1 3 2
YES
1 3 1 3 1
YES
1 2 1 3 4 1 4
NO

Note

The graph from the first three test cases is shown below:

<image>

In the first test case, the answer sequence is [1,2] which means that the path is:

$$$1 \xrightarrow{b} 2$$$

So the string that is obtained by the given path is b.

In the second test case, the answer sequence is [2,1,3,2] which means that the path is:

$$$2 \xrightarrow{b} 1 \xrightarrow{a} 3 \xrightarrow{b} 2$$$

So the string that is obtained by the given path is bab.

In the third test case, the answer sequence is [1,3,1,3,1] which means that the path is:

$$$1 \xrightarrow{a} 3 \xrightarrow{a} 1 \xrightarrow{a} 3 \xrightarrow{a} 1$$$

So the string that is obtained by the given path is aaaa.

The string obtained in the fourth test case is abaaba.

Solution (in JAVA):

Solution:



import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map.Entry;
import java.util.Queue;
import java.util.StringTokenizer;






public class COVID {

	static long mod = 998244353 ;
	static PrintWriter pw;

	static ArrayList<Integer>[] adjList;

	static int INF=(int)1e8;
	static double EPS=1e-9;



	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		int t=sc.nextInt();
		test:	while(t-->0) {
			int n=sc.nextInt();
			int m=sc.nextInt();
			char[][] g=new char[n][n];
			for(int i=0;i<n;i++)
				g[i]=sc.nextLine().toCharArray();
	
			StringBuilder sb=new StringBuilder();
		if(n==2) {
			if(g[0][1]==g[1][0]) {
				int cur=0;
				for(int i=0;i<m;i++,cur^=1)
					sb.append((cur+1)+" ");
				sb.append((cur+1));
			}else if(m%2==0) {
				pw.println("NO");
				continue test;
			}else {
				
				sb.append("1 2 ");
				for(int i=0;i<m/2;i++)
					sb.append("1 2 ");
				
			}
		}else {
			if(g[0][1]==g[1][2]&&g[1][2]==g[2][0]) {
				for(int i=0;i<m+1;i++) {
					sb.append((1+i%3)+" ");
				}
			}else {
				int first=-1,sec=-1,third=-1;
				if(g[0][1]==g[1][0]) {
					first=1;sec=2;
				}else if(g[1][2]==g[2][1]) {
					first=2;sec=3;
				}else if(g[2][0]==g[0][2]) {
					first=1;sec=3;
				}
				if(first!=-1) {
					for(int i=0;i<(m+1);i++)
						sb.append(((i%2==0)?first:sec)+" ");
				}else {
					//y from third to first x from first to sec and sec to third
					if(g[0][1]==g[1][2]) {
						first=1;sec=2;third=3;
					}else if(g[1][2]==g[2][0]) {
						first=2;sec=3;third=1;
					}else {
						first=3;sec=1;third=2;
					}
					
					if(m%2==1) {
						sb.append(first+" "+sec+" ");
						for(int i=0;i<m/2;i++) {
							sb.append(first+" "+sec+" ");
						}
//				/		sb.append(third);
					}else {
						String s;
						if(m%4==0) {
							sb.append(sec+" ");
							 s=String.format("%d %d %d %d ",third,sec,first,sec);
						}else {
							sb.append(first+" "+sec+" "+third+" ");
							 s=String.format("%d %d %d %d ", sec,first,sec,third);
							}
							for(int i=0;i<m/4;i++)
								sb.append(s);
							
						
					}
				}
				
			}
			
		}
		
		pw.println("YES");
		pw.println(sb.toString());
		
		}

		pw.flush();
	}


	public static long gcd(long a, long b) {
		if(b==0)return a;
		return gcd(b,a%b);
	}

	static long pow(long p, long e) {
		long ans = 1;
		while (e > 0) {
			if ((e & 1) == 1)
				ans =  ((ans * 1l * p));
			e >>= 1;
					{

					}
					p =  ((p * 1l * p));
		}
		return ans;
	}

	static long powmod(long b, long e, int mod) {
		long ans = 1;
		b %= mod;
		while (e > 0) {
			if ((e & 1) == 1)
				ans = (int) ((ans * 1l * b) % mod);
			e >>= 1;
			b = (int) ((b * 1l * b) % mod);
		}
		return ans;
	}


	public static long add(long a, long b) {
		return (a + b) % mod;
	}

	public static long sub(long a, long b) {
		return (a - b + mod) % mod;
	}

	public static long mul(long a, long b) {
		return ((a % mod) * (b % mod)) % mod;
	}




	static class longPair implements Comparable<longPair> {
		long x, y;

		public longPair(long a, long b) {
			x = a;
			y = b;
		}

		public int compareTo(longPair p) {
			return (p.x == x) ? ((p.y == y) ? 0 : (y > p.y) ? 1 : -1) : (x > p.x) ? 1 : -1;
		}
	}


	static class Pair implements Comparable<Pair> {
		int x;
		int y;

		public Pair(int a, int b) {
			this.x = a;
			y = b;
		}


		public int compareTo(Pair o) {
			return (x == o.x) ? ((y > o.y) ? 1 : (y == o.y) ? 0 : -1) : ((x > o.x) ? 1 : -1);
		}

		@Override

		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result + x;
			result = prime * result + y;
			return result;
		}

		@Override

		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			Pair other = (Pair) obj;
			if (x != other.x)
				return false;
			if (y != other.y)
				return false;
			return true;
		}

	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public Scanner(String s) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(s));
		}

		public long[] nextLongArr(int n) throws IOException {
			long[] arr = new long[n];
			for (int i = 0; i < n; i++)
				arr[i] = nextLong();
			return arr;
		}

		public int[] nextIntArr(int n) throws IOException {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++)
				arr[i] = nextInt();
			return arr;
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine(), " ,");
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++) {
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
				if (sb.length() == 18) {
					res += Long.parseLong(sb.toString()) / f;
					sb = new StringBuilder("0");
				}
			}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

	}

	public static void shuffle(int[] a) {
		int n = a.length;
		for (int i = 0; i < n; i++) {
			int r = i + (int) (Math.random() * (n - i));
			int tmp = a[i];
			a[i] = a[r];
			a[r] = tmp;
		}
	}

}