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:
s=raw_input()
s3=[i for i in s]
for i in range(len(s3)):
	if s3[i]=='6':s3[i]='5'
s3=''.join(s3)
s3=s3.split()
#print s3
print int(s3[0])+int(s3[1]),
s4=[i for i in s]
for i in range(len(s4)):
	if s4[i]=='5':s4[i]='6'
s4=''.join(s4)
s4=s4.split()
print int(s4[0])+int(s4[1])