a, b = map(int,input().split())
print(a if a == b else '1')