#include <bits/stdc++.h>
using namespace std;
template <typename T>
void read(T &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  x *= f;
}
inline void write(int x) {
  if (x < 0) x = -x, putchar('-');
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
int n, a[55], sz, sf;
inline void solve() {
  int i;
  read(n), sz = sf = 0;
  for (i = 1; i <= n; ++i)
    read(a[i]), sz += (a[i] > 0 ? 1 : 0) * a[i],
        sf -= (a[i] <= 0 ? 1 : 0) * a[i];
  if (sz == sf)
    puts("NO");
  else {
    puts("YES");
    sort(a + 1, a + n + 1);
    if (sz > sf) {
      reverse(a + 1, a + n + 1);
    }
    for (i = 1; i <= n; ++i) write(a[i]), putchar(i < n ? ' ' : '\n');
  }
}
int main() {
  int T;
  read(T);
  while (T--) solve();
  return 0;
}
