// Arup Guha
// 1/17/2018
// Solution to 2013 NAQ Problem: Goldbach Conjecture.

import java.util.*;

public class goldbach {

	public static void main(String[] args) {

		// Run prime sieve.
		boolean[] sieve = new boolean[32001];
		Arrays.fill(sieve, true);
		for (int i=2; i<sieve.length; i++)
			for (int j=2*i; j<sieve.length; j+=i)
				sieve[j] = false;

		Scanner stdin = new Scanner(System.in);
		int nC = stdin.nextInt();

		// Process each case.
		for (int loop=0; loop<nC; loop++) {

			int n = stdin.nextInt();

			// Try each possible solution.
			int numSol = 0;
			ArrayList<Integer> sols = new ArrayList<Integer>();
			for (int i=2; i<=n/2; i++)
				if (sieve[i] && sieve[n-i])
					sols.add(i);

			// Print them out.
			System.out.println(n+" has "+sols.size()+" representation(s)");
			for (int i=0; i<sols.size(); i++)
				System.out.println((sols.get(i))+"+"+(n-sols.get(i)));

			// Just in between cases.
			if (loop < nC-1) System.out.println();
		}
	}
}