#include <bits/stdc++.h>
int main() {
  using namespace std;
  ios_base::sync_with_stdio(false), cin.tie(nullptr);
  int T;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    vector<int> mynumber(n);
    for (int i = 0; i < n; i++) {
      cin >> mynumber[i];
    }
    int total = mynumber[0];
    string ans = "YES";
    int totalVal = accumulate(mynumber.begin(), mynumber.end(), 0);
    if (totalVal == 0) {
      cout << "NO" << endl;
    } else if (totalVal < 0) {
      cout << "YES" << endl;
      sort(mynumber.begin(), mynumber.end());
      for (int i = 0; i < n; i++) {
        cout << mynumber[i];
        if (i != n - 1) cout << " ";
      }
      cout << endl;
    } else {
      cout << "YES" << endl;
      sort(mynumber.begin(), mynumber.end(), greater<int>());
      for (int i = 0; i < n; i++) {
        cout << mynumber[i];
        if (i != n - 1) cout << " ";
      }
      cout << endl;
    }
  }
}
