import java.io.*;

public class Console {
    public static void print(int what)     { System.out.print(what); }
    public static void print(double what)  { System.out.print(what); }
    public static void print(char what)    { System.out.print(what); }
    public static void print(boolean what) { System.out.print(what); }
    public static void print(String what)  { System.out.print(what); }

    public static void println(int what)     { System.out.println(what); }
    public static void println(double what)  { System.out.println(what); }
    public static void println(char what)    { System.out.println(what); }
    public static void println(boolean what) { System.out.println(what); }
    public static void println(String what)  { System.out.println(what); }

    // read a single character
    protected static char getRawChar() {
        try {
            return (char) System.in.read();
        } catch(IOException e) {
            return '\0';
        }
    }

    // read in a string with no spaces
    protected static String getRawToken() {
        // skip initial spaces
        char ch; // charact
        ch = getRawChar();
        while(ch != '\0' && Character.isWhitespace(ch)) {
            ch = getRawChar();
        }

        // everything until the next space is part of the token
        StringBuffer ret = new StringBuffer();
        while(ch != '\0' && !Character.isWhitespace(ch)) {
            ret.append(ch);
            ch = getRawChar();
        }
        return new String(ret);
    }

    public static int readInt() {
        try {
            return Integer.parseInt(getRawToken());
        } catch(NumberFormatException e) {
            return Integer.MIN_VALUE;
        }
    }
    public static double readDouble() {
        try {
            return Double.valueOf(getRawToken()).doubleValue();
        } catch(NumberFormatException e) {
            return Double.NEGATIVE_INFINITY;
        }
    }
    public static String readString() { return getRawToken(); }
    public static char readChar() { return getRawChar(); }

    public static boolean readBoolean() {
        // 'y' or 'Y' is true; others are false
        return Character.toUpperCase(getRawChar()) == 'Y';
    }
}
