// Arup Guha
// 6/19/2025
// Solution to Goldbach Conjecture (2)
// https://open.kattis.com/problems/goldbach2

using namespace std;
#include <bits/stdc++.h>

int main() {

    // Run prime sieve.
    vector<bool> isPrime(32001, true);
    for (int i=2; i*i<isPrime.size(); i++)
        for (int j=2*i; j<isPrime.size(); j+=i)
            isPrime[j] = false;

    int nC;
    cin >> nC;

    // Process cases.
    for (int loop=0; loop<nC; loop++) {

        // Get query.
        int x;
        cin >> x;

        // Store smaller values here.
        vector<int> res;

        // Check every possible smaller value.
        for (int i=2; i<=x/2; i++)
            if (isPrime[i] && isPrime[x-i])
                res.push_back(i);

        // Output size.
        cout << x << " has " << res.size() << " representation(s)" << endl;

        // Run through list of smaller ones and print corresponding pair.
        for (int i=0; i<res.size(); i++)
            cout << res[i] << "+" << (x-res[i]) << endl;
        cout << endl;
    }

    return 0;
}
