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.util.*;

import java.io.*;

public class asd {
	static BufferedReader br;
	static PrintWriter pw;
	static int inf = (int) 1e9;
	static long mod = 998244353;

	static ArrayList<Integer>[] g;
	static int r;
	static boolean[] vis;
	static long[] dist;

	static ArrayList<Long> first, last;

	static void permute(int idx, int l, long sum) {
		if (idx == l) {
			if (l == n)
				last.add(sum);
			else
				first.add(sum);
			return;
		}
		permute(idx + 1, l, sum + a[idx]);
		permute(idx + 1, l, sum);
	}

	public static void main(String[] args) throws NumberFormatException, IOException, InterruptedException {
//		br = new BufferedReader(new FileReader(new File("chief.in")));
		br = new BufferedReader(new InputStreamReader(System.in));
		Scanner sc = new Scanner(System.in);
		pw = new PrintWriter(System.out);

		int t = sc.nextInt();
		while (t-- > 0) {
			int n = sc.nextInt();
			int m = sc.nextInt();
			char[][] a = new char[n][];
			for (int i = 0; i < a.length; i++) {
				a[i] = sc.next().toCharArray();
			}
			int x = -1, y = -1;
			for (int i = 0; i < a.length && x == -1; i++) {
				for (int j = i + 1; j < a.length; j++) {
					if (a[i][j] == a[j][i]) {
						x = i + 1;
						y = j + 1;
						break;
					}
				}
			}
			if (x != -1) {
				boolean f = false;
				pw.println("YES");
				pw.print(x + " ");
				while (m-- > 0) {
					if (f)
						pw.print(x + " ");
					else
						pw.print(y + " ");
					f = !f;
				}
				pw.println();
			} else {
				if (m % 2 == 1) {
					pw.println("YES");
					boolean f = false;
					pw.print(1 + " ");
					while (m-- > 0) {
						if (f)
							pw.print(1 + " ");
						else
							pw.print(2 + " ");
						f = !f;
					}
					pw.println();
				} else {
					x = -1;
					y = -1;
					int z = -1;
					for (int i = 0; i < a.length; i++) {
						int outa = -1;
						int outb = -1;
						int ina = -1;
						int inb = -1;
						for (int j = 0; j < a.length; j++) {
							if (a[i][j] == 'a')
								outa = j + 1;
							if (a[i][j] == 'b')
								outb = j + 1;
						}
						for (int j = 0; j < a.length; j++) {
							if (a[j][i] == 'a') {
								ina = j + 1;
							}
							if (a[j][i] == 'b' && outb != -1) {
								inb = j + 1;
							}
						}
						if (ina != -1 && outa != -1) {
							x = ina;
							z = i + 1;
							y = outa;
						} else if (inb != -1 && outb != -1) {
							x = inb;
							z = i + 1;
							y = outb;
						}
					}
					if (x == -1) {
						pw.println("NO");
					} else {
						pw.println("YES");
						if((m/2) %2 ==0) {
							pw.print(z + " ");
							for (int i = 0; i < m; i++) {
								if (i % 4 == 3 || i % 4 == 1)
									pw.print(z + " ");
								else if (i % 4 == 0)
									pw.print(y + " ");
								else
									pw.print(x + " ");
							}
						}
						else {
							pw.print(x + " ");
							for (int i = 0; i < m; i++) {
								if (i % 4 == 0 || i % 4 == 2)
									pw.print(z + " ");
								else if (i % 4 == 1)
									pw.print(y + " ");
								else
									pw.print(x + " ");
							}
						}
						
						pw.println();
					}
				}
			}
		}

		pw.flush();

	}

	static int n, m;
	static int[] a;
	static int dx[] = new int[] { -1, 0, 1, 0 };
	static int dy[] = new int[] { 0, -1, 0, 1 };

	static int[] suffix(char[] s) {
		int n = s.length;
		int[] p = new int[n];
		int[] c = new int[n];
		{
			// k == 0
			pair[] a = new pair[n];
			for (int i = 0; i < a.length; i++) {
				a[i] = new pair(s[i], i);
			}
			Arrays.sort(a);
			for (int i = 0; i < a.length; i++) {
				p[i] = a[i].y;
			}
			c[p[0]] = 0;
			for (int i = 1; i < a.length; i++) {
				if (a[i].x == a[i - 1].x)
					c[p[i]] = c[p[i - 1]];
				else
					c[p[i]] = c[p[i - 1]] + 1;
			}
		}
		int k = 0;
		while ((1 << k) < n) {
			suffix[] a = new suffix[n];
			for (int i = 0; i < a.length; i++) {
				a[i] = new suffix(c[i], c[((1 << k) + i) % n], i);
			}
			Arrays.sort(a);
			for (int i = 0; i < a.length; i++) {
				p[i] = a[i].idx;
			}
			c[p[0]] = 0;
			for (int i = 1; i < a.length; i++) {
				if (a[i].x == a[i - 1].x && a[i].y == a[i - 1].y)
					c[p[i]] = c[p[i - 1]];
				else
					c[p[i]] = c[p[i - 1]] + 1;
			}
			k++;
		}

		return p;

	}

	static class suffix implements Comparable<suffix> {
		int x, y;
		int idx;

		public suffix(int a, int b, int i) {
			x = a;
			y = b;
			idx = i;
		}

