#include<bits/stdc++.h>

std::vector<int> getVisionPattern1d(){
    std::vector<int> v;
    v.push_back(1);
    v.push_back(2);
    v.push_back(1);
    v.push_back(3);
    v.push_back(1);

    return v;
}

int getMove1d(std::vector<int> v){
    if(v.size()==3){
        if(v[0]==2)return 0;
        if(v[2]==2)return 2;
        if(v[0]==3)return 2;
        if(v[2]==3)return 0;
    }
    if(v.size()==5){
        if(v[0]==3)return 0;
        if(v[4]==3)return 4;
    }
    if(v.size()==7){
        if(v[0]==2)return 0;
        if(v[6]==2)return 6;
    }
}

std::vector<std::vector<int>> getVisionPattern2d(){
    std::vector<std::vector<int>> ans;
    std::vector<int> temp;
    temp.push_back(3);
    temp.push_back(4);
    ans.push_back(temp);
    temp.clear();
    temp.push_back(1);
    temp.push_back(2);
    ans.push_back(temp);
    return ans;
}

std::pair<int, int> getMove2d(std::vector<std::vector<int>> v){
    if(v.size()==3){
            if(v[0][0]==4)return {0,0};
            if(v[2][0]==4)return {2,0};
            if(v[0][2]==4)return {0,2};
            if(v[2][2]==4)return {2,2};
    }
    if(v.size()==5){
            if(v[1][1]==4)return {1,1};
            if(v[3][1]==4)return {3,1};
            if(v[1][3]==4)return {1,3};
            if(v[3][3]==4)return {3,3};
    }
    if(v.size()==7){
            if(v[2][2]==4)return {2,2};
            if(v[4][2]==4)return {4,2};
            if(v[2][4]==4)return {2,4};
            if(v[4][4]==4)return {4,4};
    }
    if(v.size()==9){
            if(v[3][3]==1)return {7,7};
            if(v[5][3]==1)return {0,7};
            if(v[3][5]==1)return {7,0};
            if(v[5][5]==1)return {0,0};
    }    return {0,0};
}