Team Division
Time limit1sMemory limit1024 MB
Given N up to 10^18, each newbie joins the team that is winning at that moment; print the team that wins after all N have joined.
- Level
Medium5 of 10
- Topics
- Math, Simulation, Implementation
- Solved
- No attempts yet
Statement
The game Encounter Incredible: Online has three teams: mages, archers, and knights. In combat:
- mages have an advantage over knights;
- archers have an advantage over mages;
- knights have an advantage over archers.
All players have exactly the same skill level, so the result depends only on how many people are in each team. If the game has mages, archers, and knights, then:
- mages get points;
- archers get points;
- knights get points.
The team with the most points wins.
newbies join the game one at a time. Each one must choose a team when joining. They can see how many people each team already has, so they can work out which team would win if the game started without them, and they join that team.
Find which team wins after all newbies have joined.
Input
The input file contains one integer (), the number of players.
Output
Print the name of the winning team: maagid, vibulaskjad, or ryytlid (without quotes).