import java.io.IOException;

public class IOExceptionTest {
  
  public static void main(String[] args) {
    
    int num = 0;
    
    num = System.in.read(); // comment out this line
    
    try {
      num = System.in.read();
      System.out.println("You entered " + (char) num);
    }
    catch (IOException e) {
      System.out.println("IO Exception occurred");
    }
  } 
}