Mishki being the future predictor knows the winning the order of the teams in the Foosball tournament. Each team will have several players and each player will have some strength to play foosball. The winning order will be defined by the power of each team.
Power of a team is defined as the number of players having distinct strengths in the team.
The team with maximum power will win the tournament and the team with second maximum power will come second and so on.
Mishki will be given 2 tables:
1) Strength : It will consists of 2 columns Player and its Strength.
2) Team: It will consists also 2 columns Player and its team.
She needs to tell the names of the Teams along with their standings in the tournament. Help her for the same.
1) You have to print the Team names and their standings in the ascending order of their standings.
2) It is guaranteed that, no two teams will have same power.
Table : Strength
Sample Strength Table:
Sample Team Table: