#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define srep(i,s,t) for(int i=(int)(s);i<(int)(t);++i)
#define each(a,b) for(auto& (a): (b))
#define all(v) (v).begin(),(v).end()
#define len(v) (int)(v).size()
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end())
#define cmx(x,y) x=max(x,y)
#define cmn(x,y) x=min(x,y)
#define fi first
#define se second
#define pb push_back
#define show(x) cout<<#x<<" = "<<(x)<<endl
#define sar(a,n) {cout<<#a<<":";rep(pachico,n)cout<<" "<<a[pachico];cout<<endl;}

using namespace std;

template<typename S,typename T>auto&operator<<(ostream&o,pair<S,T>p){return o<<"{"<<p.fi<<","<<p.se<<"}";}
template<typename T>auto&operator<<(ostream&o,set<T>s){for(auto&e:s)o<<e<<" ";return o;}
template<typename S,typename T,typename U>
auto&operator<<(ostream&o,priority_queue<S,T,U>q){while(!q.empty())o<<q.top()<<" ",q.pop();return o;}
template<typename K,typename T>auto&operator<<(ostream&o,map<K,T>&m){for(auto&e:m)o<<e<<" ";return o;}
template<typename T>auto&operator<<(ostream&o,vector<T>v){for(auto&e:v)o<<e<<" ";return o;}
void ashow(){cout<<endl;}template<typename T,typename...A>void ashow(T t,A...a){cout<<t<<" ";ashow(a...);}
template<typename S,typename T,typename U>
struct TRI{S fi;T se;U th;TRI(){}TRI(S f,T s,U t):fi(f),se(s),th(t){}
bool operator<(const TRI&_)const{return(fi==_.fi)?((se==_.se)?(th<_.th):(se<_.se)):(fi<_.fi);}};
template<typename S,typename T,typename U>
auto&operator<<(ostream&o,TRI<S,T,U>&t){return o<<"{"<<t.fi<<","<<t.se<<","<<t.th<<"}";}

typedef pair<int, int> P;
typedef pair<ll, ll> pll;
typedef TRI<int, int, int> tri;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<P> vp;
typedef vector<double> vd;
typedef vector<string> vs;

const int MAX_N = 100005;

template<class _Key, class _Tp, class _Hash> class UnorderedMapIterator;

