// Arup Guha
// 2/16/2018
// Alternate Solution to 2018 Mercer Problem: Race

import java.util.*;

public class race_arup {
	
	final public static boolean DEBUG = false;
	
	public static void main(String[] args) {
		
		Scanner stdin = new Scanner(System.in);
		StringTokenizer tok = new StringTokenizer(stdin.nextLine());
		String sentinel = tok.nextToken();
		int loop = 1;
		
		// Process each race.
		while (!sentinel.equals("END")) {
			
			int rNum = Integer.parseInt(tok.nextToken());
			
			// Will get updated during the race.
			String winner = null;
			long max = -1;
			boolean tie = false;
			
			tok = new StringTokenizer(stdin.nextLine());
			String tmp = "";
			
			// Go through each animal.
			while (tok.countTokens() == 1) {
				
				// Current animal.
				String animal = tok.nextToken();
				
				long sum = 0;
				
				// Go through probabilities, add expectation immediately.
				String line = stdin.nextLine().trim();
				while (Character.isDigit(line.charAt(0))) {
					tok = new StringTokenizer(line);
					long p = Long.parseLong(tok.nextToken());
					long d = Long.parseLong(tok.nextToken());	
					sum += (p*d);
					line = stdin.nextLine().trim();
				}
				
				if (DEBUG) System.out.println(animal+" "+sum);
				
				// Get ready for either next animal or race.
				tok = new StringTokenizer(line);
				
				// Currently a unique winner (either first or strictly better.
				if ((winner == null && sum > 0) || (winner != null && sum > max)) {
					winner = animal;
					max = sum;
					tie = false;
				}
				
				// This marks a tie.
				else if (winner != null && sum == max) {
					tie = true;
				}

			}
			
			// Now, we output for this case.
			if (winner == null)
				System.out.println("Race "+rNum+" expected result is no winner!");
			else if (tie)
				System.out.println("Race "+rNum+" expected result is a tie!");
			else
				System.out.println("Race "+rNum+" expected result is "+winner+" wins!");
			
			// Annoying...but we must see if there's another race.
			sentinel = tok.nextToken();
			if (sentinel.equals("END")) break;
		}
	}
}