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=raw_input().split(' ')
C=P=A[0]
l=m=0
D=Q=A[1]
lenA=len(C)
lenB=len(D)
for i in range(0,lenA):
	if C[i]=='6':
		l=l+10**(lenA-1-i)
for i in range(0,lenB):
	if D[i]=='6':
		#D[i]='5'
		l=l+10**(lenB-1-i)
for i in range(0,lenA):
	if P[i]=='5':
		#P[i]='6'
		m=m+10**(lenA-1-i)
for i in range(0,lenB):
	#print 'in Q 5-->6'
	if Q[i]=='5':
		#print 'in if'
		#Q[i]='6'
		m=m+10**(lenB-1-i)
		#print 'power:',lenB,10**(lenB-1-i)
#print C,D,P,Q,l,m
print int(C)+int(D)-l,int(P)+int(Q)+m