// Arup Guha
// 9/2/2016

// My original but too solution to 2016 UCF Locals Problem: Jedi and the Galactic Empire
// I used this to come up with my posted solution jedi.java. The original DP is an n^3 DP
// The inner loop in this DP just finds that maximum of a set of elements of the form
// dp[i][0], dp[i][1], ..., dp[i][j] or the set of elements dp[0][j], dp[1][j],..., dp[i][j].
// So, took this and added extra storage arrays to store all of these 2n^2 maximum values.

import java.util.*;

public class jedi2 {

	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, 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 0 was i, and jedi 1 was j.
				int[][] dp = new int[n+1][n+1];
				dp[1][2] = 2;
				dp[2][1] = 2;

				for (int i=1; i<=n; i++)
					dp[i][i] = 1;

				// Go through all problem states.
				for (int i=0; i<=n; i++) {
					for (int j=0; j<=n; j++) {

						// States that have been filled in or aren't valid.
						if (i == j || dp[i][j] != 0) continue;

						// Jedi J1 blocks shot i last
						if (i > j) {

							int last = prev[0][i-1]+1;
							int tmp = dp[last][j] + 1;

							// Take the maximum over all the shots prior to i J1 could have blocked.
							for (int k=last-1; k>=0; k--)
								tmp = Math.max(tmp, dp[k][j]+1);
							dp[i][j] = tmp;

						}

						// Jedi J2 blocks shot j last.
						else {

							int last = prev[1][j-1] + 1;
							int tmp = dp[i][last] + 1;

							// Same here, take the maximum over all shots prior to j J2 could have blocked.
							for (int k=last-1; k>=0; k--)
								tmp = Math.max(tmp, dp[i][k]+1);

							dp[i][j] = tmp;
						}

						// Update best seen so far.
						res = Math.max(dp[i][j], res);
					}
				}
			}

			// 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;
	}
}