Author: Andrey Bogdanov
Draw a single continuous loop in the grid using horizontal and vertical line segments so that the loop visits every cells with circles, other cells may remain unvisited. It should not cross or overlap itself. Between two consecutively visited circles of the same color, the loop must not turn. Between two consecutively visited circles of different colors, the loop must turn exactly once.
Grid control: To draw a line press the mouse button at a start cell and move mouse to another cell holding the button. More details about grid control are at the help page.