{$i exp.inc}

var
    v: array[1 .. maxn] of int;

var
    n, i: int;
    r: extended;
    j, k, l: int;
begin
    n := strtoint(paramstr(1));    
    r := strtoint(paramstr(2)) / 100;
    randseed := strtoint(paramstr(3));

    writeln(n);
    for i := 1 to n do begin
        write(iLetter[random(2)], ' ');
        k := round(r * (i - 1) * random);
        
        for j := 1 to i - 1 do begin
            l := random(j) + 1;
            v[j] := v[l];
            v[l] := j;
        end;
        
        write(k);
        for j := 1 to k do
            write(' ', v[j]);
        writeln;
    end;
end.