data = list(map(int, input().split()))
a,b = max(data), min(data)
r = a % b

while r != 0:
    a = b
    b = r
    r = a % b

print(b) data = list(map(int, input().split())) data list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split a,b = max(data), min(data) a max(data) max data b min(data) min data r = a % b r a % b a b while r != 0:
    a = b
    b = r
    r = a % b r != 0 r 0 a = b a b b = r b r r = a % b r a % b a b print(b) print b a = b b a b = max(data), min(data) min(data) b data = list(map(int, input().split())) list(map(int, input().split())) data r = a % b a % b r b = r r b r = a % b a % b r a,b = max(data), min(data) max(data) a
data = list(map(int, input().split()))
a,b = max(data), min(data)
r = a % b

while r != 0:
    a = b
    b = r
    r = a % b

print(b)