406772: GYM102536 K I Brook the Code!

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

K. I Brook the Code!time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

"Beats like digits. Every beat is one. Every rest is a zero. Binary code. That's why all those assassins tried to save my life. It was hidden on me, hidden inside my head. A few simple lines of computer code that can break into any system."

Armed with this very dangerous weapon, you now need to send this information to your trusty friend John. Unfortunately you and John have no access to things like HTTPS or encrypted e-mail. Instead, you have agreed beforehand to send the needed numbers in the following very elaborate manner: You will send a total of $$$n$$$ people to John's apartment. Then John will record every person's weight in micrograms and height in nanoinches. After $$$n$$$ people visit in total, John can now extract the secret computer code as precisely the (integer) sequence of weights (in micrograms) if the $$$n$$$ people are sorted by height.

You already have these "encrypted" numbers. Can you verify that you can get back the secret computer code?

It is guaranteed that no two people have the same height (in nanoinches).

Input

The first line of input contains a single integer $$$n$$$.

The second line of input contains $$$n$$$ space-separated integers $$$w_1, w_2, \ldots, w_n$$$ denoting the weights of the $$$n$$$ people in micrograms.

The third line of input contains $$$n$$$ space-separated integers $$$h_1, h_2, \ldots, h_n$$$ denoting the heights of the $$$n$$$ people in nanoinches.

Constraints

  • $$$1 \le n \le 10^5$$$
  • $$$1 \le w_i, h_i \le 10^{11}$$$
  • The $$$h_i$$$ values are distinct.

(In other words, some of these people are microscopic.)

Output

Output a single line containing $$$n$$$ space-separated integers denoting the secret computer code.

ExampleInput
3
2 1 4
1 4 3
Output
2 4 1

加入题单

算法标签: