#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(NULL);
  ios::sync_with_stdio(0);
  int z;
  cin >> z;
  while (z--) {
    int n;
    cin >> n;
    vector<int> v(n);
    int ans = 0;
    for (int i = 0; i < n; i++) {
      cin >> v[i];
      ans += v[i];
    }
    if (ans > 0) {
      sort(v.begin(), v.end());
      reverse(v.begin(), v.end());
      cout << "YES" << '\n';
    } else if (ans < 0) {
      sort(v.begin(), v.end());
      cout << "YES" << '\n';
    } else {
      cout << "NO";
    }
    for (int i = 0; i < n; i++) {
      if (ans != 0) {
        cout << v[i] << " ";
      } else {
      }
    }
    cout << '\n';
  }
  return 0;
}
