#include <bits/stdc++.h>
using namespace std;
// vector of pairs
int main()
{
  int n; cin>>n;
  vector<pair<string,int>>v;
  for(int i=0;i<n;i++){
    string s; cin>>s;
    int a; cin>>a;
    v.push_back({s,a});
  }
  for(auto i:v){
    cout<<i.first<<" "<<i.second<<endl;
    }
} 
by