import fractions

if __name__ == '__main__':
    x, y = [int(_) for _ in input().split()]
    print(fractions.gcd(x, y)) import fractions fractions if __name__ == '__main__':
    x, y = [int(_) for _ in input().split()]
    print(fractions.gcd(x, y)) __name__ == '__main__' __name__ '__main__' int(_) for _ in input().split() for _ in input().split() _ input().split() ().split () input split for _ in input().split() int(_) int _ x, y = [int(_) for _ in input().split()] x [int(_) for _ in input().split()] y print(fractions.gcd(x, y)) print fractions.gcd(x, y) fractions.gcd fractions gcd x y x, y = [int(_) for _ in input().split()] [int(_) for _ in input().split()] x y = [int(_) for _ in input().split()] [int(_) for _ in input().split()] y
import fractions

if __name__ == '__main__':
    x, y = [int(_) for _ in input().split()]
    print(fractions.gcd(x, y))