#include<bits/stdc++.h> using namespace std; int n,q,oper,i,j,k;//oper操作符 map<int,map<int,int> > a;//"> >"用于防止误判位操作 int main() { cin>>n>>q; while(q--){//重复q次 cin>>oper>>i>>j; if(oper-1) cout<<a[i][j]<<endl;//读 else cin>>k,a[i][j]=k;//存 } return 0; }