#include <iostream>
#include <algorithm>
#include <queue>
#include <map>
#include <set>

#include<bits/stdc++.h>
using namespace std;


vector<int> getVisionPattern1d() {
    return {1};
}

int getMove1d(vector<int> v) {
    return {0};
}


vector<vector<int>> getVisionPattern2d()
{
    return {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
}

pair<int, int> getMove2d(vector<vector<int>> v) {
    int n = v.size() / 2;
    vector<int> g = {5, 6, 4, 8, 9, 7, 2, 3, 1};
    int z = g[v[n][n] - 1];
    for (auto &[dx, dy] : vector<pair<int, int>>{{-1, -1}, {-1, 1}, {1, -1}, {1, 1}}) {
        int x = n + dx;
        int y = n + dy;
        if (v[x][y] == z) {
            return {x, y};
        }
    }
}