{$APPTYPE CONSOLE}

uses SysUtils;
var
  f: TextFile;
  i, N, s: Integer;
begin
  RandSeed := 33;
  N := StrToInt(ParamStr(1)); 
  AssignFile(f, 'input.txt'); Rewrite(f);
  Writeln(f, 999, ' ', 999, ' ', N);
  for i := 1 to N do begin
    case ParamStr(2)[1] of
    'a': Writeln(f, 47, ' ', 13, ' ', 3, ' ', Random(8)+1);
    'b':
      if Random(100) > 50 then
        Writeln(f, 515, ' ', 400, ' ', 199, ' ', 1)
      else
        Writeln(f, 515, ' ', 401, ' ', 199, ' ', 2);
    'c':
      if Random(100) > 50 then
        Writeln(f, 377, ' ', 509, ' ', 199, ' ', 7)
      else
        Writeln(f, 377, ' ', 509, ' ', 198, ' ', 6);
    end;
  end;
  CloseFile(f);
end.
