#include<bits/stdc++.h> using namespace std; map<int,int> a[10003]; int main(){ int m,n; cin>>m>>n; while(n--){ int x,i,j,k; cin>>x; if(x==1){ cin>>i>>j>>k; a[i][j]=k; }else{ cin>>i>>j; cout<<a[i][j]<<endl; } } return 0; }