Problem: Big P is fairly good in mathematics.
His teacher has asked him to add two numbers.
Now , Big P has a problem that he sometimes writes a '6' as a '5' and vice versa.
Given two numbers, A and B, calculate the minimum and the maximum sum Big P could possibly get. 

Input:
The first and only line of input contains positive integers A and B . 

Output:
In single line of output, print two space separated integers, minimum and maximum sum Big P could get. 

Constraints:

1 ≤ A,B ≤ 1000000

SAMPLE INPUT
11 25

SAMPLE OUTPUT
36 37

Solution (in PYTHON):

Solution:
x, y = raw_input().split()
a = list(x)
b = list(y)
for i in range(len(a)):
	if a[i] == '6':
		a[i] = '5'
n1 = int(''.join(a))
for i in range(len(b)):
	if b[i] == '6':
		b[i] = '5'
n2 = int(''.join(b))

mm = n1 + n2

for i in range(len(a)):
	if a[i] == '5':
		a[i] = '6'
n1 = int(''.join(a))
for i in range(len(b)):
	if b[i] == '5':
		b[i] = '6'
n2 = int(''.join(b))

mx = n1 + n2

print mm, mx