#include <bits/stdc++.h>
using namespace std;
int t, n;
int arr[6] = {6, 10, 14, 15, 21, 22};
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cin >> t;
  while (t--) {
    cin >> n;
    int last, nr1, nr2, nr3;
    bool found = false;
    for (int i = 0; i < 6; ++i) {
      for (int j = i + 1; j < 6; ++j) {
        for (int k = j + 1; k < 6; ++k) {
          last = n - arr[i] - arr[j] - arr[k];
          if (last == arr[i] || last == arr[j] || last == arr[k] || last <= 0)
            continue;
          else {
            nr1 = arr[i];
            nr2 = arr[j];
            nr3 = arr[k];
            found = true;
            break;
          }
        }
        if (found) break;
      }
      if (found) break;
    }
    if (found) {
      cout << "YES\n" << nr1 << " " << nr2 << " " << nr3 << " " << last << "\n";
    } else
      cout << "NO\n";
  }
  return 0;
}
