Kianoush is applying for membership in OC organization. On the third day of the…
- User
Kianoush is applying for membership in OC organization. On the third day of the interview, the literature organization examined him.
In this interview, five people sit in front of Kianoosh. They have chosen a poem. Each of them mixes the verses of that poem once and says to Kianoosh in a random order; In this way, he first considers the first selected poem and then selects some of its verses, removes it from the poem and adds it to the poem in another place. Kianoush must find the order of the verses in the original poem. We know that each verse has been removed and moved in at most one of these 5 poems.
When shuffling verses, after being deleted, the verses are added in the desired order and in the desired position. The position of the non-deleted verses may also change in this move.
Say what the original order was by taking the input of the verses read. It is guaranteed that the initial order is uniquely specified in the given inputs.
input The first line of the input contains only numbers n n is the number of verses read in the poem.
Then in 5 n 5n next row, five times and each time in n n lines and in each line there is a verse of the poem. Write verses with distinct integers between 0 and 1 0 9 10 9 We specify
1 ≤ n ≤ 20,000 1≤n≤20000
output The output of the program should include n Let there be n lines such that each line contains a verse of the poem. The order of the verses must be the same as the original order.
Example Sample entry 1 5 1 2 3 4 5 2 1 3 4 5 3 1 2 4 5 4 1 2 3 5 5 1 2 3 4 Plain text Sample output 1 1 2 3 4 5 Plain text In this example, before reading the poem, each person removes one verse from it and moves it to the beginning of the poem and then reads it; So each verse is moved in at most one poem.c++
- Assistant