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:
test = list(map(str,raw_input().split()))
a = test[0]
b = test[1]
maxSum = 0
minSum = 0
if '5' in a:
	c = a.replace('5','6')
else:
	c = a
if '5' in b:
	d = b.replace('5','6')
else:
	d = b
if '6' in a:
	e = a.replace('6','5')
else:
	e = a
if '6' in b:
	f = b.replace('6','5')
else:
	f = b
maxSum = int(c) + int(d)
minSum = int(e) + int(f)
print minSum,maxSum