//#include <bits\stdc++.h>
#include <vector>

using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pi;
typedef long long ll;
typedef vector<pi> vpi;
#define x first
#define y second

vi getVisionPattern1d()
{
    return {2,2,1,2,1,1};
}

int getMove1d(vi v)
{
    int n = v.size();
    if(n==3){
        if(v[0]==2)
            return 0;
        return 2;
    }
    if(v[1]==2 && v[4]==2)
        return 4;
    if(v[1]==2)
        return 0;
    if(v[3]==2 && v[0]==2)
        return 0;
    if(v[3]==2)
        return 4;
    if(v[4]==1)
        return 4;
    return 0;
}

vvi getVisionPattern2d()
{
    return {{1}};
}

pi getMove2d(vvi v)
{
    return {0,0};
}