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 = map(int,raw_input().split())
aa = map(int,str(a))
bb = map(int,str(b))

mina = aa
minb = bb
maxa = aa
maxb = bb

for i in range(0,len(mina)):
	if mina[i] == 6:
		mina[i] = 5
for i in range(0,len(minb)):
	if minb[i] == 6:
		minb[i] = 5

c = int(''.join(map(str,mina))) + int(''.join(map(str,minb)))
print str(c),

for i in range(0,len(maxa)):
	if maxa[i] == 5:
		maxa[i] = 6
for i in range(0,len(maxb)):
	if maxb[i] == 5:
		maxb[i] = 6
d = int(''.join(map(str,maxa))) + int(''.join(map(str,maxb)))

print  str(d)