A, N = map(int, input().split()) X = 10 ** 7 M = (X // A + 1) * A print(M) print(0)