{$q+,r+}
uses
    SysUtils;

const
    n = 30;
var
    f: array [-1..n] of boolean;
    pos: longint;
    first: boolean;
    l: longint;
procedure output();
var
    i: longint;
begin
    for i := 1 to n do begin
        if f[i] then write('x') else write('.');
    end;
    writeln;
end;

procedure generateRandom();
var
    i: longint;
begin
    fillchar(f, sizeof(f), 0);
    for i := 1 to n do begin
        f[i] := not (f[i - 1] and f[i - 2]) and (random > 0.5);
    end;
end;

procedure addFeature(z, l: longint);
var
    i: longint;
begin
    if z - 1 >= 1 then begin
        f[z - 1] := false;
    end;
    if z + l <= n then begin
        f[z + l] := false;
    end;
    for i := z to z + l - 1 do begin
        f[i] := true;
    end;
end;

procedure setWin(z, l: longint; first: boolean);
var
    i: longint;
    q: boolean;
begin
    q := false;
    for i := 1 to n do begin
        q := q xor f[i];
    end;
    if q <> first then begin
        repeat
            i := random(n) + 1;
        until ((i < z - 1) or (i > z + l)) and f[i];
        f[i] := false;
    end;
end;

var
    z: longint;
    i, j: longint;
begin
    randseed := 345435;
    z := 0;
    for pos := -1 to 1 do begin
        for first := false to true do begin
            for l := 3 to 6 do begin
                generateRandom();
                case pos of
                     1: z := n - l + 1;
                     0: z := 2 + random(n - l - 2);
                    -1: z := 1;
                end;
                addFeature(z, l);
                setWin(z, l, first);
                output();
            end;
            generateRandom();
            setWin(-1, 0, first);
        end;
    end;
    for i := 2 to 5 do begin
        generateRandom();
        for j := 1 to i do begin
            l := 3 + random(3);
            z := 1 + random(n - l - 1);
            addFeature(z, l);
        end;
        output();
        generateRandom();
        for j := 1 to i do begin
            l := 3 + random(3);
            z := 1 + random(n - l - 1);
            addFeature(z, l);
        end;
        output();
    end;
end.
