#include <bits/stdc++.h>

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

int getMove1d(std::vector<int> v) {
    if (v.size() == 3) {
        if (v[0] == 2) {
            return 0;
        }

        return 2;
    }

    if (v[1] == 2) {
        if (v[4] == 2) {
            return 4;
        } else {
            return 1;
        }
    }
    if (v[3] == 2) {
        if (v[0] == 2) {
            return 0;
        }
        return 3;
    }

    if (v[0] == 2) {
        return 4;
    }

    return 0;
};

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

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