#include <bits/stdc++.h>
using namespace std;
void solve() {
  int ar[6];
  ar[0] = 6;
  ar[1] = 10;
  ar[2] = 14;
  ar[3] = 15;
  ar[4] = 21;
  ar[5] = 35;
  ar[6] = 22;
  int n;
  cin >> n;
  for (int i = 0; i < 7; i++) {
    for (int j = i + 1; j < 7; j++) {
      for (int k = j + 1; k < 7; k++) {
        int sum = ar[i] + ar[j] + ar[k];
        int rem = n - sum;
        if (rem > 0 && rem != ar[i] && rem != ar[j] && rem != ar[k]) {
          cout << "YES" << endl;
          cout << ar[i] << " " << ar[j] << " " << ar[k] << " " << rem << endl;
          return;
        }
      }
    }
  }
  cout << "NO" << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
