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 Permutations

Security Permutations

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

Consider a function where is any set.
If is a bijection, then is a permutation function of . There is nothing special about the set . It can be replaced by the set where .

Consider a permutation given by . This means that , and .

In this task, you're given a permutation .

Output for all .

Constraints

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.

Output Format

On separate lines, output the values of , respectively.

Sample Input

3
2 3 1

Sample Output

3
1
2

Explanation

and so on.

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