var
	i, j, k: longint;
begin
	for i := 1 to 10 do 
		for j := 1 to 10 do 
			for k := 1 to 10 do begin
				if (i <> j) and (i <> k) and (j <> k) then
					writeln(i, ' ', j, ' ', k);
			end;
	writeln(0, ' ', 0, ' ', 0);
end.