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

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

int getMove1d(vector<int> v)
{
    int n = v.size() / 2;
    if (n == 1)
    {
        if (v[0] == 1 && v[2] == 3) return 0;
        if (v[0] == 1 && v[2] == 2) return 2;
        if (v[0] == 2 && v[2] == 1) return 0;
        if (v[0] == 2 && v[2] == 3) return 2;
        if (v[0] == 3 && v[2] == 2) return 0;
        if (v[0] == 3 && v[2] == 1) return 2;
    }
    if (n == 2)
    {
        for (int i = 0; i < 5; i++) if (v[i] == 3) return i;
    }
    if (n == 3)
    {
        if (v[n-2] == 2) return n+1;
        return n-1;
    }
    return -1;
}


vector<vector<int>> getVisionPattern2d()
{ return {{}}; }

pair<int, int> getMove2d(vector<vector<int>> v)
{}