You and your friends have organized a small tournament in your favorite video game "Space Rangers". Each of you played one match and recorded the final scores. Now you face the most difficult task — not just finding the winner, but compiling a full ranking of all participants.
The ranking is determined by the following rules:
- The player with the highest score gets 1st place (rank 1).
- The player with the second highest score gets 2nd place (rank 2), and so on.
- If several players have the same score, they all share the same rank. For example, if two players have the maximum score, they both get rank 1. The next player after them gets rank 3 (since the first two places are taken).
Write a program that takes the scores of all players as input and outputs their final ranks in the same order.
Requirements:
Use only basic constructs: input and output, conditional statements (if) and for loops. Try not to use built-in sorting functions or other complex data structures.
Input format
Glasses of players in the tournament (one line containing integers separated by a gap).
Output format
Ranks for each player in the same order (one line containing integers separated by a gap).
Hint
There will be no clue here, decide for yourself!