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:
dat=raw_input().split()
a=list(dat[0])
b=list(dat[1])
x=list(dat[0])
y=list(dat[1])
n=len(a)
m=len(b)
p=len(x)
q=len(y)

for i in range(0,n):
    
    if (a[i]=='5'):
        a[i]='6'

for j in range(0,m):
    
    if (b[j]=='5'):
        b[j]='6'

maxa = ''.join(a)
maxb = ''.join(b)
ma=int(maxa)+int(maxb)

for k in range(0,p):
    
    if (x[k]=='6'):
        x[k]='5'
for l in range(0,q):
    
    if (y[l]=='6'):
        y[l]='5'
 
minx = ''.join(x)
miny = ''.join(y)
mi=int(minx)+int(miny)
print mi,ma