import java.io.*;

class LineInputStream extends FilterInputStream {

    public LineInputStream(InputStream in) {
	super(in);
    }

    String readLine() throws IOException {
	StringBuffer buf = new StringBuffer(80); // buffer to hold typical line

	int ch;
	while ((ch = in.read()) != -1) {
	    if (ch == '\n')
		return buf.toString();
	    else
		buf.append((char) ch);
	}

	if (buf.length() > 0)	// if we got something before EOF, return it
	    return buf.toString();

	throw new EOFException();
    }
}
