{$i const.inc}
var
    n, m, i, j: longint;
begin
    writeln('3 6');
    writeln('1 2 3');
    writeln('4 2 1');
    writeln('1 2');
    writeln('1 1');
    writeln('3 2');
    writeln('1 2');
    writeln('3 1');
    writeln('2 3');
end.