a, b = map(int, input().split())

def gcd(a, b):
  if a > b:
    a, b = b, a

  if b % a == 0:
    return a
  else:
    return gcd(a, b % a)

print(gcd(a, b)) a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b def gcd(a, b):
  if a > b:
    a, b = b, a

  if b % a == 0:
    return a
  else:
    return gcd(a, b % a) gcd if a > b:
    a, b = b, a

   a > b a b a, b = b, a a b b a if b % a == 0:
    return a
  else:
    return gcd(a, b % a) b % a == 0 b % a b a 0 return a a return gcd(a, b % a) gcd(a, b % a) gcd a b % a b a a a b b print(gcd(a, b)) print gcd(a, b) gcd a b def gcd(a, b):
  if a > b:
    a, b = b, a

  if b % a == 0:
    return a
  else:
    return gcd(a, b % a) def gcd(a, b):
  if a > b:
    a, b = b, a

  if b % a == 0:
    return a
  else:
    return gcd(a, b % a) gcd b = map(int, input().split()) map(int, input().split()) b a, b = map(int, input().split()) map(int, input().split()) a
a, b = map(int, input().split())

def gcd(a, b):
  if a > b:
    a, b = b, a

  if b % a == 0:
    return a
  else:
    return gcd(a, b % a)

print(gcd(a, b))