// Arup Guha
// 4/23/2013
// Solution to 2013 UCF High School Contest Problem: Zzzyyx or I'm Out

import java.util.*;
import java.io.*;

public class zzzyyx {
	
	public static void main(String[] args) throws Exception {
		
		Scanner fin = new Scanner(new File("zzzyyx.in"));
		int numCases = fin.nextInt();
		
		// Process each case.
		for (int loop=1; loop<=numCases; loop++) {
			
			// Read in the input case.
			int min = fin.nextInt();
			String alpha = fin.next();
			String letters = fin.next();
			
			// Create tiles to sort appropriately.
			tile[] name = new tile[letters.length()];
			for (int i=0; i<name.length; i++)
				name[i] = new tile(letters.charAt(i), alpha);
			Arrays.sort(name);
			
			// Print out the answer accessing the sorted list.
			System.out.print("Week #"+loop+": His name is ");
			for (int i=0; i<min; i++)
				System.out.print(name[i].letter);
			System.out.println("!");
		}
	}

}

// Let's us sort the way we want.
class tile implements Comparable<tile> {
	
	public int value;
	public char letter;
	
	public tile(char c, String alpha) {
		
		letter = c;
		value = 0;
		for (int i=0; i<alpha.length(); i++)
			if (alpha.charAt(i) == c)
				value = i;
	}
	
	public int compareTo(tile other) {
		return this.value - other.value;
	}
}


