import java.io.IOException;
import java.io.PrintStream;
import java.util.Iterator;
+import java.util.NoSuchElementException;
public class InputIterator implements Iterable<String> {
private BufferedReader in;
@Override
public String next() {
+ if(!hasNext()) {
+ throw new NoSuchElementException();
+ }
return input;
}