{ constraints }
const
    MAXN = 50000;
    MAXM = 100000;

{ input data }
var
    N, M, i, source, destination : longint;
    city1, time1, city2, time2 : 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);
    readln(source, destination);
    readln(M);
    for i:=0 to M-1 do
    begin
        readln(city1, time1, city2, time2);

        { insert your code here }
    end;

    { insert more code here }

    writeln(42); { change 42 with actual answer }
end.
