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,b=raw_input().split()
a,b=int(a),int (b)
value=0
value2=0
minus=0
minus2=0
pos=0
dupa=a
dupb=b
import math
while(dupa>0):
	if(dupa%10==5):
	 value=value+math.pow(10,pos)
	if(dupa%10==6):
	 minus=minus+math.pow(10,pos)
	pos=pos+1
	dupa=dupa/10
pos=0
while(dupb>0):
	if(dupb%10==5):
	 value2=value2+math.pow(10,pos)
	if(dupb%10==6):
	 minus2=minus2+math.pow(10,pos)
	pos=pos+1
	dupb=dupb/10
print int(a+b-minus-minus2),
print int(a+b+value+value2)