{ NOTE: it is recommended to use this even if you don't understand the following code. } { input data } var N, M, i : longint; a, b, z : longint; begin { uncomment the following lines if you want to read/write from files assign(input, 'input.txt'); reset(input); assign(output, 'output.txt'); rewrite(output); } readln(N, M); for i:=0 to M-1 do begin readln(a, b, z); { use a, b and z here } end; { insert your code here } writeln(42); { print result } end.