#include<iostream>
#include<vector>
using namespace std;
vector<int> getVisionPattern1d(){
    vector <int> arr;
    arr.push_back(1);
    arr.push_back(2);
    arr.push_back(1);
    arr.push_back(1);
    arr.push_back(3);

    return arr;
}
int getMove1d(vector<int> v){
    int s = v.size();
    if(s == 3){
        if(v[0] == 3 || v[2] == 3){
            if(v[0] == 2 || v[0] == 2){
                if(v[0] == 3){
                    return 2;
                }else{
                    return 0;
                }
            }else{
                if(v[0] == 1){
                    return 2;
                }else{
                    return 0;
                }
            }
        }else{
            if(v[0] == 2){
                return 2;
            }else{
                return 0;
            }
        }
    }
    if(s == 5){
        if(v[0] == 3){
            return 3;
        }else{
            return 1;
        }
    }
    if(s == 7){
        if(v[0] == 2){
            return 4;
        }else{
            return 2;
        }
    }
}
vector<vector<int>> getVisionPattern2d(){

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

}