uses
	math;

const
	maxn = 100000;

var
	n, m, s, i, l, r, w, sl, sr: longint;
	minc, maxc: longint;
	a: array [1..4 * maxn] of longint;

begin
	randseed := 258307447;

	n := 100000;
	m := 100000;
	minc := 1;
	maxc := maxlongint;

	s := 1;
	while (s < n) do
		s := s * 2;

	for i := 1 to n do begin
		a[i + s - 1] := i;
	end;

	for i := s - 1 downto 1 do begin
		a[i] := min(a[2 * i], a[2 * i + 1]);
	end;

	writeln(n, ' ', m);
	for i := 1 to m do begin
		writeln(i, ' ', i, ' ', i);
	end;
end.