#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > p;
int a[1000];
int main() {
  int a1, b, c, l;
  cin >> a1;
  for (int i = 0; i < a1; i++) {
    cin >> b;
    p.clear();
    l = 0;
    for (int i = 0; i < b; i++) {
      cin >> c;
      p.push_back(make_pair(c, i));
    }
    sort(p.begin(), p.end());
    do {
      a[p[l].second] = p[p.size() - l - 1].first;
      a[p[p.size() - l - 1].second] = -1 * (p[l].first);
      l++;
    } while (p.size() - (2 * l) > 1);
    for (int i = 0; i < p.size(); i++) {
      cout << a[i] << " ";
    }
    cout << '\n';
  }
  return 0;
}
