{$i exp.inc}

var
    n, i, c, d: int;

begin
    n := strtoint(paramstr(1));
    c := strtoint(paramstr(2));    
    d := strtoint(paramstr(3));

    writeln(n);
    if (d = 0) then begin
        for i := 1 to n - 1 do
            writeln(iLetter[c], ' 0');
        write(iLetter[c], ' ', n - 1);
        for i := 1 to n - 1 do
            write(' ', i);
        writeln;
    end
    else begin
        writeln(iLetter[c], ' 0');
        for i := 2 to n do begin
            writeln(iLetter[c], ' 1 1');
        end;
    end;
end.