#include "vision.h"
#include <bits/stdc++.h>
// #include "grader.cpp"

using namespace std;

#define sz(a)  (int)(a).size()

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

int getMove1d(vector<int> v) {
    if (sz(v) == 3) return (v[0] == 2 ? 0 : 2);
    if (sz(v) == 5) return (v[0] == 1 ? 0 : 4);
    return 1;
}

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

pair<int, int> getMove2d(vector<vector<int>> v) {
    if (sz(v) == 3) {
        for (auto i : {0, 2}) {
            for (auto j : {0, 2}) {
                if (v[i][j] == 2) return {i, j};
            }
        }
        
        assert(false);
    }
    if (sz(v) == 5) {
        for (auto i : {0, 4}) {
            for (auto j : {0, 4}) {
                if (v[i][j] == 1) return {i, j};
            }
        }
    
        assert(false);
    }

    assert(v[1][1] == 1);
    return {1, 1};
}