while True: try: n, m = map(int, input().split(' ')) if n > m: n, m = m, n #注意以m为步长切片,否则运算时长很大 for i in range(m, n*m+1, m): if i % n == 0 and i % m == 0: print(i) break except: break