#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
constexpr char nl = '\n';
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using intp = pair<int, int>;
using intpp = pair<int, pair<int, int>>;
using llp = pair<ll, ll>;
using llpp = pair<ll, pair<ll, ll>>;
inline void prepare() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
}
inline void solve() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i += 2) {
    int a;
    int b;
    cin >> a >> b;
    cout << b << ' ' << -a << ' ';
  }
  cout << nl;
}
int main() {
  prepare();
  int t;
  cin >> (t);
  ;
  for (int i = 0; i < t; i++) {
    solve();
  }
  return 0;
}
