// Arup Guha
// 3/7/2015
// Solution to 2016 UCF HS Problem: Disc Jockey

import java.util.*;

public class disc {

	public static int n;
	public static int[] values;

	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 input.
			n = stdin.nextInt();
			values = new int[n];
			for (int i=0; i<n; i++)
				values[i] = stdin.nextInt();

			// Set up and solve...
			boolean[] used = new boolean[n];
			int[] perm = new int[n];
			System.out.println("Wave #"+loop+": "+solve(perm, used, 0));
		}
	}

	public static int solve(int[] perm, boolean[] used, int k) {

		// We're done with this permutation, evaluate it.
		if (k == n) return eval(perm);

		int res = 0;

		// Try each new item in slot k.
		for (int i=0; i<n; i++) {
			if (!used[i]) {

				// Mark it and recurse.
				used[i] = true;
				perm[k] = i;
				res = Math.max(res, solve(perm, used, k+1));

				// This is really important!
				used[i] = false;
			}
		}

		// Ta da!
		return res;
	}

	// Returns the sum of gaps for this permutation.
	public static int eval(int[] perm) {

		// Add up each gap...
		int res = 0;
		for (int i=0; i<n-1; i++)
			res += Math.abs(values[perm[i+1]]-values[perm[i]]);
		return res;
	}
}