#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int n, q;
    cin >> n >> q;
    while(q--){
        int tip, a, b;
        char c;
        cin >>tip >> a >> b;
        if(tip == 1){
            cin >> c;
        }
        else if(tip == 2){
            cout<< "1" <<endl;
        }
    }
    return 0;

}