a = list(map(int, input().split()))
a.sort()

while a[0] > 0:
    b = a[1]%a[0]
    a[1] = a[0]
    a[0] = b
    
print(a[1]) a = list(map(int, input().split())) a list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split a.sort() a.sort a sort while a[0] > 0:
    b = a[1]%a[0]
    a[1] = a[0]
    a[0] = b
     a[0] > 0 a[0] a 0 0 b = a[1]%a[0] b a[1]%a[0] a[1] a 1 a[0] a 0 a[1] = a[0] a[1] a 1 a[0] a 0 a[0] = b a[0] a 0 b print(a[1]) print a[1] a 1 a = list(map(int, input().split())) list(map(int, input().split())) a b = a[1]%a[0] a[1]%a[0] b
a = list(map(int, input().split()))
a.sort()

while a[0] > 0:
    b = a[1]%a[0]
    a[1] = a[0]
    a[0] = b
    
print(a[1])