while (sc.hasNextLine()) { // EOF 처리
String N = sc.nextLine().trim();
if (N.isEmpty())
break; // 빈 문자열일 경우 종료
System.out.println(n);
}
String line = null;
while ((line = br.readLine()) != null) {
int n = Integer.parseInt(line);
System.out.println(n);
}