#include <bits/stdc++.h>
using namespace std;
const int N = 60;
inline int read() {
  int w = 0, r = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') r = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    w = (w << 1) + (w << 3) + (ch ^ 48);
    ch = getchar();
  }
  return w * r;
}
int T, n;
int a[N], sum;
int main() {
  T = read();
  while (T--) {
    n = read();
    sum = 0;
    for (int i = 1; i <= n; i++) {
      a[i] = read();
      sum += a[i];
    }
    if (sum == 0) {
      puts("NO");
      continue;
    }
    puts("YES");
    sort(a + 1, a + 1 + n);
    if (sum > 0) {
      reverse(a + 1, a + 1 + n);
      for (int i = 1; i <= n; i++) {
        printf("%d ", a[i]);
      }
      puts("");
      continue;
    }
    if (sum < 0) {
      for (int i = 1; i <= n; i++) {
        printf("%d ", a[i]);
      }
      puts("");
      continue;
    }
  }
  return 0;
}
