#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010, maxm = maxn * 2;
int h[maxn], ne[maxm], e[maxm], cnt;
int d[maxn], dp[maxn][3], w[maxn], root;
int a[maxn];
int vis[maxn];
void solve() {
  int T;
  scanf("%d", &T);
  while (T--) {
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
    }
    for (int i = 1; i < n; i += 2) {
      cout << -a[i + 1] << " " << a[i] << " ";
    }
    cout << endl;
  }
  return;
}
int main() {
  solve();
  return 0;
}
