p, q, x, y = map(int, input().split()) while y % 10 == 0 or int(str(y)[::-1]) % p == 0: y += q ans = int(str(y)[::-1]) t = 0 while ans * pow(10, t, p) % p != x: t += 1 print(str(ans) + '0' * t)