#include <bits/stdc++.h>
using namespace std;
int main() {
  int tt;
  cin >> tt;
  while (tt--) {
    vector<int> v1, v2;
    int sum1 = 0, sum2 = 0;
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
      int val;
      cin >> val;
      if (val < 0) {
        v1.push_back(val);
        sum1 += -val;
      } else {
        v2.push_back(val);
        sum2 += val;
      }
    }
    sort(v2.begin(), v2.end());
    reverse(v2.begin(), v2.end());
    if (sum1 == sum2) {
      cout << "NO" << endl;
      continue;
    }
    if (sum1 > sum2) {
      cout << "YES" << endl;
      for (int i = 0; i < v1.size(); i++) cout << v1[i] << " ";
      for (int i = 0; i < v2.size(); i++) cout << v2[i] << " ";
      cout << endl;
      continue;
    } else {
      cout << "YES" << endl;
      for (int i = 0; i < v2.size(); i++) cout << v2[i] << " ";
      for (int i = 0; i < v1.size(); i++) cout << v1[i] << " ";
      cout << endl;
      continue;
    }
  }
  return 0;
}
