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.awt.Point;
import java.io.BufferedReader;
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.Collections;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Stack;
import java.util.StringTokenizer;


public class N699 {
	static PrintWriter out;
	static Scanner sc;
	static ArrayList<Integer>primes;
	static HashSet<Integer>primesH;
	static boolean prime[];
	//static ArrayList<Integer>a;
	static HashSet<Long>h;
	static int[][]v;
	static int[]a,b,c,oa,oc;
	static HashSet<Integer>[]ob;
	static int[][]mp;
	static long[]l;
	static int mx;
	public static void main(String[]args) throws IOException {
		sc=new Scanner(System.in);
		out=new PrintWriter(System.out);
		//A();
		//sieveOfEratosthenes(1000000);
		//B();
		//C();
		//minimum for subarrays of fixed length
		D();
		out.close();
	}
	  private static void A() throws IOException {
		 int t=sc.nextInt();
		 while(t-->0) {
			 int px=sc.nextInt(),py=sc.nextInt();
			 int r=0,u=0,d=0,l=0;
			 String s=sc.next();
			 for(int i=0;i<s.length();i++) {
				 switch(s.charAt(i)) {
				 case 'U':u++;break;
				 case'R':r++;break;
				 case 'D':d++;break;
				 case'L':l++;break;
				 }
			 }
			int x=r-l,y=u-d;
			boolean a=px-x<=l&&px>=x;
			boolean b=py-y<=d&&py>=y;
			boolean c=x-px<=r&&px<=x;
			boolean e=y-py<=u&&py<=y;
			if(px==x&&py==y||a&&b||a&&e||c&&b||c&&e) {
				out.println("YES");
			}else {
				out.println("NO");
			}
		 }
		
	}
		static void B() throws IOException {
			int t=sc.nextInt();
			while(t-->0) {
				int n=sc.nextInt(),k=sc.nextInt();
				a=sc.nextArrInt(n);
				int pos=-1;
				int i=0;
				for(;i<n-1;i++) {
					if(a[i]>=a[i+1])continue;
					k--;
				    a[i]++;
					if(k<=0)break;
					i-=2;
					if(i<-1) {
						i=-1;
					}
				}
				out.println(i==n-1?-1:i+1);
			}		
		}
	static void C() throws IOException {
		int t=sc.nextInt();
		while(t-->0) {
			int n=sc.nextInt(),m=sc.nextInt();
			a=sc.nextArrInt(n);
			b=sc.nextArrInt(n);
			c=sc.nextArrInt(m);
			ob=new HashSet[n+1];
			int[]ans=new int[m];
//			ob=new int[n+1];
//			oc=new int[n+1];
			for(int i=0;i<=n;i++) {
				ob[i]=new HashSet<Integer>();
			}
			for(int i=0;i<n;i++) {
				if(a[i]!=b[i])
				ob[b[i]].add(i);
			}
			HashSet<Integer>last=ob[c[m-1]];
			int pos=getElement(last);
			if(pos==-1) {
				int g=c[m-1];
				for(int i=n-1;i>=0;i--)
				{
					if(b[i]==g) {
						pos=i;
						break;
					}
				}
			}else {
				ob[c[m-1]].remove(pos);
			}
			if(pos==-1) {
				//noooo
				out.println("NO");
			}else {
				ans[m-1]=pos;
				for(int i=0;i<m-1;i++) {
					int p=getElement(ob[c[i]]);
					if(p==-1) {
						ans[i]=pos;
					}else {
						ans[i]=p;
						ob[c[i]].remove(p);
					}
				}
				boolean f=true;
				for(HashSet<Integer>j:ob) {
					if(j.size()!=0) {
						f=false;
						break;
					}
				}
				if(f) {
					out.println("YES");
					for(int i=0;i<m;i++) {
						out.print((ans[i]+1)+" ");
					}
					out.println();
				}else {
					out.println("NO");
				}
			}
		}
	}

