Go Back
Avengers Unite (100)
Description

The world is under a new threat, and as always, “With great power, comes great responsibility”. The Avengers are back to defeat the evil, and bring peace to the world. However it seems like this time it’s not going to be so easy. So The Avengers decide to gain more power from The 5 Rings of Energy.

Each Avenger is allotted only a particular ring to wear as follows :-
( Format: Avenger - Ring )
ironman - light
doctor strange - magic
thor - strength
black widow - stealth
captain america - earth

However the rings can only provide power to their masters if they wear them in a specific order.
You will be given the order of the rings to be worn by the Avengers, help them to find out the order in which they will wear the rings.
(See the example for clarification)

Input

The first line of the input will consist of a single integer T, which denotes the number of Test Cases (the number of times your program will be tested / the number of questions).
Each test case consists of 5 lines of input which displays the required order of the rings. Each of these lines will display the name of the rings (which are : stealth, light, magic, earth, strength).
(All inputs are of lowercase alphabets)

Output

For each test case, print 5 lines of output describing the order in which The Avengers (which are : black widow, doctor strange, ironman, thor, captain america) will have to wear the rings.

Constraints

1 <= T <= 50
All input and output alphabets are of lowercase

Example
Copy Input

Input:
2
strength
light
earth
magic
stealth
earth
stealth
magic
strength
light

Output:
thor
ironman
captain america
doctor strange
black widow
captain america
black widow
doctor strange
thor
ironman

Explanation

Let us consider the first test case.
The order of the rings to be worn is : strength - light - earth - magic - stealth.
Therefore the order of the Avengers who will wear those rings is :
thor - ironman - captain america - doctor strange - black widow , as The Avengers are allotted those particular rings ( see description ).

August Queue
36 hours long contest



Announcement
Give your feedback here: https://goo.gl/forms/PUTRfCJPftc9UTUj1

Problem Tags
adhoc,strings

Supported by our Coding Partner