#include <bits/stdc++.h>
using namespace std;
long long tree[1000005 * 4] = {0};
long long lazy[1000005 * 4] = {0};
long long a[] = {1, 3, 2, 4, 5, 6, 7};
void buildTree(int node, int st, int e) {
  if (st == e) {
    tree[node] = a[st];
    return;
  }
  int mid = (st + e) / 2;
  buildTree(2 * node + 1, st, mid);
  buildTree(2 * node + 2, mid + 1, e);
  tree[node] = tree[2 * node + 1] + tree[2 * node + 2];
}
void updateRange(int node, int st, int e, int l, int r, int val) {
  if (lazy[node]) {
    tree[node] += (e - st + 1) * lazy[node];
    if (st != e) {
      lazy[2 * node + 1] += lazy[node];
      lazy[2 * node + 2] += lazy[node];
    }
    lazy[node] = 0;
  }
  if (st > e || st > r || e < l) {
    return;
  }
  if (st >= l && e <= r) {
    tree[node] += (e - st + 1) * val;
    if (st != e) {
      lazy[2 * node + 1] += val;
      lazy[2 * node + 2] += val;
    }
    return;
  }
  int mid = (st + e) / 2;
  updateRange(2 * node + 1, st, mid, l, r, val);
  updateRange(2 * node + 2, mid + 1, e, l, r, val);
  tree[node] = tree[2 * node + 1] + tree[2 * node + 2];
}
int queryRange(int node, int st, int e, int l, int r) {
  if (st > e || st > r || e < l) return 0;
  if (lazy[node] != 0) {
    tree[node] += (e - st + 1) * lazy[node];
    if (st != e) {
      lazy[2 * node + 1] += lazy[node];
      lazy[2 * node + 2] += lazy[node];
    }
    lazy[node] = 0;
  }
  if (st >= l && e <= r) {
    return tree[node];
  }
  int mid = (st + e) / 2;
  int p1 = queryRange(2 * node + 1, st, mid, l, r);
  int p2 = queryRange(2 * node + 2, mid + 1, e, l, r);
  return p1 + p2;
}
int BIT[1000005];
void updateBIT(int idx, int n) {
  for (; idx <= n; idx += idx & (-idx)) {
    BIT[idx] += a[idx];
  }
}
int queryBIT(int idx, int n) {
  int val = 0;
  for (; idx > 0; idx -= idx & (-idx)) {
    val += BIT[idx];
  }
  return val;
}
int main() {
  int T;
  int x, y, z;
  scanf("%d", &T);
  for (int tc = 1; tc <= T; tc++) {
    int n;
    cin >> n;
    int neg = 0, pos = 0;
    vector<int> ng, po, ze;
    for (int i = 0; i < n; i++) {
      cin >> x;
      if (x < 0) {
        neg += abs(x);
        ng.push_back(x);
      } else if (x > 0) {
        pos += x;
        po.push_back(x);
      } else {
        ze.push_back(x);
      }
    }
    if (neg != pos) {
      cout << "YES\n";
      if (neg > pos) {
        for (int i = 0; i < ng.size(); i++) {
          cout << ng[i] << " ";
        }
        for (int i = 0; i < po.size(); i++) {
          cout << po[i] << " ";
        }
      } else {
        for (int i = 0; i < po.size(); i++) {
          cout << po[i] << " ";
        }
        for (int i = 0; i < ng.size(); i++) {
          cout << ng[i] << " ";
        }
      }
      for (int i = 0; i < ze.size(); i++) {
        cout << ze[i] << " ";
      }
      cout << endl;
    } else {
      cout << "NO\n";
    }
  }
  return 0;
}
