#include <bits/stdc++.h>
using namespace std;
void Speed() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
struct xi {
  long long a, b;
};
const int XS = 1e3 + 12;
const int second = 1e4 + 12;
const int M = 1e5 + 12;
const int L = 1e6 + 12;
const int XL = 1e7 + 12;
const long long INF1 = 1e9 + 7;
const long long INF2 = 1e12 + 7;
long long T, n;
void Tramp() {
  cin >> n;
  long long a[n + 12], b[n + 12];
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= n; ++i) {
    if (i & 1) {
      b[i] = a[i + 1] * (-1);
      b[i + 1] = a[i];
    }
  }
  for (int i = 1; i <= n; ++i) cout << b[i] << " ";
  cout << "\n";
}
int main() {
  Speed();
  cin >> T;
  while (T--) Tramp();
}
