{ NOTE: it is recommended to use this even if you don't understand the following code }

const
    MAXM = 500000;

var
    K, L, M, N, i : LongInt;
    w, x, y       : Array[0..MAXM-1] of LongInt;

begin
{
    uncomment the two 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
        ReadLn(x[i], y[i], w[i]);

    L := 0;
    K := 0;

    { INSERT YOUR CODE HERE }


    WriteLn(L, ' ', K);

end.
