public class Solution {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        HashMap<Integer,String> map = new HashMap<Integer, String>();
        while(true)
        {
            String t = reader.readLine();
            if(t.equals("")) {break;}
            int id = Integer.parseInt(t);
            t = reader.readLine();
            if(t.equals(""))
            {
                String name = t;
                map.put(id,"");
                break;
            }
            String name = t;
            map.put(id,name);


        }
        for (int k: map.keySet())
        {
            System.out.println(k+" "+map.get(k));
        }
    }
}