传送门
#include <bits/stdc++.h>
using namespace std;
struct Node{
long long ge[1000005];
}a[100005];
int main(){
long long n, q;
cin >> n >> q;
for (int i = 1; i <= q; i++){
long long x, ii, jj, kk;
cin >> x;
if(x == 1){
cin >> ii >> jj >> kk;
a[ii].ge[jj] = kk;
}else if(x == 2){
cin >> ii >> jj;
cout << a[ii].ge[jj] << endl;
}
}
return 0;
}