#include <algorithm>
#include<iostream>
#include<vector>
#include<deque>
#include<queue>
#include<list>
#include<stack>
#include<map>
#include<set>
#include<string>
#include <sstream>

#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<limits.h>

using namespace std;


int main(){
  long ii,jj,kk,q;
  map<string,int> m;
  int c,x;
  string key;
  //cout << "hoge" << endl;
  cin >> q;


  for(ii=0;ii<q;ii++){
    cin >> c ;
    //cout << c << endl;
    if(c == 0){
      cin >> key >> x;
      //m.insert_or_assign(make_pair(key,x));
      m.erase(key);
      m.insert(make_pair(key,x));
    }
    else if(c==1){
      cin >> key;
      cout << m[key] << endl;
    }
    //cout << key << endl;
  }

  
  return 0;
  
}

