// Arup Guha
// 3/11/2015
// Solution to UCF HS Problem: Maximum Flowers

import java.util.*;

public class flowers {

	final public static int MAX = 100;

	public static void main(String[] args) {

		// Get number of cases.
		Scanner stdin = new Scanner(System.in);
		int numCases = stdin.nextInt();

		// Process each case.
		for (int loop=1; loop<=numCases; loop++) {

			// Get minimum of first n-1 terms.
			int n = stdin.nextInt();
			int min = MAX+1;
			for (int i=0; i<n-1; i++) {
				String s = stdin.next();
				min = Math.min(min, stdin.nextInt());
			}

			// Not useful...
			stdin.next();
			stdin.nextInt();

			// Output result.
			System.out.println("Assembly #"+loop+": "+min);
		}
	}
}