ZBROJ - ZBROJ

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

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

hide comments
2011-04-05 03:45:32 Brian A. ignacio
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.
2011-02-24 13:13:15 Adrian Satja Kurdija
Why do you guys set only the easiest problems from COCI? There are much harder COCI problems that could be appropriate.
2011-02-24 13:13:15 Vaibhav Jain
@~tott~
its not a nice prob
not even a tutorial material
2011-02-24 13:13:15 numerix
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
2011-02-24 13:13:15 ~Dharm~


Last edit: 2011-03-14 22:27:28
2011-02-24 13:13:15 Michael T
Tutorial material.
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.