program UocChung;
var
a, b, i: integer;
uocchung: array[1..100] of integer;
n: integer;
begin
write('Nhap a=');
readln(a);
write('Nhap b=');
readln(b);
n := 0;
for i := 1 to 100 do
if (a mod i = 0) and (b mod i = 0) then
begin
uocchung[n] := i;
n := n + 1;
end;
write('Uoc chung cua ', a, ' va ', b, ' la: ');
for i := 0 to n-1 do
write(uocChung[i], ' ');
readln;
end.