	static int getElement(HashSet<Integer>k) {
		for(int e:k) {
			return e;
		}
		return -1;
	}
	static void D() throws IOException {
		int t=sc.nextInt();
		while(t-->0) {
			int n=sc.nextInt(),m=sc.nextInt();
			mp=new int[n][n];
			v=new int[n][2];
			for(int i=0;i<n;i++)Arrays.fill(v[i], -1);
			
			for(int i=0;i<n;i++) {
				String s=sc.next();
				for(int j=0;j<n;j++) {
					mp[i][j]=i==j?-1:s.charAt(j)-'a';
					if(i==j)continue;
					v[i][s.charAt(j)-'a']=j;
				}
			}
				boolean f=false;int v1=0,v2=1;
				//int h=(int) Math.floor((n-1)/2);
				for(int i=0;i<n&&!f;i++) {
					for(int j=0;j<n&&!f;j++) {
						if(j==i)continue;
						if(mp[i][j]==mp[j][i]) {
							f=true;
							v1=i;v2=j;
						}
					}
				}
				if(f||m%2==1) {
					//ok
					boolean hi=false;
					out.println("YES");
					for(int i=0;i<=m;i++) {
						out.print((hi?(v1+1):(v2+1))+" ");
						hi=!hi;
					}
					out.println();
				}else {
							boolean k=false;
							for(int i=0;i<n&&!k;i++) {
								for(int j=0;j<n&&!k;j++) {
									if(i==j)continue;
									if(v[j][mp[i][j]]==-1)continue;
									k=true;
									out.println("YES");
									int cur=v[j][mp[i][j]];
									if((m/2)%2==0) {
										out.print(j+1);
										for(int jj=0;jj<m/2;jj++) {
											if(jj%2==1) {
												out.print(" "+(j+1));
											}else {
												out.print(" "+(cur+1));
											}
										}
										for(int jj=0;jj<m/2;jj++) {
											if(jj%2==1) {
												out.print(" "+(j+1));
											}else {
												out.print(" "+(i+1));
											}
										}
									}else {
										for(int jj=0;jj<m+1;jj++) {
											if(jj%2==1) {
												out.print((j+1)+" ");
											}else if(jj%4==0) {
												out.print((i+1)+" ");
											}else {
												out.print((cur+1)+" ");
											}
										}
										//out.print(j+1);
										
									}
									out.println();
								}
							}
							if(!k) {
								out.println("NO");
							}
				}
			}
		
		}
//		Math.floor((n-1)/2);

	private static int solve(int i, int j) {
		int x=i,y=j;
		int max=0;
		for(int t=0;t<mp.length;t++) {
			
		}
		return 0;
	}
	static class Pair{
		int a,min;
		Pair(int a,int min){
			this.a=a;
			this.min=min;
		}
	}
	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 boolean hasNext() {return st.hasMoreTokens();}
		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(); }
		public int[] nextArrInt(int n) throws IOException {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}
		public long[] nextArrLong(int n) throws IOException {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}

	}
	static void sieveOfEratosthenes(int n)  // O(n*log(log(n)))
    { 
        // Create a boolean array "prime[0..n]" and initialize 
        // all entries it as true. A value in prime[i] will 
        // finally be false if i is Not a prime, else true. 
         prime = new boolean[n+1]; 
        for(int i=0;i<n;i++) 
            prime[i] = true; 
          
        for(int p = 2; p*p <=n; p++) 
        { 
            // If prime[p] is not changed, then it is a prime 
            if(prime[p] == true) 
            { 
                // Update all multiples of p 
                for(int i = p*p; i <= n; i += p) 
                    prime[i] = false; 
            } 
        } 
          
        // Print all prime numbers 
        for(int i = 2; i <= n; i++) 
        { 
            if(prime[i] == true) {
                //System.out.print(i + " "); 
                //primes.add(i);
                //primesH.add(i);
            }
        } 
    } 
}