We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • Hackerrank Home
  • Prepare
    NEW
  • Certify
  • Compete
  • Career Fair
  • Hiring developers?
  1. Prepare
  2. Security
  3. Functions
  4. Security Function Inverses

Security Function Inverses

Problem
Submissions
Leaderboard
Discussions
  1. Prepare
  2. Security
  3. Functions
  4. Security Function Inverses
Exit Full Screen View
  • Problem
  • Submissions
  • Leaderboard
  • Discussions

Consider a bijective function .

Define another function so that for and if then .

Now, the function is said to be the inverse function of and is denoted as .

In this task, you'll be given an integer and a bijective function where .

Output the inverse of .

Input Format

There are lines in the input.
The first line contains a single positive integer .
The second line contains space separated integers, the values of , respectively.

Constraints

Output Format

Output lines. The line should contain the value of .

Sample Input#00

3
1 2 3

Sample Output#00

1
2
3

Sample Input#01

3
2 3 1

Sample Output#01

3
1
2

Explanation

First sample :-

Basically, this is the function . Hence, it's the inverse of itself.

Second Sample :-

Here you can see that

hence is
is
is

One way to confirm is .

  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy