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 CPP):

Solution:
#include <iostream>
#include<bits/stdc++.h>
#include<functional>
using namespace std;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef vector< long long > vll;
typedef pair< int,int > ii;
typedef long long ll;
#define sz(a) int((a).size())
#define pb push_back
#define mp  make_pair
#define pll pair <ll,ll>
#define mod 1000000007
#define mod2 998244353
#define all(c) c.begin(),c.end()
#define tr(c,i) for(typeof(c).begin() i = c.begin(); i != c.end(); i++)
#define present(c,x) (c.find(x) != c.end())
#define cpresent(c,x) (find(all(c),x) != c.end())
#define rep(i, a, b) for (int i = (a); i <= int(b); i++)
#define repn(i,a,b)   for(int i=a;i>=b;i--)
#define fo(i,n) for(ll i=1;i<=n;i++)
#define YES cout<<"YES\n"
#define NO cout<<"NO\n"
#define Yes cout<<"Yes\n"
#define No cout<<"No\n"
#define nl "\n"
#define F first
#define S second 
#define eps 0.0000001
typedef long double ld;
typedef unsigned long long ull;


void ipgraph(int n, int m);
//void dfs(int u, int par);
ll gcd (ll a, ll b);
unsigned long long factorial[2000007]; 
//___________________________________________
 unsigned long long power(unsigned long long x,long long y,int p)
{unsigned long long res=1;x=x%p;while(y>0){if(y&1)
res=(res*x)%p;y=y>>1;x=(x*x)%p;}
return res;}
//__________________________________________
unsigned long long modInverse(unsigned long long n,int p)
{return power(n,p-2,p);}
//_____________________________________________
unsigned long long nc(unsigned long long n,int r,int p)
{if(r==0)
return 1;return(factorial[n]*modInverse(factorial[r],p)%p*modInverse(factorial[n-r],p)%p)%p;}
 int fa[200005];
 int find(int x){if(fa[x]==x)return x;fa[x]=find(fa[x]);return fa[x];}
 int join(int x, int y){
     int a = fa[x];
     int b = fa[y];
     if(a==b)return 0;
     fa[a]=b;
     return 1;
}

void deb(int x , string s){
    cout<<x<<" "<<s<<nl;
}
int range(int l,int r, vi &b){
    return upper_bound(b.begin()+1,b.end(),r) - lower_bound(b.begin()+1,b.end(),l);
}

ll N = mod2;
 
ll mod1(ll n) {return (n % N + N) % N; }
ll modM(ll n, ll m) { return ((n % N * m % N) + N) % N; }
ll modA(ll n, ll m) { return ((n % N + m % N) + N) % N; }
ll modS(ll n, ll m) { return ((n % N - m % N) + N) % N; }



ll dir[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};

/*  */
struct element{
    ll p,q,c;
};

bool com(element x , element y){
    if(x.p == y.p){
        return x.q < y.q;
    }
    else{
        return x.p < y.p;
    }

}
ll lcm(ll a,ll b){
    return (a/gcd(a,b))*b;
}
    bool prime[1000004];
    ll spf[1000004];

