// Arup Guha
// 3/11/2019
// Solution to 2019 UCF HS Contest Problem: Perfectly Balanced Sentences

import java.util.*;

public class sentence {
	
	public static void main(String[] args) {
		
		Scanner stdin = new Scanner(System.in);
		int numCases = stdin.nextInt();
		
		// Process each case.
		for (int loop=1; loop<=numCases; loop++) {
			
			int numWords = stdin.nextInt();
			int numUpper = 0, numLower = 0;
			
			// Go through each word.
			for (int i=0; i<numWords; i++) {
				String word = stdin.next();
				
				// Count upper and lower case.
				for (int j=0; j<word.length(); j++) {
					if (Character.isUpperCase(word.charAt(j)))
						numUpper++;
					else
						numLower++;
				}
			}
			
			// Output result.
			if (numUpper == numLower)
				System.out.println("Sentence #"+loop+": Yes");
			else
				System.out.println("Sentence #"+loop+": No");
		}
	}


}