#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC optimize("unroll-loops,rename-registers")
using namespace std;
using ll = long long;
using ld = long double;
using VectorType = ld;
using ull = unsigned long long;
const ll INF = 1e15;
const ld eps = 1e-9;
const ld pi = atan2(0, -1);
const ll mod = 1e9 + 7;
const ll P = 179, Q = 239;
const ll A = 10;
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
ll sign(ll a) {
  if (a < 0) return -1;
  if (a == 0) return 0;
  return 1;
}
bool equal(ld a, ld b) { return abs(a - b) < 1e-3; }
struct query {
  ll l, r, i;
  query(ll l = 0, ll r = 0, ll i = 0) : l(l), r(r), i(i){};
};
bool mini(ll &a, ll b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
bool maxi(ll &a, ll b) {
  if (b > a) {
    a = b;
    return true;
  }
  return false;
}
bool mini(ld &a, ld b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
ll mmax(ll a, ll b) {
  if (a > b) return a;
  return b;
}
ll mmin(ll a, ll b) {
  if (a < b) return a;
  return b;
}
ld mmax(ld a, ld b) {
  if (a > b) return a;
  return b;
}
ld mmin(ld a, ld b) {
  if (a < b) return a;
  return b;
}
bool maxi(ld &a, ld b) {
  if (b > a) {
    a = b;
    return true;
  }
  return false;
}
ll sub(ll a, ll b) {
  a -= b;
  if (a < 0) {
    a += mod;
  }
  return a;
}
ll add(ll a, ll b) {
  a += b;
  if (a > mod) {
    a -= mod;
  }
  return a;
}
ll mul(ll a, ll b) { return (a * b) % mod; }
ll n, m;
ll k;
vector<vector<ll>> vec;
vector<bool> used;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> m;
  while (m--) {
    cin >> n;
    vector<ll> a(n);
    for (auto &x : a) {
      cin >> x;
    }
    for (int i = n - 1; i >= n / 2; --i) {
      cout << a[i] * -1 << ' ';
    }
    for (int i = n / 2 - 1; i >= 0; --i) {
      cout << a[i] << ' ';
    }
    cout << '\n';
  }
  return 0;
}
