import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class voting { public static void main(String[] args) { Scanner in = new Scanner(System.in); Queue out = new LinkedList(); while (true) { String line = in.nextLine(); if (line.equals("#")) break; int y = 0, n = 0, p = 0, a = 0; for (int i = 0; i < line.length(); i++) { switch (line.charAt(i)) { case 'Y': y++; break; case 'N': n++; break; case 'P': p++; break; case 'A': a++; break; } } if (a >= (line.length() / 2.0)) out.add("need quorum"); else if (y == n) out.add("tie"); else if (y > n) out.add("yes"); else if (y < n) out.add("no"); else out.add("OH MY GOD SOMETHING IS SERIOUSLY FUCKED UP"); } while (out.size() > 0) System.out.println(out.poll()); } }