		@Override
		public int compareTo(suffix o) {
			// TODO Auto-generated method stub
			return ("" + x + y).compareTo("" + o.x + o.y);
		}
	}

	static class Edge implements Comparable<Edge> {
		int node;
		long cost;

		Edge(int a, long b) {
			node = a;
			cost = b;
		}

		public int compareTo(Edge e) {
			return Long.compare(cost, e.cost);
		}
	}

	static class SegmentTree { // 1-based DS, OOP

		int N; // the number of elements in the array as a power of 2 (i.e. after padding)
		int[] array, sTree, lazy;

		SegmentTree(int[] in) {
			array = in;
			N = in.length - 1;
			sTree = new int[N << 1]; // no. of nodes = 2*N - 1, we add one to cross out index zero
			lazy = new int[N << 1];
			build(1, 1, N);
		}

		void build(int node, int b, int e) // O(n)
		{
			if (b == e)
				sTree[node] = array[b];
			else {
				int mid = b + e >> 1;
				build(node << 1, b, mid);
				build(node << 1 | 1, mid + 1, e);
				sTree[node] = sTree[node << 1] + sTree[node << 1 | 1];
			}
		}

		void update_point(int index, int val) // O(log n)
		{
			index += N - 1;
			sTree[index] += val;
			while (index > 1) {
				index >>= 1;
				sTree[index] = sTree[index << 1] + sTree[index << 1 | 1];
			}
		}

		void update_range(int i, int j, int val) // O(log n)
		{
			update_range(1, 1, N, i, j, val);
		}

		void update_range(int node, int b, int e, int i, int j, int val) {
			if (i > e || j < b)
				return;
			if (b >= i && e <= j) {
				sTree[node] += (e - b + 1) * val;
				lazy[node] += val;
			} else {
				int mid = b + e >> 1;
				propagate(node, b, mid, e);
				update_range(node << 1, b, mid, i, j, val);
				update_range(node << 1 | 1, mid + 1, e, i, j, val);
				sTree[node] = sTree[node << 1] + sTree[node << 1 | 1];
			}

		}

		void propagate(int node, int b, int mid, int e) {
			lazy[node << 1] += lazy[node];
			lazy[node << 1 | 1] += lazy[node];
			sTree[node << 1] += (mid - b + 1) * lazy[node];
			sTree[node << 1 | 1] += (e - mid) * lazy[node];
			lazy[node] = 0;
		}

		int query(int i, int j) {
			return query(1, 1, N, i, j);
		}

		int query(int node, int b, int e, int i, int j) // O(log n)
		{
			if (i > e || j < b)
				return 0;
			if (b >= i && e <= j)
				return sTree[node];
			int mid = b + e >> 1;
			propagate(node, b, mid, e);
			int q1 = query(node << 1, b, mid, i, j);
			int q2 = query(node << 1 | 1, mid + 1, e, i, j);
			return q1 + q2;

		}

	}

	static int[] isComposite;
	static ArrayList<Integer> primes; // generated by sieve

	static void sieve(int N) // O(N log log N)
	{
		isComposite = new int[N + 1];
		isComposite[0] = isComposite[1] = 1; // 0 indicates a prime number
		primes = new ArrayList<Integer>();

		for (int i = 2; i <= N; ++i) // can loop till i*i <= N if primes array is not needed O(N log log sqrt(N))
			if (isComposite[i] == 0) // can loop in 2 and odd integers for slightly better performance
			{
				primes.add(i);
				if (1l * i * i <= N)
					for (int j = i * i; j <= N; j += i) // j = i * 2 will not affect performance too much, may alter in
														// modified sieve
						isComposite[j] = 1;
			}
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

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

		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 boolean ready() throws IOException {
			return br.ready();
		}

	}

	static double[] memo;

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

	// method to return LCM of two numbers
	static long lcm(long a, long b) {
		return (a * b) / gcd(a, b);
	}

	static double dis(int x, int y, int z, int w) {
		return Math.sqrt((x - z) * (x - z) + (y - w) * (y - w));
	}

	static int[] nxtarr() throws IOException {
		StringTokenizer st = new StringTokenizer(br.readLine());
		int[] a = new int[st.countTokens()];
		for (int i = 0; i < a.length; i++) {
			a[i] = Integer.parseInt(st.nextToken());
		}
		return a;
	}

	static long[] nxtarrLong() throws IOException {
		StringTokenizer st = new StringTokenizer(br.readLine());
		long[] a = new long[st.countTokens()];
		for (int i = 0; i < a.length; i++) {
			a[i] = Long.parseLong(st.nextToken());
		}
		return a;
	}

	static class pair implements Comparable<pair> {
		int x;
		int y;
		int idx;

		public pair(int d, int u) {
			x = d;
			y = u;
		}

		public pair(int d, int u, int idx) {
			x = d;
			y = u;
			this.idx = idx;
		}

		@Override
		public int compareTo(pair o) {
			// TODO Auto-generated method stub
			return x - o.x;
		}

		@Override
		public String toString() {
			// TODO Auto-generated method stub
			return x + " " + y;
		}

	}

	static class triple implements Comparable<triple> {
		int x;
		int y;
		int z;

		public triple(int a, int b, int c) {
			x = a;
			y = b;
			z = c;
		}

		@Override
		public int compareTo(triple o) {
			// TODO Auto-generated method stub
			return x - o.x;
		}
	}

}