/* Author: Zhikun Wang */ #include #define debug(x) cout<<#x<<'='< void read(T &x){ x = 0;int f = 1;char ch = getchar(); while(!isdigit(ch)){if(ch == '-')f*=-1;ch = getchar();} while(isdigit(ch)){x = x*10+ch-48; ch = getchar();}x*=f; } template void read(T &x,Args&... nxt){ read(x); read(nxt...); } #define rep(i,a,b) for(int i=a;i<(b);++i) #define all(x) begin(x),end(x) #define sz(x) (int)(x).size() typedef long long ll; typedef pair pii; typedef vector vi; int T; char cmp[11][11]; int n; int cvis[11][11],tvis[11][11]; vector V2,V; void dfs(int x,int y){ if(x == n-1 && y == n-1)V = V2; cvis[x][y] = 1; V2.push_back(make_pair(x,y)); if(x>cmp[i]; for(int i=0;i