#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<numeric>
#include<functional>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#include<queue>

using namespace std;

//#define int long long
#define pii pair<int, int>
#define ll long long

#define ve vector
#define vi ve<int>
#define vvi ve<vi>
#define tiii tuple<ll, ll, ll>
#define tiiii tuple<int, int, int, int>
#define chmin(a, b) a = min(a, b)
#define chmax(a, b) a= max(a, b)
#define all(a) a.begin(), a.end()
#define for0(i, n) for(int i= 0; i < n; ++i)
#define pll pair<ll, ll>

vector<int> getVisionPattern1d() {
    return vi{ 1, 1, 2, 3 };
}
int getMove1d(vector<int> v) {
    if (v[v.size() / 2] == 1) return (v[0] != 1 ? 0 : 2);
    else if (v[v.size() / 2] == 2) {
        int i = -1;
        for (int j = 0; j < v.size(); ++j) if (v[j] == 3) i = j;
        return i;
    }
    else return (v[0] == 1 ? 6 : 0);
}