l, r = map(int, input().split()) if l == r: print(l) else: print(1)