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:
ab = raw_input().split(' ')
a_values = []
b_values = []
sums = []
a_values.append(int(ab[0]))
b_values.append(int(ab[1]))
a_values.append(int(ab[0].replace('5', '6')))
a_values.append(int(ab[0].replace('6', '5')))
b_values.append(int(ab[1].replace('5', '6')))
b_values.append(int(ab[1].replace('6', '5')))

i = 0
while i < len(a_values):
	j = 0
	while j < len(b_values):
		sums.append(a_values[i] + b_values[j])
		j += 1
	i += 1

print str(min(sums)) + " " + str(max(sums))