void SieveOfEratosthenes(int n) 
{
    fo(i,1000003){
        prime[i]=true;
    }
    for (int p=2; p*p<=n; p++) 
    { 
        if (prime[p] == true) 
        {
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
  
    
} 

void build_spf() 
{ 
    fo(i,1000003){
        spf[i]=i;
    }
    for (int p=2; p*p<=1000003; p++) 
    { 
      if(spf[p]==p){
          for(int j = 2*p ;j<=1000003;j+=p){
              spf[j]=p;
          }
      }  
    } 
  
    
} 
/* const int no = 2e5+5;
bitset<no> b;
unordered_map<int,bool> g[no];
void dfs(int u){
    b[u]=0;
    for(auto i = b._Find_first();i<b.size();i= b._Find_next(i)){
        if(g[u][i]==0){
            dfs(i);
        }
    }
} */



int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE 
    freopen("input.txt", "r", stdin); 
    freopen("output.txt", "w", stdout); 
    #endif
    int T=1;
/*         factorial[0] = 1; 
for (int i = 1; i <= 2000004; i++) {
    factorial[i] = (factorial[i - 1] * i) % mod2; 
} */
    cin>>T;
    //SieveOfEratosthenes(1000001);
   // Google,FB cout << "Case #"<< T + 1 << ": ";
    while(T--){
        int n,m;
        cin>>n>>m;
        string s[n+1];
        fo(i,n){
            cin>>s[i];
            s[i] = "%"+s[i];
        }
        if(m&1){
            int k = (m+1)/2;
            YES;
            fo(i,k){
                cout<<"1 2"<<" ";
            }
            cout<<nl;
        }
        else{
            int i1=-1,j1=-1;
            int f=0;
            for(int i=1;i<=n;i++){
                for(int j=i+1;j<=n;j++){
                    if(s[i][j]==s[j][i]){
                        i1=i;
                        j1=j;
                        f=1;
                        break;
                    }
                }
            }
            if(f){
                YES;
                cout<<i1<<" ";
                fo(i,m/2){
                    cout<<j1<<" "<<i1<<" ";
                }
                cout<<nl;
            }
            else{
                if(n==2){
                    NO;
                }
                else{
                int k1;
                int q=0;
                for(int i=1;i<=n;i++){
                    set<int> a,b;
                    for(int j=1;j<=n;j++){
                        if(s[i][j]=='a'){
                            a.insert(j);
                        }
                        if(s[i][j]=='b'){
                            b.insert(j);
                        }
                        if(!a.empty()&& !b.empty()){
                            i1 = i;
                            j1 = *a.begin();
                            k1 = *b.begin();
                            q=1;
                            break;
                        }
                    }
                    if(q){
                        break;
                    }
                }
                YES;
                int h = m/2;
                if(h&1){
                    fo(i,(h+1)/2){
                        cout<<j1<<" "<<i1<<" ";
                    }
                    fo(i,h){
                        if(i&1){
                            cout<<k1<<" ";
                        }
                        else{
                            cout<<i1<<" ";
                        }
                    }
                    cout<<nl;
                }
                else{
                    cout<<i1<<" ";
                    fo(i,h/2){
                        cout<<j1<<" "<<i1<<" ";
                    }
                    fo(i,h/2){
                        cout<<k1<<" "<<i1<<" ";
                    }
                    cout<<nl;
                }
                }

            }
        }

    
    }








    

    
       
    return 0;
}



ll gcd(ll a, ll b) {
    if (b == 0)
        return a;
    else
        return gcd (b, a % b);
}



    /*factorial[0] = 1; 
for (int i = 1; i <= 100004; i++) {
    factorial[i] = (factorial[i - 1] * i) % mod; 
}*/
/* ull modmul(ull a, ull b, ull M) {
	ll ret = a * b - M * ull(1.L / M * a * b);
	return ret + M * (ret < 0) - M * (ret >= (ll)M);
}
ull modpow(ull b, ull e, ull m) {
	ull ans = 1;
	for (; e; b = modmul(b, b, m), e /= 2)
		if (e & 1) ans = modmul(ans, b, m);
	return ans;
}
 
bool isPrime(ull n) {
	if (n < 2 || n % 6 % 4 != 1) return (n | 1) == 3;
	ull A[] = {2, 325, 9375, 28178, 450775, 9780504, 1795265022},
	    s = __builtin_ctzll(n-1), d = n >> s;
	for (ull a : A) {   // ^ count trailing zeroes
		ull p = modpow(a%n, d, n), i = s;
		while (p != 1 && p != n - 1 && a % n && i--)
			p = modmul(p, p, n);
		if (p != n-1 && i != s) return 0;
	}
	return 1;
} */