// Arup Guha
// 12/10/2019
// Solution to 2019 UCF HS Online D2 Problem: Pangramic Judges

import java.util.*;

public class judges {

	final public static int ALL = (1<<26)-1;
	
	public static void main(String[] args) {
	
		Scanner stdin = new Scanner(System.in);
		int nC = Integer.parseInt(stdin.nextLine().trim());
		
		// Process each case.
		for (int loop=1; loop<=nC; loop++) {
		
			// Get number of names.
			int n = Integer.parseInt(stdin.nextLine().trim());
			
			// Storing names as bitmasks of the letters they contain.
			int[] masks = new int[n];
			
			// Read in the strings and immediately convert to masks.
			for (int i=0; i<n; i++)
				masks[i] = getMask(stdin.nextLine().toLowerCase());
				
			// This signifies that we can't do it yet.
			int res = n+1;
			
			// Try each subset.
			for (int mask=0; mask<(1<<n); mask++) {
			
				// Here we find which letters are covered by taking the bitwise or
				// of the letters covered of each name in our subset.
				int tmp = 0;
				for (int i=0; i<n; i++)
					if ((mask & (1<<i)) != 0)
						tmp |= masks[i];
						
				// Update if we have all letters covered and this is better than
				// anything we've seen.
				if (tmp == ALL && Integer.bitCount(mask) < res)
					res = Integer.bitCount(mask);
			}
			
			// Ta da!
			if (res == n+1)
				System.out.println("Judge List #"+loop+": -1");
			else
				System.out.println("Judge List #"+loop+": "+res);
		}
	}
	
	// Returns a mask storing each unique lowercase letter in s.
	public static int getMask(String s) {
	
		int res = 0;
	
		// Go through each letter.
		for (int i=0; i<s.length(); i++) {
		
			// This is our offset from lower case 'a'.
			int idx = s.charAt(i) - 'a';
			
			// It's only a letter if idx is in [0, 25].
			if (idx >= 0 && idx < 26)
				res |= (1<<idx);
		}
		
		// Ta da!
		return res;
	}
	
}