``` #include<bits/stdc++.h> using namespace std; int main() { srand(time(0)); int board[15][15] = {}; constexpr int dirs[5] = {0, 1, 0, -1, 0}; while (1) { for (int i = 0; i < 15; i++) { for (int j = 0; j < 15; j++) { cin >> board[i][j]; cin.ignore(); } } int choices[250][2]; int cnt = 0; for (int i = 0; i < 15; i++) { for (int j = 0; j < 15; j++) { if(board[i][j]==-1)continue; bool good = false; for(int d=0; d<4; ++d) { int x = i+dirs[d], y = j + dirs[d+1]; if(x>=0 && x<15 && y>=0 && y<15 && board[i][j]==board[x][y]) good = true; } if(good) { choices[cnt][0] = i; choices[cnt][1] = j; cnt += 1; } } } int ind = rand() % cnt; cout << choices[ind][1] << ' ' << 14 - choices[ind][0] << endl; } } ```