h, a = map(int, input().split()) assert 1 <= h <= 10 ** 12 assert 2 <= a <= 10 ** 12