template<class _Key, class _Tp, class _Hash = hash<_Key> >
class UnorderedMap
{
private:
    using iterator = UnorderedMapIterator<_Key, _Tp, _Hash>;
    using value_type = pair<const _Key, _Tp>;
    friend UnorderedMapIterator<_Key, _Tp, _Hash>;
    struct bucket {
        unsigned int hash;
        int dist;
        bool last, end;
        value_type *data_ptr;
        bucket() : dist(-1), last(false), end(false), data_ptr(nullptr){}
        ~bucket(){ if(!empty()) delete data_ptr; }
        inline void clear(){ if(!empty()){ dist = -1; delete data_ptr; } }
        inline bool empty() const noexcept { return (dist == -1); }
        inline const _Key& get_key() const noexcept { return data_ptr->first; }
    };
    inline static unsigned int ceilpow2(unsigned int u){
        --u, u |= u >> 1, u |= u >> 2, u |= u >> 4, u |= u >> 8;
        return (u | (u >> 16)) + 1;
    }
    inline static bucket *increment(bucket *cur) noexcept {
        for(++cur; !cur->end; ++cur){
            if(!cur->empty()) return cur;
        }
        return cur;
    }
    inline bucket *next_bucket(bucket*& cur) noexcept {
        return cur->last ? _buckets : cur + 1;
    }
    inline unsigned int make_hash(const _Key& _key) const noexcept {
        return rand1 ^ (_Hash()(_key) + rand2);
    }
    inline float load_factor() const noexcept {
        return (float)_data_count / _bucket_count;
    }
    inline void make_random_number(){
        rand1 = rand(), rand2 = 0x9e3779b9 + (rand1 << 6) + (rand1 >> 2);
    }
    bucket *insert_impl(bucket *cur, unsigned int hash, int dist, value_type* data_ptr){
        bucket *ret = cur;
        bool _swap = false;
        while(true){
            if(cur->empty()){
                cur->hash = hash, cur->dist = dist, cur->data_ptr = data_ptr;
                if(!_swap) ret = cur, _swap = true;
                break;
            }else if(dist > cur->dist){
                swap(hash, cur->hash), swap(dist, cur->dist), swap(data_ptr, cur->data_ptr);
                if(!_swap) ret = cur, _swap = true;
            }
            ++dist;
            cur = next_bucket(cur);
        }
        return ret;
    }
    bucket *_find(const _Key& _key, bool push=false){
        unsigned int hash = make_hash(_key);
        bucket *cur = _buckets + (hash & _mask);
        int dist = 0;
        while(dist < (int)_bucket_count && dist <= cur->dist){
            if(dist == cur->dist && hash == cur->hash && _key == cur->get_key()){
                return cur;
            }
            ++dist;
            cur = next_bucket(cur);
        }
        if(!push) return _buckets + _bucket_count;
        ++_data_count;
        if(rehash_check()){
            hash = make_hash(_key), cur = _buckets + (hash & _mask), dist = 0;
        }
        return insert_impl(cur, hash, dist, new value_type(_key, _Tp()));
    }
    bucket *_insert(const _Key& _key, const _Tp& _value){
        ++_data_count;
        rehash_check();
        unsigned int hash = make_hash(_key);
        return insert_impl(_buckets + (hash & _mask), hash, 0, new value_type(_key, _value));
    }
    bucket *backward_shift(bucket *cur){
        bucket *next = next_bucket(cur), *ret = cur;
        if(next->dist < 1) return increment(cur);
        do {
            cur->data_ptr = next->data_ptr;
            cur->dist = next->dist - 1;
            cur->hash = next->hash;
            cur = next;
            next = next_bucket(cur);
        }while(next->dist >= 1);
        cur->dist = -1;
        return ret;
    }
    bucket *erase_impl(bucket *cur){
        cur->clear();
        return backward_shift(cur);
    }
    bucket *_erase(const _Key& _key){
        --_data_count;
        unsigned int hash = make_hash(_key);
        bucket *cur = _buckets + (hash & _mask);
        int dist = 0;
        while(dist < (int)_bucket_count && dist <= cur->dist){
            if(dist == cur->dist && hash == cur->hash && _key == cur->get_key()){
                return erase_impl(cur);
            }
            ++dist;
            cur = next_bucket(cur);
        }
        assert(false);
    }
    bool rehash_check(){
        if(load_factor() >= MAX_LOAD_FACTOR){
            rehash();
            return true;
        }else{
            return false;
        }
    }
    void move_data(value_type* cur_data_ptr){
        unsigned int hash = make_hash(cur_data_ptr->first);
        insert_impl(_buckets + (hash & _mask), hash, 0, cur_data_ptr);
    }
    void rehash(){
        // show("REHASH");
        UnorderedMap new_unordered_map(_bucket_count * 2);
        new_unordered_map._data_count = _data_count;
        for(bucket *cur = _buckets; !cur->end; ++cur){
            if(!cur->empty()){
                new_unordered_map.move_data(cur->data_ptr);
                cur->dist = -1;
            }
        }
        swap(*this, new_unordered_map);
    }
    friend void swap(UnorderedMap& ump1, UnorderedMap& ump2){
        swap(ump1._bucket_count, ump2._bucket_count);
        swap(ump1._mask, ump2._mask);
        swap(ump1._data_count, ump2._data_count);
        swap(ump1.rand1, ump2.rand1);
        swap(ump1.rand2, ump2.rand2);
        swap(ump1._buckets, ump2._buckets);
    }

private:
    unsigned int _bucket_count, _mask, _data_count, rand1, rand2;
    bucket *_buckets;
public:
    static constexpr float MAX_LOAD_FACTOR = 0.9f;
    UnorderedMap(unsigned int bucket_size = 1u)
     : _bucket_count(ceilpow2(max(bucket_size, 1u))), _mask(_bucket_count - 1),
        _data_count(0u), _buckets(new bucket[_bucket_count + 1]){
        _buckets[_bucket_count - 1].last = true, _buckets[_bucket_count].end = true;
        make_random_number();
    }
    ~UnorderedMap(){ delete[] _buckets; }
    _Tp& operator[](const _Key& _key) noexcept {
        return _find(_key, true)->data_ptr->second;
    }
    const _Tp& at(const _Key& _key){
        bucket *res = _find(_key);
        if(res == _buckets + _bucket_count) __throw_out_of_range(__N("Unordered_Map::at"));
        return res->data_ptr->second;
    }
    void clear(){
        UnorderedMap new_unordered_map(1u);
        swap(*this, new_unordered_map);
    }
    size_t size(){ return _data_count; }
    size_t bucket_count(){ return _bucket_count; }
    bool empty(){ return (_data_count == 0); }
    iterator begin(){ return _buckets->empty() ? iterator(increment(_buckets)) : iterator(_buckets); }
    iterator end(){ return iterator(_buckets + _bucket_count); }
    iterator find(const _Key& _key) noexcept { return iterator(_find(_key)); }
    iterator insert(const _Key& _key, const _Tp& _value) noexcept {
        return iterator(_insert(_key, _value));
    }
    iterator erase(const _Key& _key){ return iterator(_erase(_key)); }
    iterator erase(const iterator& itr){ return iterator(erase_impl(itr.bucket_ptr)); }
};

