// Arup Guha
// 3/13/2018
// Solution to 2018 UCF HS Contest Problem: Sum Tones

import java.util.*;
import java.io.*;

public class tone {

	public static void main(String[] args) throws Exception {

		BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
		int nC = Integer.parseInt(stdin.readLine().trim());

		// Process each case.
		for (int loop=1; loop<=nC; loop++) {

			// Read input.
			int n = Integer.parseInt(stdin.readLine().trim());
			long[] vals = new long[n];
			StringTokenizer tok = new StringTokenizer(stdin.readLine());
			for (int i=0; i<n; i++)
				vals[i] = Long.parseLong(tok.nextToken());

			// Output the result.
			System.out.println("Song #"+loop+": "+solve(vals));
		}
	}

	public static long solve(long[] vals) {

		int n = vals.length;

		// Root node.
		node tree = new node(0);
		int res = 0;

		// Go through each item.
		for (int i=0; i<n; i++) {

			// Smallest thing we can add to get a power to two.
			long pow2 = Long.highestOneBit(vals[i]) << 1;
			long base = pow2 - vals[i];

			// Update the result at this node - ie, the best sequence ending here.
			int myans = tree.getBest(base, totalBits(pow2)-totalBits(base)-1) + 1;
			node tmp = tree.insert(vals[i]);
			tmp.res = myans;

			// Update our global result, if necessary.
			res = Math.max(res, tmp.res);
		}

		return res;
	}

	// Returns the total number of bits in n (no leading 0s), assumes n is positive.
	public static int totalBits(long n) {
		int res = 0;
		while (n > 0) {
			res++;
			n >>= 1;
		}
		return res;
	}
}

class node {

	public int res;
	public node zero;
	public node one;

	// val is max DP answer, initially.
	public node(int val) {
		res = val;
		zero = null;
		one = null;
	}

	public node insert(long val) {

		// End of value.
		if (val == 1) {

			// Make our new node.
			if (one == null)
				one = new node(1);

			return one;
		}

		// Recursively insert to the right.
		if ((val & 1) == 1) {
			if (one == null) one = new node(0);
			return one.insert(val>>1);
		}

		// Or to the left.
		else {
			if (zero == null) zero = new node(0);
			return zero.insert(val>>1);
		}
	}

	public int getBest(long path, int skip) {

		node tmp = this;

		// First crawl down path.
		while (path != 0) {

			// Go where next bit is.
			if ((path&1) == 1) 	tmp = tmp.one;
			else 				tmp = tmp.zero;

			// Avoid null ptr error.
			if (tmp == null) return 0;

			// Advance to next bit.
			path >>= 1;
		}

		// Crawl down zero side, looking for best answer amongst 1s.
		int retval = tmp.res;

		// Now, we must skip this many 0s.
		for (int i=0; i<skip; i++) {
			tmp = tmp.zero;
			if (tmp == null) return retval;
		}

		// Look for best previous result down this path of 1s.
		while (tmp != null) {
			if (tmp.one != null) retval = Math.max(retval, tmp.one.res);
			tmp = tmp.one;
		}

		// Ta da!
		return retval;
	}
}