Let me tell you a heartwarming tale of a sweet little boy named Arham. Everyone who saw him adored him, but his dear grandmother especially did. She cherished him more than anything and would do anything to make him happy. Once, she gifted him a delightful set of balls and rattles. The rattles were tinier than the balls but just as charming. One day, he stumbled upon a magical forest with his trusty toys by his side. However, as he explored the enchanting surroundings, he realized he needed to find his way.
Despite his best efforts, he was unable to navigate his way out. As he strolled down the path, feeling discouraged by his lack of progress, a wise-looking gentleman with a magnificent, flowing gray beard appeared before him.
With a mysterious glint in his eye, the stranger proposed a challenge - "I can guide you to the exit," he said, "but only if you can arrange your toys neat and orderly. Line them up from largest to smallest, and I will see if you are up to the task."
Let's help Arham sort through his toys and get him back home.
The input consists of multiple test cases. The first line contains an integer — the number of test cases. The description of the test cases follows.
The first line of each test case contains two positive integers and — the number of balls and rattles, respectively.
The second line of each test case contains integers — the size of each set of balls.
The next line of each test case contains integers — the size of each set of rattles.
It is guaranteed that the sum of and over all test cases does not exceed .
For each test case, output all sets of balls and rattles together where they should be lined up from largest to smallest according to the size of the set.
Input | Output |
---|---|
2 2 3 1 6 2 3 7 3 3 6 3 1 9 7 2 | 7 6 3 2 1 9 7 6 3 2 1 |