#include using namespace std; const int N=11; char s[N][N]; int t,n,v[N][N]; int dfs1(int x,int y){ if(s[x][y]=='#'||v[x][y])return 0; v[x][y]=1;v[n-1][n-1]=v[0][0]=0; if(!x&&!y)return 1; if(x)if(dfs1(x-1,y))return 1; if(y)if(dfs1(x,y-1))return 1; return 0; } int dfs2(int x,int y){ if(s[x][y]=='#'||v[x][y])return 0; v[x][y]=1; if(!x&&!y)return 1; if(y)if(dfs1(x-1,y))return 1; if(x)if(dfs1(x,y-1))return 1; return 0; } int main(){ for(cin>>t;t;t--){ memset(v,0,sizeof(v)); scanf("%d",&n); for(int i=0;i