uses crt;
var
a,b,c,d:longint;
{нахождение НОД 2х чисел по Эвклиду}
function NOD(m,n:longint):longint;
begin
repeat
i
f abs(m)>abs(n) then m:=m mod n
else n:=n mod m;
until (m=0) or (n=0);
NOD:=abs(m+n);
end;
begin
clrscr;
write('a=');readln(a);
write('b=');
readln(b);
write('c=');
readln(c);
write('d=');
readln(d);
writeln;
writeln('NOD(a,b,c,d)=',NOD(NOD(a,b),NOD(c,d)));
readln
end.