// Arup Guha
// 9/4/2016
// Solution to 2016 UCF Locals Problem: Jedi and the Galactic Empire

import java.util.*;

public class jedi {

	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++) {

			// Read shots and sort in time order.
			int n = stdin.nextInt();
			int[] vals = new int[n];
			for (int i=0; i<n; i++)
				vals[i] = stdin.nextInt();
			Arrays.sort(vals);

			// Read in Jedi times.
			int numJ = stdin.nextInt();
			int[] times = new int[numJ];
			for (int i=0; i<numJ; i++)
				times[i] = stdin.nextInt();

			int res = 0;

			// One shot can always be blocked.
			if (n == 1) res = 1;

			// Easy case - run greedy.
			else if (numJ == 1) res = sim(vals, times[0]);

			// DP case.
			else {

				// prev[i][j] stores for jedi i+1, the last shot they might block prior to blocking shot j.
				int[][] prev = new int[2][];
				for (int i=0; i<2; i++)
					prev[i] = getPrev(vals, times[i]);

				// Set up DP: dp[i][j] is max shots blocked if last shot blocked by jedi 1 was i-1, and jedi 2 was j-1.
				int[][] dp = new int[n+1][n+1];

				// These arrays speed up the n^3 DP to a n^2 DP.
				// maxFixJ1[i][j] is the max(dp[i][0], dp[i][1], ..., dp[i][j])
				// maxFixJ2[i][j] is the max(dp[0][j], dp[1][j], ..., dp[i][j])
				int[][] maxFixJ1 = new int[n+1][n+1];
				int[][] maxFixJ2 = new int[n+1][n+1];

				// Go through all problem states.
				for (int i=0; i<=n; i++) {
					for (int j=0; j<=n; j++) {

						// The answer here is 0 since no shots have been fired.
						if (i == 0 && j == 0) continue;

						// Here J1 blocked shot i, so calculate the latest previous shot he could have blocked (last),
						// and then take the best answer of him block any shot last or before and J2 blocking shot j last.
						if (i > j) {
							int last = prev[0][i-1]+1;
							dp[i][j] = maxFixJ2[last][j] + 1;
						}

						// Symmetric case, J2 blocked j, so calculate the latest previous shot he could have blocked (last),
						// and then take the best answer of him blocking any shot last or before and J1 blocking shot i last.
						else if (i < j) {
							int last = prev[1][j-1] + 1;
							dp[i][j] = maxFixJ1[i][last] + 1;
						}

						// Special case - both jedi's block the same shot, so no +1, no benefit from the second jedi blocking
						// the same shot.
						else {
							int last = prev[0][i-1]+1;
							dp[i][j] = maxFixJ2[last][j];
						}

						// Update best seen so far.
						res = Math.max(dp[i][j], res);
						maxFixJ1[i][j] = j>0 ? Math.max(maxFixJ1[i][j-1], dp[i][j]) : dp[i][j];
						maxFixJ2[i][j] = i>0 ? Math.max(maxFixJ2[i-1][j], dp[i][j]) : dp[i][j];
					}
				}
			}

			// Ta da!
			System.out.println("Mission #"+loop+": "+(n-res)+"\n");
		}
	}

	// Returns an array such that res[i] is set to the maximum index j < i such that times[i] - times[j] >= wait.
	// If a jedi with a wait time of wait blocks shot i, the last possible shot he could have blocked before is res[i].
	public static int[] getPrev(int[] times, int wait) {

		// Initially assume there's no prior shot to be blocked.
		int n = times.length;
		int[] res = new int[n];
		Arrays.fill(res, -1);

		// Set up two pointers, low and high for a sweep.
		int low = 0, high = 0, last = -1;

		// Go till we're out of bounds.
		while (high < n) {

			// high pointer is too low, move it up. For now, last is the best we can do.
			if (times[high] - times[low] < wait) {
				res[high] = last;
				high++;
			}

			// low pointer is too low, move it up. We have a better valid answer for high, so store it.
			else {
				res[high] = low;
				last = low;
				low++;
			}
		}

		return res;
	}

	// Runs a greedy for one jedi
	public static int sim(int[] times, int wait) {
		int curT = 0, res = 0;

		// Go through each shot.
		for (int i=0; i<times.length; i++) {

			// Skip over already blocked shots and ones where the jedi isn't ready.
			if (curT > times[i]) continue;

			// Count this as a block, update this item as blocked
			// and update time jedi will be ready.
			res++;
			curT = times[i] + wait;
		}
		return res;
	}
}