import sys
sys.set_int_max_str_digits(10**5 + 5)

s, c = input().split()
cc = int(c)
possible_split_mid = (len(s) // 2) + (len(c) // 2)

for pos in range(max(1, possible_split_mid - 4), min(possible_split_mid + 4, len(s) - 1) + 1):
    if s[pos] == '0':
        continue
    ac = int(s[:pos])
    bc = int(s[pos:])
    if ac % bc == 0 and (ac // bc) == cc:
        print(ac, bc)
        exit(0)
