ab, c = input().split()

c_val = int(c)

for i in range(len(ab) - 1):
	if ab[i + 1] == "0":
		continue

	a_val = int(ab[: i + 1])
	b_val = int(ab[i + 1: ])
	if b_val * c_val == a_val:
		print(a_val, b_val)