{$A+,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1}
{$MINSTACKSIZE $00004000}
{$MAXSTACKSIZE $00100000}
{$APPTYPE console}

uses SysUtils, Math;

type
  int = longint;
  point = record
    x, y : int;
  end;

function doName(l: int): string;
    var
        i: int;
begin
    if l > 54 then l := 54;
    result := '';
    for i := 1 to l do
        result := result + chr(34 + random(126 - 34 + 1));
end;

const
  nmax = 2000;

var
  n, k : integer;
  i, j, t : integer;

  p : array [1..nmax] of point;
  ok : boolean;
  m : int;
  name, s : string;

begin
  n:= StrToInt(ParamStr(1));
  m:= StrToInt(ParamStr(2));
  Randseed:= (n + 1243) * (322);
  for i:= 1 to n do
  begin
    ok:= false;
    while not ok do
    begin
      ok:= true;
      p[i].x:= random(2 * m + 1) - m;
      p[i].y:= random(2 * m + 1) - m;
      for j:= 1 to i - 1 do
        if (p[i].x = p[j].x) and (p[i].y = p[j].y) then
        begin
          ok:= false;
          break;
        end;
      if not ok then continue;
      for j:= 1 to i - 2 do if ok then
        for t:= j + 1 to i - 1 do
          if (p[t].x - p[j].x) * (p[i].y - p[j].y) -
            (p[t].y - p[j].y) * (p[i].x - p[j].x) = 0 then
            begin
              ok:= false;
              break;
            end;
    end;
  end;
  for i:= 1 to n do
  begin
    name := doName(random(m div 167) + 1) + #33 + inttostr(i);
    if m = 10000 then begin
        name := inttostr(i);
        while length(name) < 60 do 
            name := chr(33) + name;
    end;
    writeln(name);
    writeln(p[i].x, ' ', p[i].y);
  end;
end.
