ZBROJ - ZBROJ

no tags 

After he got tired of rotating tables, the teacher gave Perica another problem. She wrote two integers, A
and B, on the blackboard and asked him to add them.
Perica is never wrong with his calculation, but sometimes he doesn’t copy the numbers correctly. The
only mistake he ever makes is copying a 5 as a 6, and viceversa.
Given two numbers, A and B, calculate the minimum and the maximum sum Perica could possibly get.

Input

The first and only line of input contains positive integers A and B (1 ≤ A, B ≤ 1 000 000).

 

Output

In single line of output, print two space separated integers, minimum and maximum sum Perica could
get.

Example

Input:
11 25
Output:
36 37

hide comments
Brian A. ignacio: 2011-04-05 03:45:32

Can someone tell me about the output, does it print the result twice if there are no 5 or 6 digits,? would thank for more info here.

Adrian Satja Kurdija: 2011-02-24 13:13:15

Why do you guys set only the easiest problems from COCI? There are much harder COCI problems that could be appropriate.

Vaibhav Jain: 2011-02-24 13:13:15

@~tott~
its not a nice prob
not even a tutorial material

numerix: 2011-02-24 13:13:15

I agree with Michael T.: should be moved to tutorial section.
Or even better: remove it from SPOJ.

Last edit: 2011-02-22 18:46:56
~Dharm~: 2011-02-24 13:13:15

Last edit: 2011-03-14 22:27:28
Michael T: 2011-02-24 13:13:15

Tutorial material.


Added by:akaki
Date:2011-02-22
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:coci