#include <bits/stdc++.h>
using namespace std;
struct margin {
  int left, right;
};
int main() {
  int test;
  cin >> test;
  while (test--) {
    int n;
    cin >> n;
    int arr[n], i = 0, sum = 0;
    while (i < n) {
      cin >> arr[i];
      sum += arr[i];
      i++;
    }
    sort(arr, arr + n);
    if (sum > 0) {
      int i = n - 1;
      cout << "YES" << endl;
      while (i >= 0) {
        cout << arr[i] << " ";
        i--;
      }
      cout << endl;
    } else if (sum < 0) {
      int i = 0;
      cout << "YES" << endl;
      while (i < n) {
        cout << arr[i] << " ";
        i++;
      }
      cout << endl;
    } else
      cout << "NO" << endl;
  }
  return 0;
}
