/*
 * This example demonstrates how a Turn Right player can be made
 * Turn Right is the CodeCup game 2006 (www.codecup.nl)
 * The use of this file and/or ideas is not compulsory
 * Left to do: six TODOs
 * Written by Jaap Taal
 * Success and a lot of joy in the contest!
 *
 * Note that this file will compile, but it wil generate Exceptions.
 * You will need to implement some of the TODOs.
 *
 * The other example programs already implement a gameBoard.
 * In this java example you will have to come up with an own implementation
 * of a gameBoard.
 */
import java.io.*;


public class TurnRight {

    private static int WHITE = 1;
    private static int BLACK = 2;

    private boolean meBegins = false;

    public TurnRight() {
        initBoard();
    }

    /**
     * This method inits the gameboard.
     */
    public void initBoard() {
        // TODO: implement this method

    }

    /**
     * This method does the game
     */
    public void doGame() throws IOException {
        BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
        String line;

        // Do first move

        line = stdin.readLine();
        if (line.equals("Start")) {
            meBegins = true;
            System.err.println("I begin");
            System.out.println(myPlace(WHITE));
        } else {
            System.err.println("Opponent begins");
            doPlace(BLACK, line);
        }

        for (int i = 1; i < 35; i++) {
            if ((i % 2) == 0) {
                // Whites move

                if (meBegins) {
                    System.out.println(myPlace(WHITE));
                } else {
                    line = stdin.readLine();
                    doPlace(WHITE, line);
                }
            } else {
                // Blacks move

                if (meBegins) {
                    line = stdin.readLine();
                    doPlace(BLACK, line);
                } else {
                    System.out.println(myPlace(WHITE));
                }
            }
        }

        doLastPlace();

        int n;
        for (int i = 0; i < 26; i++) { 
            n = (i / 2) * 2 + 4;
            if ((i % 2) == 0) {
                // Blacks circuit

                if (meBegins) {
                    line = stdin.readLine();
                    doCircuit(line);
                } else {
                    System.out.println(myCircuit(BLACK, n));
                }
            } else {
                // Whites circuit

                if (meBegins) {
                    System.out.println(myCircuit(WHITE, n));
                } else {
                    line = stdin.readLine();
                    doCircuit(line);
                }
            }
        }
    }

    /**
     * This method makes up a circuit and returns the circuit as a String
     * @param color Your color
     * @param maxCorners Maximum number of corners allowed this move
     * @return Your circuit
     */
    public String myCircuit(int color, int maxCorners) {
        String circuit = null;
        // TODO: implement this method

        System.err.println("My circuit(" + maxCorners + "): " + circuit);
        return circuit;
    }

    /**
     * This method processes your opponents circuit
     * @param circuit Your opponents circuit
     */
    public void doCircuit(String circuit) {
        System.err.println("Opponents circuit: " + circuit);
        // TODO: implement this method

    }

    /**
     * This method makes up place-move and returns it as a String
     * @param color Your color
     */
    public String myPlace(int color) {
        String move = null;
        // TODO: implement this method

        System.err.println("My move: " + move);
        return move;
    }

    /**
     * This method processes your opponents place-move
     * @param color Your opponents color
     * @param move Your opponents circuit
     */
    public void doPlace(int color, String move) {
        System.err.println("Opponents move: " + move);
        // TODO: implement this method

    }

    /**
     * This method finds the last open spot on the gameboard and fills it with a black
     * piece
     */
    public void doLastPlace() {
        // TODO: implement this method

        String move = null;
        System.err.println("Blacks last move: " + move);
    }

    /**
     * Main method, calls the doGame method.
     * @throws Exception Let the main method throw all possible exceptions
     */
    public static void main(String[] args) throws Exception {
        TurnRight turnRight = new TurnRight();
        turnRight.doGame();
    }
}


syntax highlighted by Code2HTML, v. 0.9.1