#include <bits/stdc++.h>
using namespace std;
int t, n, a[105], vis[105][10005], pre[10005];
signed main() {
  cin >> t;
  while (t--) {
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= n / 2; i++) {
      printf("%d ", -a[i + n / 2]);
    }
    for (int i = n / 2 + 1; i <= n; i++) {
      printf("%d ", a[i - n / 2]);
    }
    puts("");
  }
}
