public static void main(String[] unused) {
        Machine M;
        BufferedReader input =
            new BufferedReader(new InputStreamReader(System.in));

        M = null;
        boolean firstline = true;

        try {
            while (true) {
                String line = input.readLine();
                if (line == null) {
                    break;
                }
                if (firstline) {
                    String[] firstinput = line.split(" ");
                    if (!firstinput[0].equals("*")) {
                        System.exit(1);
                    }
                    firstline = false;
                }
                if (isConfigurationLine(line)) {
                    M = new Machine();
                    configure(M, line);
                } else {
                    printMessageLine(M.convert(standardize(line)));
                }
            }
        } catch (IOException excp) {
            System.err.printf("Input error: %s%n", excp.getMessage());
            System.exit(1);
        }
    }