#include <vector>
#include <iostream>

using namespace std;

void inizia(int N, vector<int> T, vector<int> X) {
    return;
}

void modifica(int p, int t, int x) {
    return;
}

long long debugga(int l, int r) {
    return -1;
}

// GRADER DI ESEMPIO
// NON MODIFICARE AL DI SOTTO DI QUESTA LINEA

#ifndef EVAL
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);

    int N, Q;
    cin >> N >> Q;

    vector<int> T(N), X(N);

    for(int i=0; i<N; i++)
        cin >> T[i] >> X[i];

    inizia(N, T, X);

    for(int i=0; i<Q; i++) {
        int type; cin >> type;

        if(type == 0) {
            int p, t, x;
            cin >> p >> t >> x;
            modifica(p, t, x);
        } else {
            int l, r;
            cin >> l >> r;
            cout << debugga(l, r) << "\n";
        }
    }
}
#endif
