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:
mylist=[n for n in raw_input().split(" ")]
ma=0
mi=0
for n in mylist:
    if n.find("5")+n.find("6")==-2:
        ma+=int(n)
        mi+=int(n)
    else:
        if (n.find("5")!=-1) and (n.find("6")!=-1):
            if int(n)>0:
                ma+=int(n.replace("5","6"))
                mi+=int(n.replace("6","5"))
            else:
                ma+=int(n.replace("6","5"))
                mi+=int(n.replace("5","6"))
        else:
            if n.find("5")!=-1:
                if int(n)>0:
                    ma+=int(n.replace("5","6"))
                    mi+=int(n)
                else:
                    ma+=int(n)
                    mi+=int(n.replace("5","6"))
            if n.find("6")!=-1:
                if int(n)>0:
                    mi+=int(n.replace("6","5"))
                    ma+=int(n)
                else:
                    mi+=int(n)
                    ma+=int(n.replace("6","5")) 
print str(mi)+" "+str(ma)