#include <iostream>
#include <string>

using namespace std;

int main()
{
    int n,q,p1,p2,p3;
    string rly;
    cin >> n >> q;
    for(int i=0;i<q;i++){
        cin >> p1 >> p2 >> p3;
        if(p1==1){
            cin >> rly;
        }
        else{
            cout << 1 << endl;
        }
    }
    return 0;
}