f(A + B)
Time limit1sMemory limit1024 MB
Given a one-to-one digit mapping f and the images f(A) and f(B), compute f(A+B) for positive integers A and B up to 10^7.
- Level
Easy2 of 10
- Topics
- String, Implementation
- Solved
- No attempts yet
Problem
The set of digits is . The function has domain and range , and it is a one-to-one correspondence. Although is defined on single digits, for convenience, a positive integer with digits is mapped by . For example, when , , , and , then .
Given and the positive integers and , write a program that computes . The positive integers , , , , , and are never given as numbers that start with 0.
Input
The first line contains through , separated by spaces. The second line contains and , separated by a space.
Output
Print on the first line.