#include<bits/stdc++.h>

#define ll long long
#define begin begin()
#define end end()
#define pb push_back
#define in insert
#define lldef ll N=0,M=0,K=0;
#define mk make_pair

using namespace std;
vector<ll>x={0,1,-1};
vector<ll>y={0,1,-1};
vector<int> getVisionPattern1d(){
}
int getMove1d(vector<int> v){
}
vector<vector<int>> getVisionPattern2d(){
    vector<vector<int>>ANS={{1,1,1},{1,1,1},{3,1,1},{1,1,1},{1,1,2}};
    return ANS;
}
pair<int, int> getMove2d(vector<vector<int>> v){
    ll N=v[0].size();
    ll md=(N-1)/2;
    ll mid=v[md][md];
    if(mid==1){
        for(ll i=0; i<3; i++){
            for(ll j=0; j<3; j++){
                if(v[md+x[i]][md+y[j]]!=1){
                    return mk(md+x[i],md+y[j]);
                }
            }
        }
    }else if(mid==2){
        if(v[md-2][md+1]==3){
            return mk(md-2,md+1);
        }
        if(v[md-2][md-1]==3){
            return mk(md-2,md-1);
        }
        if(v[md+2][md-1]==3){
            return mk(md+2,md-1);
        }
        if(v[md+2][md+1]==3){
            return mk(md+2,md+1);
        }
    }else if (mid==3){
        if(v[md-2][md+2]==2){
            return mk(md+3,md+2);
        }
        if(v[md-2][md-2]==2){
            return mk(md+3,md-2);
        }
        if(v[md+2][md+2]==2){
            return mk(md-3,md+2);
        }
        if(v[md+2][md-2]==2){
            return mk(md-3,md-2);
        }
    }
}