program ucln;
uses crt;
var M,N,ucln:longint;
begin
clrscr;
write('nhap M:');readln(M);
while M<=0 do
begin
write('nhap lai M:');readln(M);
end;
write('nhap N:'); readln(N);
while N<=M do
begin
write('nhap lai N:');readln(N);
end;
While M<>N do
if M>N then M:=M-N else N:=N-M;
ucln:=M;
write('ucln la:',ucln);
readln;
end.