A committee clerk is good at recording votes, but not so good at counting them and determining the outcome. As a roll-call vote proceeds, the clerk records the votes as a sequence of letters, one letter for every member of the committee.
Y: a yes voteN: a no voteP: present, but choosing not to voteA: a member who was absent from the meetingGiven this recorded list of votes, determine the outcome.
Rules: There must be a quorum. If at least half of the members were absent, output need quorum. Otherwise the votes are counted. If there are more yes votes than no votes, output yes. If there are more no votes than yes votes, output no. If the number of yes and no votes is equal, output tie.
The input consists of a series of votes, one per line, followed by a single line containing only the # character. Each vote consists entirely of the uppercase letters described above. Each vote contains at least 2 and at most 70 letters.
For each vote, output one line containing the correct result: need quorum, yes, no, or tie.