334. Inverse Number

0

Medium

Consider the following input:
An integer number.
Assume that for a number with n digits, each digit's value ranges from 1 to n and is unique. For example, 32145 is a valid input number.
Write a function that returns the inverse of the input number. The inverse is defined as follows:
The inverse of 32145 is 12543. In 32145, the digit '5' is at the 1st place, so in 12543, the digit '1' is at the 5th place; in 32145, the digit '4' is at the 2nd place, so in 12543, the digit '2' is at the 4th place.
Print the returned value.

Input Format

Integer

Output Format

Integer

Example

Input

32145

Output

12543

Constraints

0 < N < 1000000000

Loading...

View Submissions

Console