#include using namespace std; using Int=long long; using Real=long double; templateinline bool chmin(T&A,S B){if(A>B){A=B;return true;}else{return false;}} templateinline bool chmax(T&A,S B){if(A>N; REP(i,N)REP(j,N)cin>>S[i][j]; int ans=-1,cnt=0; REP(i,N) { bool ok=true; REP(j,N) { ok&=i==j||S[j][i]=="nyanpass"; } if(ok)ans=i+1,++cnt; } if(cnt>=2)ans=-1; cout<>TE; while(TE--)sol(); }