program UCLN_dayso;
uses crt;
const max = 100000;
var
dayso: array [1..max] of word;
N, i, tg:word;
Function UCLN(a, b: word):word;
Begin
while (a<>b) do
if (a>b) then a:= a-b
else b:= b-a;
UCLN:= a;
End;
Begin
write('nhap N: '); readln(N);
for i:=1 to N do
Begin
write('Nhap phan tu thu ', i, ' : ');
readln(dayso[i]);
End;
tg:= UCLN(dayso[1], dayso[2]);
for i:=3 to N do
tg:= UCLN(tg, dayso[i]);
write('UCLN cua day so la: ', tg);
End.