#include <bits/stdc++.h>
using namespace std;
inline void read(int &x) {
  int v = 0, f = 1;
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-')
    f = -1;
  else
    v = (c & 15);
  while (isdigit(c = getchar())) v = (v << 1) + (v << 3) + (c & 15);
  x = v * f;
}
inline void read(long long &x) {
  long long v = 0ll, f = 1ll;
  char c = getchar();
  while (!isdigit(c) && c != '-') c = getchar();
  if (c == '-')
    f = -1;
  else
    v = (c & 15);
  while (isdigit(c = getchar())) v = (v << 1) + (v << 3) + (c & 15);
  x = v * f;
}
inline void readc(char &x) {
  char c;
  while (((c = getchar()) == ' ') || c == '\n')
    ;
  x = c;
}
int n, t, i, j, a[55];
int main() {
  read(t);
  while (t--) {
    int sum = 0;
    read(n);
    for (((i)) = (1); ((i)) <= ((n)); ((i))++) {
      read(a[i]);
      sum += a[i];
    }
    if (sum == 0) {
      puts("NO");
    } else {
      puts("YES");
      sort(a + 1, a + n + 1);
      if (sum > 0) reverse(a + 1, a + n + 1);
      for (((i)) = (1); ((i)) <= ((n)); ((i))++) printf("%d ", a[i]);
      puts("");
    }
  }
  return 0;
}
