Activity must be applied if the rundown doesn't contain two indistinguishable things thereafter. And furthermore, in the event that we think about each thing as a grouping of numbers, the succession of things ought to consistently stay expanding in lexicographical request. Instances of legitimate and invalid records that are displayed in the image
Correct answer will be upvoted else downvoted.
Activity must be applied if the rundown doesn't contain two indistinguishable things thereafter. And furthermore, in the event that we think about each thing as a grouping of numbers, the succession of things ought to consistently stay expanding in lexicographical request. Instances of legitimate and invalid records that are displayed in the image can found in the "Notes" area.
At the point when William chose to save a Word report with the rundown of his tasks he incidentally hit something else entirely easy route from the "Ctrl-S" he needed to hit. It's not known precisely what alternate route he squeezed however subsequent to setting off it all things in the rundown were supplanted by a solitary number: the last number initially written in the thing number.
William needs you to assist him with reestablishing a fitting unique settled rundown.
Input
Each test contains different experiments. The principal line contains the number of experiments t (1≤t≤10). Portrayal of the experiments follows.
The primary line of each experiment contains a solitary integer n (1≤n≤103), which is the number of lines in the rundown.
Every one of the following n lines contains a solitary integer simulated intelligence (1≤
It is ensured that in each experiment somewhere around one fitting rundown exists.
It is ensured that the amount of qualities n across all experiments doesn't surpass 103.
Output
For each experiment output n lines which address a substantial settled rundown, which could turn into the information gave to you by William.
In case there are numerous replies, print any.
Step by step
Solved in 3 steps with 1 images