import java.util.*; import java.io.*; public class IO { public IO () { Scanner s = new Scanner(System.in); String str = "a"; BufferedWriter bw = null; try { bw = new BufferedWriter(new FileWriter("out.txt")); } catch (IOException ioe) { ioe.printStackTrace(); } while (!str.equals("")) { str = s.nextLine(); if (!str.equals("")) { try { bw.write(str); bw.newLine(); } catch (IOException ioe) { ioe.printStackTrace(); } } } try { bw.close(); } catch (IOException ioe) { ioe.printStackTrace(); } } public static void main (String args[]) { new IO(); } }