const
	maxn = 1000;

function randstr: string;
var
	r: string;
	i, l: longint;
begin
	l := random(40) + 1;
	for i := 1 to l do begin
		r := r + char(ord('a') + random(26));
	end;
	randstr := r;
end;

var
	i, j, n, d: longint;
	name: array [1..maxn] of string;
	cost: array [1..maxn] of longint;
	found: boolean;

begin
	randseed := 77897645;
	n := 999;
	d := 1;
	for i := 1 to n do begin
		repeat
			name[i] := randstr;
			found := false;
			for j := 1 to i - 1 do begin
				if name[j] = name[i] then
					found := true;
			end;
		until not found;
		if (random(4) = 0) then
			cost[i] := random(20) + 1
		else
			cost[i] := 9900 + random(100) + 1
	end;

	writeln(n, ' ', d);
	for i := 1 to n do begin
		writeln(name[i], ' ', cost[i]);
	end;
end.