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:
a = raw_input().split()
numb1 = a[0]
numb2 = a[1]

def replacefivewithsix(num):
	num1 = num.replace('5','6')
	return int(num1)

def replacesixwithfive(num):
	num1 = num.replace('6','5')
	return int(num1)

max1 = replacefivewithsix(numb1) + replacefivewithsix(numb2)
min1 = replacesixwithfive(numb1) + replacesixwithfive(numb2)

print str(min1) + " " + str(max1)