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=raw_input()
maxs=""
mins=""
for i in range(len(x)):
	if(x[i]=='6'):
		mins=mins+'5'
		maxs=maxs+'6'
	elif(x[i]=='5'):
		mins=mins+'5'
		maxs=maxs+'6'
	else:
		mins=mins+x[i]
		maxs=maxs+x[i]
arr1=map(int,mins.strip().split(' '))
arr2=map(int,maxs.strip().split(' '))
sumx=[]
sumx.append(sum(arr1))
sumx.append(sum(arr2))
print sumx[0], sumx[1]