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));
}
}
}
package com.codegym.task.task10.task1019;
import java.io.*;
import java.util.HashMap;
/*
Functionality is not enough!
*/
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));
}
}
}