#define ll long long

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

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

int getMove1d(vector<int> v)
{
    if(v.size()==3){
        ll l=v[0],r=v[2];

        if(l==3 && r==1) return 0;
        if(l==1 && r==3) return 2;

        if(l==3 && r==2) return 0;
        if(l==3 && r==2) return 2;

        if(l==1 && r==2) return 2;
        if(l==2 && r==1) return 0;

        if(l==1 && r==1) return 0;
    }
    if(v.size()==5){
        ll l=v[0],r=v[4];

        if(r==3) return 4;
        else return 0;
    }
    if(v.size()==7){
        ll l=v[0],r=v[6];

        if(v[1]==2) return 6;
        else return 0;
    }
}

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

pair<int, int> getMove2d(vector<vector<int>> v)
{
    vector<ll> g={0,5,6,4,8,9,7,2,3,1};
    ll c=v.size()/2;
    ll d=v.size()-1;
    ll tg=g[c];

    if(v[0][0]==tg) return {0,0};
    if(v[0][d]==tg) return {0,d};
    if(v[d][0]==tg) return {d,0};
    if(v[d][d]==tg) return {d,d};
}
