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()
l = s.split()
A = int(l[0])
B = int(l[1])
A1 = 0
B1 = 0
A2 = 0
B2 = 0
t = 1
while A!=0 or B!=0 :
	rA = A%10;
	rB = B%10;
	if rA == 5:
		rA = 6;
	if rB == 5:
		rB = 6;
	A1 = A1 + rA*t;
	B1 = B1 + rB*t;
	rA = A%10;
	rB = B%10;
	if rA == 6:
		rA = 5;
	if rB == 6:
		rB = 5;
	A2 = A2 + rA*t;
	B2 = B2 + rB*t;

	A=A//10;
	B=B//10;
	t=t*10;

s = str(A2+B2)+" "+str(A1+B1)
print(s)