A Match of Table Tennis
시간 제한1초메모리 제한2048 MB
탁구 5판 3선승 경기의 게임 점수가 주어지면 다음 서버가 누구인지 판정하고, 불가능한 점수면 모순이라고 출력한다.
문제
The rules of a match of table tennis are quite easy. When a match is played best of five games, it means that the player who wins three games wins. Since there is no point of playing after a winner is decided only the following results are possible: 3-0, 3-1, 3-2, 0-3, 1-3 and 2-3. For each game, the first player to reach 11 points wins that game. However, a game must be won by at least a two point margin. Therefore scores such as 9-12 and 17-14 are not possible, but 9-11, 12-10 and 4-8 are. Each player serves two points in a row and then switch server. However, if a score of 10-10 is reached in any game, then each server serves only one point before the server is switched. In the first game the guest player starts serving, the next game the host starts serving, ect. Both players can score a point, not just the server.
While playing a match of table tennis players are often confused and don't know who the server is. You should help the table tennis players with a program, which can decide who the server is based on the scores. Since people can make mistakes while giving input to the program, you should also check for consistency. Note that you can only start a new game, when the previous game has a winner.
입력
On the first line a single integer n, , the number of games played. On the second line scores in the form , with .
출력
Output "HOST" when the host player is serving, "GUEST" when the guest player is serving or "INCONSISTENT" when the input is not correct.