// Arup Guha
// 10/19/2016
// Solution to 1997 UCF High School Contest Problem: Happiness Man

import java.util.*;

public class happy {

	final public static String[] WEAPONS = {"Happiness Ray", "Pulping Ray"};

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);

		// Process all input.
		while (stdin.hasNext()) {

			int n = Integer.parseInt(stdin.nextLine());
			int[] evil = new int[n];
			int[] weight = new int[n];
			String[] names = new String[n];

			// Read in each person.
			for (int i=0; i<n; i++) {
				names[i] = stdin.nextLine();
				StringTokenizer tok = new StringTokenizer(stdin.nextLine());
				evil[i] = Integer.parseInt(tok.nextToken());
				weight[i] = Integer.parseInt(tok.nextToken());
			}

			int bestmask = -1;

			// Try to use each combination and take the best one.
			for (int mask=0; mask<(1<<n); mask++) {

				// Add up what it takes to beat this combo.
				int curH = 0, curP = 0;
				for (int i=0; i<n; i++) {
					if ((mask&(1<<i)) != 0)
						curP += weight[i];
					else
						curH += evil[i];
				}

				// Not a viable option.
				if (curP > 500 || curH > 50) continue;

				// Update our best combination.
				if (bestmask == -1 || Integer.bitCount(mask) < Integer.bitCount(bestmask))
					bestmask = mask;
			}

			// Output for case...
			for (int i=0; i<n; i++)
				System.out.println("Use the "+WEAPONS[(bestmask>>i)&1]+" on "+names[i]);
			System.out.println();
		}
	}
}