uses
	math;

const
	maxn = 100;

var
	n, maxc, delta, li, ri, i, ny, t, s: longint;
	xr, xl, yl, yr, x, y: array [1..maxn] of longint;
	retries: longint;

label	
	retry;

begin
	randseed := 522047208;

retry:
	n := 100;
	maxc := 300;
	delta := 100;

	repeat
		li := 1;
    	yl[li] := 0;
    	xl[li] := maxc div 2 - 1;
    	ri := 1;
    	yr[ri] := 0;
    	xr[ri] := maxc div 2 + 1;
    until xl[li] < xr[ri];

    i := 0;
    while (li + ri < n - 2) do begin
    	inc(i);
    	ny := max(yl[li], yr[ri]) + random(delta) + 1;
    	if (li + ri < n div 5) then
    		t := 0
    	else if (li + ri > (4 * n) div 5) then
    		t := 1
    	else
    		t := random(2);

    	writeln(erroutput, xl[li], ' ', xr[ri]);

		if (t = 0) then begin	
			inc(li);
			xl[li] := xl[li - 1];
			yl[li] := ny;
			inc(li);
			inc(ri);
			xr[ri] := xr[ri - 1];
			yr[ri] := ny;
			inc(ri);
			retries := 0;
			repeat
             	xl[li] := random(maxc);
             	xr[ri] := random(maxc);
             	inc(retries);
            until (xl[li] < xr[ri]) and (xl[li] < xl[li - 1]) and (xr[ri] > xr[ri - 1]) or (retries > 1000);
            if retries >= 1000 then goto retry;
			yl[li] := ny;
			yr[ri] := ny;
    	end else if (t = 1) then begin
			inc(li);
			xl[li] := xl[li - 1];
			yl[li] := ny;
			inc(li);
			inc(ri);
			xr[ri] := xr[ri - 1];
			yr[ri] := ny;
			inc(ri);
			retries := 0;
			repeat
             	xl[li] := random(maxc);
             	xr[ri] := random(maxc);
             	inc(retries);
            until (xl[li] < xr[ri]) and 
            	(xl[li] > xl[li - 1]) and (xr[ri] < xr[ri - 1]) or (retries > 1000);
            if retries >= 1000 then goto retry;
			yl[li] := ny;
			yr[ri] := ny;
    	end;
    end;

   	ny := max(yl[li], yr[ri]) + random(delta) + 1;
  	inc(li);
  	xl[li] := xl[li - 1];
  	yl[li] := ny;
  	inc(ri);
  	xr[ri] := xr[ri - 1];
  	yr[ri] := ny;

  	for i := 1 to ri do begin
  		x[i] := xr[i];
  		y[i] := yr[i];
  	end;
  	for i := li downto 1 do begin
  		x[ri + 1 + (li - i)] := xl[i];
  		y[ri + 1 + (li - i)] := yl[i];
  	end;

  	s := random(n) + 1;
  	writeln(n);
  	for i := s + 1 to n do begin
  		writeln(x[i], ' ', y[i]);
  	end;
  	for i := 1 to s do begin
  		writeln(x[i], ' ', y[i]);
  	end;
end.