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:
def digits(a):
	dig = [];
	while(a > 0):
		dig.append(a%10);
		a=a/10;
	return dig;

def max_min(digits):
	max_a =0;
	min_a=0;
	i = 0;
	while(i < len(digits) ):
		if(digits[i] == 5):
			max_a = max_a + 6*(10**i);
			min_a = min_a + 5*(10**i);
			
		elif(digits[i] == 6):
			min_a = min_a + 5*(10**i);
			max_a = max_a + 6*(10**i);

		else:
			max_a = max_a + digits[i]*(10**i);
			min_a = min_a + digits[i]*(10**i);
		i = i+1;
	return (min_a,max_a);
	

def msum(a,b):
	(mxa,mna) = max_min(digits(a));
	(mxb,mnb) = max_min(digits(b));
	return (mxa+mxb,mna+mnb);

	
(a,b) = map(int,raw_input().split());
(mx,mn) = msum(a,b);
print mx,mn;