#include <bits/stdc++.h>
template <class T>
bool ckmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool ckmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
using namespace std;
using namespace chrono;
void solve() {
  int64_t n;
  cin >> n;
  vector<int64_t> arr(n);
  for (auto& x : arr) cin >> x;
  for (int64_t i = 0; i < n; i += 2) {
    cout << -arr[i + 1] << " " << arr[i] << " ";
  }
  cout << '\n';
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  auto start1 = high_resolution_clock::now();
  int64_t t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  auto stop1 = high_resolution_clock::now();
  auto duration = duration_cast<microseconds>(stop1 - start1);
  return 0;
}
