All Tracks Math Problem

Big P and Math
Tag(s):

Basic Programming, Easy

Problem
Editorial
Analytics

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
Time Limit: 1.0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB
Marking Scheme: Marks are awarded when all the testcases pass.
Allowed Languages: C, C++, C++14, Clojure, C#, D, Erlang, F#, Go, Groovy, Haskell, Java, Java 8, JavaScript(Rhino), JavaScript(Node.js), Julia, Lisp, Lisp (SBCL), Lua, Objective-C, OCaml, Octave, Pascal, Perl, PHP, Python, Python 3, R(RScript), Racket, Ruby, Rust, Scala, Swift, Visual Basic, Kotlin

CODE EDITOR

Initializing Code Editor...
Your Rating:

Contributor

This Problem was Asked in

Syscloud

Challenge Name

Syscloud C# Hiring Challenge

OTHER PROBLEMS OF THIS CHALLENGE
Notifications
View All Notifications