michael10024 0 Newbie Poster

A black-hat cracker attacked to your computer and he took a very important sequence from it. Also, he replaced this sequence with five mutations of the sequence.

The sequence has length of N and it's content are numbers between 1 and N (all the numbers one time) in a random position.

For every single mutation:
~He take the original sequence.
~He moves a single number to a random place.
~He creates the mutation.

The sequence's length is between 1 and 20000 so this proccess performs only for five numbers.
Every number moves only one time.
Taking a number and moving it to the same place is accepted as a mutation.


Input File:
In the first line we take the N number (length of sequence).
In the 5 other lines we take the five mutations.

Output file:
In a single line the original sequence.

Example:

Input
5
4 1 5 3 2
4 5 1 3 2
1 5 4 3 2
3 5 4 1 2
2 5 4 1 3

Output
5 4 1 3 2


Please HELP me as soon as you can with a verbal or a coded solution!!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.