#include "vision.h"
#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <deque>
#include <math.h>
#include <array>
#include <set>
#include <string>
#include <utility>

#define rep(i, s, e) for (ll i = s; i < e; i++)
#define upmax(a, b) a = max(a, b)
#define upmin(a, b) a = min(a, b)

using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;
using vvpll = vector<vpll>;

const ll INF = 1e18;

vector<int> arr = { 3, 1, 1, 1, 2, 1 };

vector<int> getVisionPattern1d() {
    return arr;
}

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

std::vector<std::vector<int>> getVisionPattern2d()
{
    return { {1} };
}

std::pair<int, int> getMove2d(std::vector<std::vector<int>> v)
{
    return { 0, 0 };
}