template<class _Key, class _Tp, class _Hash>
class UnorderedMapIterator {
private:
    friend UnorderedMap<_Key, _Tp, _Hash>;
    typename UnorderedMap<_Key, _Tp, _Hash>::bucket *bucket_ptr;
    using iterator_category = forward_iterator_tag;
    using value_type = pair<const _Key, _Tp>;
    using difference_type = std::ptrdiff_t;
    using pointer = pair<const _Key, _Tp>*;
    using reference = pair<const _Key, _Tp>&;

private:
    UnorderedMapIterator(typename UnorderedMap<_Key, _Tp, _Hash>::bucket *_bucket_ptr)
        noexcept : bucket_ptr(_bucket_ptr){}
public:
    UnorderedMapIterator() noexcept : bucket_ptr(){}
    UnorderedMapIterator(const UnorderedMapIterator& itr) noexcept : bucket_ptr(itr.bucket_ptr){}
    UnorderedMapIterator& operator=(const UnorderedMapIterator& itr)
        & noexcept { return bucket_ptr = itr.bucket_ptr, *this; }
    UnorderedMapIterator& operator=(const UnorderedMapIterator&& itr)
        & noexcept { return bucket_ptr = itr.bucket_ptr, *this; }
    reference operator*() const { return *bucket_ptr->data_ptr; }
    pointer operator->() const { return bucket_ptr->data_ptr; }
    UnorderedMapIterator& operator++() noexcept {
        return bucket_ptr = UnorderedMap<_Key, _Tp, _Hash>::increment(bucket_ptr), *this;
    }
    UnorderedMapIterator operator++(int) const noexcept {
        return UnorderedMapIterator(UnorderedMap<_Key, _Tp, _Hash>::increment(this->bucket_ptr));
    }
    bool operator==(const UnorderedMapIterator& itr) const noexcept { return !(*this != itr); };
    bool operator!=(const UnorderedMapIterator& itr) const noexcept { return bucket_ptr != itr.bucket_ptr; }
};

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    UnorderedMap<string, int> ump;
    int a, c;
    string b;
    rep(i,n){
        // show(i);
        cin >> a;
        if(a == 0){
            cin >> b >> c;
            ump[b] = c;
        }else{
            cin >> b;
            cout << ump[b] << "\n";
        }
        // for(auto it : ump){
        //     show(it);
        // }
    }
    return 0;
}



Measured memory_bytes: 25528