program graths;uses crt;
var g:array[1..10000] of record
i:integer;
j:integer;
c:integer;
end;
min1,min,n,k,i,f:integer;
begin
clrscr;
writeln('vavdedete broia na krastovi6tata i broia na zalite');
readln(n,k);
for i:=1 to n do
begin
with g[i] do
begin
writeln('vavedete krastovi6tata predstavliava6ti krai na ulicata');
readln(i,j);
writeln('vavedete daljinata na ulicata');
readln(c);
writeln('vavedete krastovi6tata na koito ima gameclub');
readln(f);
end;end;
with g[i] do
begin
if f=i then
min:=c;
if f=j then
min1:=c;
if min>min1 then
writeln('nai-kratkiat pat e',min1);
if min1>min then
writeln('nai-kratkiat pat e',min);
end;end.














