def lcd(a,b): ##return least common multiple of a and b
    if a > b:
        return lcd(a-b,b)
    elif a < b:
        return lcd(b-a,a)
    elif a == b:
        return a

a,b = map(int,input().split())
print(lcd(a,b)) def lcd(a,b): ##return least common multiple of a and b
    if a > b:
        return lcd(a-b,b)
    elif a < b:
        return lcd(b-a,a)
    elif a == b:
        return a lcd if a > b:
        return lcd(a-b,b)
    elif a < b:
        return lcd(b-a,a)
    elif a == b:
        return a a > b a b return lcd(a-b,b) lcd(a-b,b) lcd a-b a b b elif a < b:
        return lcd(b-a,a)
     a < b a b return lcd(b-a,a) lcd(b-a,a) lcd b-a b a a elif a == b:
        return a a == b a b return a a a a b b a,b = map(int,input().split()) a map(int,input().split()) map int input().split() ().split () input split b print(lcd(a,b)) print lcd(a,b) lcd a b a,b = map(int,input().split()) map(int,input().split()) a def lcd(a,b): ##return least common multiple of a and b
    if a > b:
        return lcd(a-b,b)
    elif a < b:
        return lcd(b-a,a)
    elif a == b:
        return a def lcd(a,b): ##return least common multiple of a and b
    if a > b:
        return lcd(a-b,b)
    elif a < b:
        return lcd(b-a,a)
    elif a == b:
        return a lcd b = map(int,input().split()) map(int,input().split()) b
def lcd(a,b): ##return least common multiple of a and b
    if a > b:
        return lcd(a-b,b)
    elif a < b:
        return lcd(b-a,a)
    elif a == b:
        return a

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