#include #define rep(i,n) for(int i=0;i ; const int INF = 1e9; const int MOD = 1000000007; int prime(int x){ int res; int now = x+1; while(1){ bool ok = true; for(int i=2;i*i<=now;i++){ if(now%i == 0){ ok = false; break; } } if(ok){ res = now; break; }else{ now ++; } } return res; } int x_p = 30000,y_p = 30000; vector> maze(x_p+1,vector(y_p+1,false)); vector> seen(x_p+1,vector(y_p+1,false)); bool dfs(int i,int j){ if(seen[i][j]) return maze[i][j]; seen[i][j] = true; if(i==x_p-1 && j==y_p-1) return maze[i][j] = false; if(i==x_p || j==y_p) return maze[i][j] = true; bool res = !dfs(i+1,j) || !dfs(i,j+1); return maze[i][j] = res; } int main(){ int x,y; cin >> x >> y; x_p = prime(x) - x; y_p = prime(y) - y; cout << ( dfs(0,0) ? "First" : "Second" ) << endl; rep(i,x_p+1){ rep(j,y_p+1) cout << (maze[i][j] ? "Y" : "N") << " "; cout << endl; } return 0; }