{$apptype console}
uses
  SysUtils, Math;

type
  int = longint;

var
  kw : array[1..50] of string;
  ids : array[1..1000] of string;
  valid : array[1..53] of char;
  validInID : array[1..63] of char;
  words : array[1..1000] of string;
  wc : int;
  m, n : int;

function keyword(n : int) : string;
var
  i : int;
begin
  result := '';
  for i := 1 to n do begin
    result := result + valid[1 + random(53)];
  end;
end;

function id(n : int) : string;
var
  i : int;
begin
  result := '';
  for i := 1 to n do begin
    result := result + validInID[1 + random(63)];
  end;
end;

function separator() : char;
var
  ch : char;
  i : int;
  good : boolean;
begin
  while (true) do begin
    ch := chr(32 + random(126 - 32 + 1));
    good := true;
    for i := 1 to 63 do begin
      if (validInID[i] = ch) then begin
        good := false;
        break;
      end;
    end;
    if (good) then begin
      break;
    end;
  end;
  result := ch;
end;

var
  i : int;

begin
  randseed := strtoint(paramstr(1));
  for i := 0 to 25 do begin
    valid[1 + i] := chr(ord('a') + i);
    validInId[1 + i] := chr(ord('a') + i);
  end;  
  for i := 0 to 25 do begin
    valid[27 + i] := chr(ord('A') + i);
    validInId[27 + i] := chr(ord('A') + i);
  end;  
  valid[53] := '_';
  validInID[53] := '_';
  for i := 0 to 9 do begin
    validInID[54 + i] := chr(ord('0') + i);
  end;
  n := random(51);
  for i := 1 to n do begin
    kw[i] := keyword(random(50) + 1);
  end;
  m := random(50) + 1;
  for i := 1 to m do begin
    ids[i] := id(random(100) + 1);
  end;
  for i := 1 to n do begin
    words[i] := kw[i];
  end;
  for i := 1 to m do begin
    words[n + i - 1] := ids[i];
  end;
  writeln(n, ' ', paramstr(2), ' ', paramstr(3));
  for i := 1 to n do begin
    writeln(kw[i]);
  end;
  for i := 1 to 120 do begin
    write(words[1 + random(n + m)]);
    write(separator());
  end;
  writeln;
end.