#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
using namespace std;
const long long inf = 1000000000000000000;
const long long KOK = 100000;
const long long LOG = 30;
const long long li = 500005;
const long long mod = 1000000007;
int n, m, b[li], a[li], k, flag, t;
int cev;
string s;
vector<int> v;
int main(void) {
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    sort(a + 1, a + n + 1);
    cev = 0;
    flag = 0;
    for (int i = 1; i <= n; i++) {
      cev += a[i];
      if (cev == 0) flag = 1;
    }
    if (flag) {
      reverse(a + 1, a + n + 1);
      flag = 0;
      cev = 0;
      for (int i = 1; i <= n; i++) {
        cev += a[i];
        if (cev == 0) flag = 1;
      }
      if (flag)
        printf("NO\n");
      else {
        printf("YES\n");
        for (int i = 1; i <= n; i++) printf("%d ", a[i]);
        printf("\n");
      }
    } else {
      printf("YES\n");
      for (int i = 1; i <= n; i++) printf("%d ", a[i]);
      printf("\n");
    }
  }
  return 0;
}
