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:
//package credit;



import javax.imageio.metadata.IIOMetadataFormatImpl;
import javax.naming.InsufficientResourcesException;
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main{
    static boolean v[];
    static int ans[];
    int size[];
    static int count=0;
    static int dsu=0;
    static int c=0;
    static int e9=1000000007;
    int min=Integer.MAX_VALUE;
    int max=Integer.MIN_VALUE;
    long max1=Long.MIN_VALUE;
    long min1=Long.MAX_VALUE;
    boolean aBoolean=true;
    boolean y=false;
    long m=0;
    static boolean t1=false;
        static class FastReader
        {
            BufferedReader br;
            StringTokenizer st;

            public FastReader()
            {
                br = new BufferedReader(new
                        InputStreamReader(System.in));
            }

            String next()
            {
                while (st == null || !st.hasMoreElements())
                {
                    try
                    {
                        st = new StringTokenizer(br.readLine());
                    }
                    catch (IOException  e)
                    {
                        e.printStackTrace();
                    }
                }
                return st.nextToken();
            }

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

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

            double nextDouble()
            {
                return Double.parseDouble(next());
            }

            String nextLine()
            {
                String str = "";
                try
                {
                    str = br.readLine();
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
                return str;
            }
        }
        int parent[];
        int rank[];
        int n=0;
/*
100000
 */
        ArrayList<ArrayList<Integer>> arrayLists;
        boolean v1[];
        static boolean t2=false;
        boolean r=false;
        int fib[];
        int fib1[];
        int min3=Integer.MAX_VALUE;
        public static void main(String[] args) throws IOException {
            Main g = new Main();
            g.go();
        }
        public void go() throws IOException {
            FastReader scanner=new FastReader();
//            Scanner scanner = new Scanner(System.in);
//            BufferedReader bufferedReader=new BufferedReader(new InputStreamReader(System.in));
//            String s;
            PrintWriter printWriter = new PrintWriter(System.out);
            int t=scanner.nextInt();
            for (int i = 0; i < t; i++) {
                int n=scanner.nextInt();
                int m=scanner.nextInt();
                int x=0;
                int y=0;
                char arr[][]=new char[n][n];
                for (int j = 0; j < n; j++) {
                    String s=scanner.next();
                    arr[j]=s.toCharArray();
                }
                outer:for (int j = 0; j < n; j++) {
                    for (int k = 0; k < n; k++) {
                        if(j!=k&&arr[j][k]==arr[k][j]){
                            x=j+1;
                            y=k+1;
                            break outer;
                        }
                    }
                }
                if(m%2!=0){
                    printWriter.print("YES");
                    printWriter.println();
                    printWriter.print("1 ");
                    for (int j = 0; j <m; j++) {
                        if(j%2==0){
                            printWriter.print("2"+" ");
                        }else{
                            printWriter.print("1"+" ");
                        }
                    }
                    printWriter.println();
                }else{
                    if(x!=0&&y!=0){
                        printWriter.print("YES");
                        printWriter.println();
                        printWriter.print(x+" ");
                        for (int j = 0; j < m; j++) {
                            if(j%2==0){
                                printWriter.print(y+" ");
                            }else{
                                printWriter.print(x+" ");
                            }
                        }
                        printWriter.println();
                    }else {
                        int w1 = 0;
                        int x1 = 0;
                        int y1 = 0;
                        int z1 = 0;
                        outer:
                        for (int j = 0; j < n; j++) {
                            int x2=-1;
                            int y2=-1;
                            for (int k = 0; k < n; k++) {
                                if(arr[j][k]=='a'){
                                    x2=k;
                                }
                                else if(arr[j][k]=='b'){
                                    y2=k;
                                }
                            }
                            if(x2!=-1&&y2!=-1){
                                w1=j+1;
                                x1=x2+1;
                                y1=y2+1;
                                break;
                            }
                        }
                        if(x1!=0&&y1!=0){
                            printWriter.println("YES");
                            for(int k = 0;k < m/2;k++){
                                printWriter.print(((m/2-k) % 2 == 0 ? (w1) : (x1)) + " ");
                            }
                            printWriter.print(w1 + " ");
                            for(int k = 0;k < m/2;k++){
                                printWriter.print(((k) % 2 == 0 ? (y1) : (w1)) + " " );
                            }
                            printWriter.println();
                        }
                        else{
                            printWriter.println("NO");
                        }
                    }
                }
            }
            printWriter.flush();
        }
    static final int mod=1_000_000_007;
    public long mul(long a, long b) {
        return a*b;
    }
    public long fact(int x) {
        long ans=1;
        for (int i=2; i<=x; i++) ans=mul(ans, i);
        return ans;
    }
    public long fastPow(long base, long exp) {
        if (exp==0) return 1;
        long half=fastPow(base, exp/2);
        if (exp%2==0) return mul(half, half);
        return mul(half, mul(half, base));
    }
    public long modInv(long x) {
        return fastPow(x, mod-2);
    }
    public long nCk(int n, int k) {
        return mul(fact(n), mul(modInv(fact(k)), modInv(fact(n-k))));
    }
    public void sieve(int n){
        fib=new int[n+1];
        fib[1]=-1;
        fib[0]=-1;
        for (int i =2; i*i<=n; i++) {
            if(fib[i]==0)
            for (int j =i*i; j <=n; j+=i){
                fib[j]=-1;
//                System.out.println("l");
            }
        }
    }
        public void parent(int n){
            for (int i = 0; i < n; i++) {
                parent[i]=i;
                rank[i]=1;
                size[i]=1;
            }
        }
        public void union(int i,int j){
            int root1=find(i);
            int root2=find(j);
//            if(root1 != root2) {
//                parent[root2] = root1;
////                sz[a] += sz[b];
//            }
            if(root1==root2){
                return;
            }
            if(rank[root1]>rank[root2]){
                parent[root2]=root1;
                size[root1]+=size[root2];
            }
            else if(rank[root1]<rank[root2]){
                parent[root1]=root2;
                size[root2]+=size[root1];
            }
            else{
                parent[root2]=root1;
                rank[root1]+=1;
                size[root1]+=size[root2];
            }
        }
        public int find(int p){
           if(parent[p]!=p){
               parent[p]=find(parent[p]);
           }
           return parent[p];
//            if(parent[p]==-1){
//                return -1;
//            }
//            else if(parent[p]==p){
//                return p;
//            }
//            else {
//                parent[p]=find(parent[p]);
//                return parent[p];
//            }
        }
        public double dist(double x1,double y1,double x2,double y2){
            double e=(x2-x1)*(x2-x1)+(y2-y1)*(y2-y1);
            double e1=Math.sqrt(e);
            return e1;
        }
        public void make(int p){
            parent[p]=p;
            rank[p]=1;
        }
        Random rand = new Random();
        public void sort(int[] a, int n) {
                for (int i = 0; i < n; i++) {
                   int j = rand.nextInt(i + 1);
                   int tmp = a[i];
                   a[i] = a[j];
                   a[j] = tmp;
                }
                Arrays.sort(a, 0, n);
        }
        public long gcd(long a,long b){
               if(b==0){
                  return a;
               }
               return gcd(b,a%b);
        }
        public void dfs(ArrayList<Integer> arrayLists1){
            for (int i = 0; i < arrayLists1.size(); i++) {
                if(v1[arrayLists1.get(i)]==false){
                    System.out.println(arrayLists1.get(i));
                    v1[arrayLists1.get(i)]=true;
                    count++;
                    dfs(arrayLists.get(arrayLists1.get(i)));
                }
            }
        }
        private void dfs2(ArrayList<Integer>[]arrayList,int j,int count){
            ans[j]=count;
            for(int i:arrayList[j]){
                if(ans[i]==-1){
                    dfs2(arrayList,i,count);
                }
            }
        }
        private void dfs3(ArrayList<Integer>[] arrayList, int j) {
            v[j]=true;
            count++;
            for(int i:arrayList[j]){
                if(v[i]==false) {
                    dfs3(arrayList, i);
                }
            }
        }
        public double fact(double h){
            double sum=1;
            while(h>=1){
                sum=(sum%e9)*(h%e9);
                h--;
            }
            return sum%e9;
        }
        public long primef(double r){
            long c=0;
            long ans=1;
            while(r%2==0){
                c++;
                r=r/2;
            }
            if(c>0){
                ans*=2;
            }
            c=0;
//            System.out.println(ans+" "+r);
            for (int i = 3; i <=Math.sqrt(r) ;i+=2) {
                while(r%i==0){
//                    System.out.println(i);
                    c++;
                    r=r/i;
                }
                if(c>0){
                    ans*=i;
                }
                c=0;
            }
            if(r>2){
                ans*=r;
            }
            return ans;
        }
        public long divisor(double r){
            long c=0;
            for (int i = 1; i <=Math.sqrt(r); i++) {
                if(r%i==0){
                    if(r/i==i){
                        c++;
                    }
                    else{
                        c+=2;
                    }
                }
            }
            return c;
        }
}
class Pair{
    long x;
    long y;
    double z;
    public Pair(long x,long y){
        this.x=x;
        this.y=y;
    }

   // @Override
//    public int hashCode() {
//        int hash =27;
//        return this.x * hash + this.y;
//    }
//    @Override
//    public boolean equals(Object o1){
//        if(o1==null||o1.getClass()!=this.getClass()){
//            return false;
//        }
//        Pair o=(Pair)o1;
//        if(o.x==this.x&&o.y==this.y){
//            return true;
//        }
//        return false;
//    }
}
class Sorting implements Comparator<Pair> {
    public int compare(Pair p1,Pair p2){
//        if(p1.x==p2.x){
//            return -1*Double.compare(p1.y,p2.y);
//        }
//        else {
            return Double.compare(p1.x, p2.x);
       // }
    }

}