Under construction

Still being built. Things may change

Reversed Addition

Interview

Time limit2sMemory limit128 MB

Summary
Reverse the digits of two numbers up to 1000, add the reversed values, then reverse the sum and print the result.
Level

Easy2 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

For a positive integer X, define Rev(X) as the integer obtained by reading the decimal digits of X in reverse order. Any leading zeroes created by the reversal are discarded. For instance, Rev(123) is 321, and Rev(100) is 1.

Given two positive integers X and Y, compute Rev(Rev(X) + Rev(Y)).

Input

The first line contains two integers X and Y. Both X and Y are natural numbers no greater than 1,000.

Output

Print the answer on the first line.

Examples5

  1. Example 1

    Input
    123 100
    
    Expected output
    223
    
  2. Example 2

    Input
    111 111
    
    Expected output
    222
    
  3. Example 3

    Input
    5 5
    
    Expected output
    1
    
  4. Example 4

    Input
    1000 1
    
    Expected output
    2
    
  5. Example 5

    Input
    456 789
    
    Expected output
    1461