Naruto has sneaked into the Orochimaru's lair and is now looking for Sasuke. There are $T$ rooms there. Every room has a door into it, each door can be described by the number $n$ of seals on it and their integer energies $a_1$, $a_2$, ..., $a_n$. All energies $a_i$ are nonzero and do not exceed $100$ by absolute value. Also, $n$ is even.

In order to open a door, Naruto must find such $n$ seals with integer energies $b_1$, $b_2$, ..., $b_n$ that the following equality holds: $a_{1} \cdot b_{1} + a_{2} \cdot b_{2} + ... + a_{n} \cdot b_{n} = 0$. All $b_i$ must be nonzero as well as $a_i$ are, and also must not exceed $100$ by absolute value. Please find required seals for every room there.


-----Input-----

The first line contains the only integer $T$ ($1 \leq T \leq 1000$) standing for the number of rooms in the Orochimaru's lair. The other lines contain descriptions of the doors.

Each description starts with the line containing the only even integer $n$ ($2 \leq n \leq 100$) denoting the number of seals.

The following line contains the space separated sequence of nonzero integers $a_1$, $a_2$, ..., $a_n$ ($|a_{i}| \leq 100$, $a_{i} \neq 0$) denoting the energies of seals.


-----Output-----

For each door print a space separated sequence of nonzero integers $b_1$, $b_2$, ..., $b_n$ ($|b_{i}| \leq 100$, $b_{i} \neq 0$) denoting the seals that can open the door. If there are multiple valid answers, print any. It can be proven that at least one answer always exists.


-----Example-----
Input
2
2
1 100
4
1 2 3 6

Output
-100 1
1 1 1 -1



-----Note-----

For the first door Naruto can use energies $[-100, 1]$. The required equality does indeed hold: $1 \cdot (-100) + 100 \cdot 1 = 0$.

For the second door Naruto can use, for example, energies $[1, 1, 1, -1]$. The required equality also holds: $1 \cdot 1 + 2 \cdot 1 + 3 \cdot 1 + 6 \cdot (-1) = 0$.

Difficulty: EASY
Tags: Mathematics

Constructive algorithms

Starter code:

Solutions:
for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = []
	for i in range(n // 2):
		b.append(a[2 * i + 1])
		b.append(-a[2 * i])
	print(*b)


def main():
	n = int(input())
	a = [int(x) for x in input().split()]
	b = [0] * n
	for i in range(0, n, 2):
		b[i] = a[i + 1]
		b[i + 1] = -a[i]
	print(*b)
t = int(input())
for k in range(t):
	main()


T = int(input())
for i in range(T):
	n = int(input())
	mas = list()
	mas = list(map(int, input().split()))
	for j in range(0, n - 1, 2):
		el1 = mas[j]
		el2 = mas[j + 1]
		print(int(el2 * el1 / el1), -int(el1 * el2 / el2), end=' ')
	print()


T = int(input())
result = []
for _ in range(T):
	n = int(input())
	a = [int(i) for i in input().split()]
	result.append([])
	for curr in range(0, len(a), 2):
		result[-1].append(a[curr + 1])
		result[-1].append(-a[curr])
for ans in result:
	print(' '.join([str(i) for i in ans]))


t = int(input())
for i in range(t):
	n = int(input())
	s = list(map(int, input().split()))
	for j in range(n - 1, -1, -1):
		if j % 2 == 0:
			print(s[j], end=' ')
		else:
			print(-1 * s[j], end=' ')
	print('', end='\n')


t = int(input())
for i in range(t):
	n = int(input())
	k = list(map(int, input().split()))
	for i in k[n // 2:]:
		print(i * -1, end=' ')
	for i in k[:n // 2]:
		print(i, end=' ')
	print()


T = int(input())
a = list()
for j in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	b = list()
	for i in range(0, n, 2):
		b += (-a[i + 1], a[i])
	print(' '.join(map(str, b)))


T = int(input())
for i in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	b = []
	for i2 in range(0, n - 1, 2):
		b += [-a[i2 + 1], a[i2]]
	print(*b)


from math import gcd
t = int(input())
for _ in range(t):
	lst = []
	n = int(input())
	a = list(map(int, input().split()))
	for j in range(0, n, 2):
		nok = a[j] * a[j + 1] // gcd(a[j], a[j + 1])
		b = nok // a[j]
		b1 = nok // a[j + 1] * -1
		lst += [b, b1]
	print(*lst)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	r = []
	for (i, item) in enumerate(reversed(a)):
		if i % 2 == 0:
			r.append(item * -1)
		else:
			r.append(item)
	print(' '.join(map(str, r)))


import sys
from collections import defaultdict, Counter as CC
from math import sqrt, ceil, floor, log2
INF = float('inf')
MOD = 10 ** 9 + 7
read = lambda : [int(s) for s in sys.stdin.readline().split()]

def solve():
	(n,) = read()
	a = read()
	res = []
	for i in range(0, n, 2):
		res.append(-a[i + 1])
		res.append(a[i])
	print(*res)
_ = 1
_ = int(input())
while _:
	solve()
	_ -= 1


for i in range(int(input())):
	n = int(input())
	sp = input().split()
	sp1 = []
	for j in range(0, n, 2):
		a = int(sp[j])
		b = int(sp[j + 1])
		sp1.append(str(-1 * b))
		sp1.append(str(a))
	print(' '.join(sp1))


T = int(input())
s = ''
for i in range(T):
	pech = int(input())
	p = input()
	k = p.split()
	for j in range(pech // 2):
		a = int(k[j * 2])
		b = int(k[j * 2 + 1])
		s += f'{-b} {a} '
	s += '\n'
print(s)


t = int(input())
for i in range(t):
	n = int(input())
	l = [int(j) for j in input().split()]
	s = ''
	for a in range(n):
		if a % 2 == 0:
			s += str(-l[a + 1]) + ' '
		else:
			s += str(l[a - 1]) + ' '
	print(s)


import sys
import math

def scan(input_type='int'):
	return list(map(int, sys.stdin.readline().strip().split()))

def solution():
	for _ in range(int(input())):
		n = int(input())
		a = scan()
		b = []
		c = []
		for i in range(n):
			if i % 2 == 0:
				b.append(a[i])
			else:
				c.append(a[i])
		j = 0
		k = 0
		for i in range(n):
			if i % 2 == 0:
				a[i] = -c[j]
				j += 1
			else:
				a[i] = b[k]
				k += 1
		for i in a:
			print(i, end=' ')
		print()
solution()


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	for i in range(0, len(arr), 2):
		(arr[i], arr[i + 1]) = (-arr[i + 1], arr[i])
	print(' '.join(map(str, arr)))


t = int(input())
s = ''
for i in range(t):
	n = int(input())
	g = list(input().split())
	for j in range(0, n, 2):
		a = int(g[j])
		b = int(g[j + 1])
		s += str(-b) + ' '
		s += str(a) + ' '
	s += '\n'
print(s)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = [int(i) for i in input().split()]
	brr = [abs(arr[i]) for i in range(n - 1, -1, -1)]
	for i in range(n // 2):
		if arr[i] * brr[i] < 0 and arr[n - 1 - i] * brr[n - 1 - i] < 0:
			brr[n - 1 - i] = -1 * brr[n - 1 - i]
		elif arr[i] * brr[i] > 0 and arr[n - 1 - i] * brr[n - 1 - i] > 0:
			brr[n - 1 - i] = -1 * brr[n - 1 - i]
	print(*brr)


komnati = int(input())
n = [0] * komnati
pechati_1 = [0] * komnati
pechati_2 = []
for i in range(komnati):
	n[i] = int(input())
	pechati_1[i] = list(map(int, input().split()))
for i in range(komnati):
	for j in range(0, n[i] - 1, 2):
		if pechati_1[i][j + 1] % pechati_1[i][j] == 0:
			pechati_2.append(-1 * (pechati_1[i][j + 1] // pechati_1[i][j]))
			pechati_2.append(1)
		elif pechati_1[i][j] % pechati_1[i][j + 1] == 0:
			pechati_2.append(1)
			pechati_2.append(-1 * (pechati_1[i][j] // pechati_1[i][j + 1]))
		else:
			pechati_2.append(-1 * pechati_1[i][j + 1])
			pechati_2.append(pechati_1[i][j])
	for j in range(n[i]):
		pechati_2[j] = str(pechati_2[j])
	print(' '.join(pechati_2))
	pechati_2 = []


for _ in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	ans = [0 for i in range(n)]
	for i in range(n // 2):
		ans[i] = -a[n - 1 - i]
		ans[n - 1 - i] = a[i]
	for i in ans:
		print(i, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	b = []
	f = 1
	for i in range(0, n, 2):
		b += [-a[i + 1], a[i]]
	print(*b)


def tri(a, b, c):
	return [b * c, -a, -a]

def sum_of(a, k):
	s = 0
	for i in range(len(a)):
		s += a[i] * k[i]
	return s

def pair(a, b):
	if a != b:
		return [b, -a]
	else:
		return [1, -1]
T = int(input())
rooms = []
rooms_k = []
for i in range(T):
	n = int(input())
	pech = [int(i) for i in input().split(' ')]
	rooms.append(pech)
	rooms_k.append([1 for i in pech])
for i in range(len(rooms)):
	if sum(rooms[i]) == 0:
		pass
	elif len(rooms[i]) % 2 == 0:
		for j in range(0, len(rooms[i]) - 1, 2):
			(a, b) = pair(rooms[i][j], rooms[i][j + 1])
			rooms_k[i][j] = a
			rooms_k[i][j + 1] = b
	elif len(rooms[i]) == 3:
		(a, b, c) = tri(rooms[i][0], rooms[i][1], rooms[i][2])
		rooms_k[i][0] = a
		rooms_k[i][1] = b
		rooms_k[i][2] = c
	else:
		for j in range(0, len(rooms[i]) - 3, 2):
			(a, b) = pair(rooms[i][j], rooms[i][j + 1])
			rooms_k[i][j] = a
			rooms_k[i][j + 1] = b
		(a, b, c) = tri(rooms[i][-3], rooms[i][-2], rooms[i][-1])
		rooms_k[i][-3] = a
		rooms_k[i][-2] = b
		rooms_k[i][-1] = c
	print(' '.join([str(s) for s in rooms_k[i]]))


T = int(input())
for i in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	for j in range(0, n, 2):
		print(-a[j + 1], a[j], sep=' ', end=' ')
	print()


for _ in range(int(input())):
	stamps = int(input())
	forces = list(map(int, input().split()))
	firstHalf = []
	for stamp in forces[stamps // 2:]:
		firstHalf.append(-stamp)
	secondHalf = []
	for stamp in forces[:stamps // 2]:
		secondHalf.append(stamp)
	print(*firstHalf + secondHalf)


cases = int(input())
arr = []
for i in range(cases):
	n = int(input())
	arr.append(list(map(int, input().split(' ', n))))
for item in arr:
	result = []
	for i in range(0, len(item) - 1, 2):
		result.append(-item[i + 1])
		result.append(item[i])
	print(str(result).replace('[', '').replace(']', '').replace(',', ''))


for iii in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	for i in range(0, n - 1, 2):
		print(-lst[i + 1], end=' ')
		print(lst[i], end=' ')
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	b = []
	for i in range(n):
		b.append(0)
	for i in range(0, n, 2):
		b[i] = a[i + 1]
		b[i + 1] = a[i] * -1
	for i in range(n):
		print(b[i], end=' ')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	for j in range(0, n, 2):
		print(a[j + 1], -a[j], end=' ')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	p = input().split()
	p_1 = p[::-1]
	f = []
	c = 0
	while c != len(p):
		if c < len(p) // 2:
			f.append(str(int(p_1[c]) * -1))
		else:
			f.append(p_1[c])
		c += 1
	print(' '.join(f))


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	ans = []
	for i in range(n // 2, n):
		ans.append(-arr[i])
	for i in range(n // 2):
		ans.append(arr[i])
	print(*ans)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = []
	for i in range(0, n - 1, 2):
		if a[i] < 0 and a[i + 1] < 0:
			b.append(abs(a[i + 1]))
			b.append(a[i])
		elif a[i] < 0 and a[i + 1] > 0:
			b.append(a[i + 1])
			b.append(abs(a[i]))
		elif a[i] > 0 and a[i + 1] > 0:
			b.append(0 - a[i + 1])
			b.append(a[i])
		elif a[i] > 0 and a[i + 1] < 0:
			b.append(abs(a[i + 1]))
			b.append(a[i])
	print(*b)


sp1 = []
sp2 = []
n = int(input())
for i in range(0, n):
	sp1.append(int(input()))
	sp2.append(input().split())
for p in range(0, len(sp2)):
	for i in range(0, len(sp2[p]), 2):
		sp2[p][i + 1] = int(sp2[p][i + 1])
		(sp2[p][i + 1], sp2[p][i]) = (sp2[p][i], -1 * sp2[p][i + 1])
for i in sp2:
	print(*i)


for _ in range(int(input())):
	n = int(input())
	A = list(map(int, input().split()))
	m = []
	for i in range(len(A)):
		if i % 2 == 1:
			m.append(str(A[n - 1 - i]))
		else:
			m.append(str(-A[n - 1 - i]))
	print(' '.join(m))


rooms_num = int(input())
for _ in range(rooms_num):
	number_of_seals = int(input())
	list_of_seals_energies = list(map(int, input().split()))
	lst = []
	for (a, b) in zip(list_of_seals_energies[::2], list_of_seals_energies[1::2]):
		lst.append(b)
		lst.append(-a)
	print(*lst)


T = int(input())
lst = []
for i in range(T):
	lst1 = []
	n = int(input())
	lst2 = input().split(' ')
	for b in range(n // 2):
		lst1.append(str(int(lst2.pop(1)) * -1))
		lst1.append(str(int(lst2.pop(0))))
	lst.append(lst1)
for i in lst:
	print(' '.join(i))


ans_all = []
for t in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	ans = []
	for i in range(0, n, 2):
		ans.extend([-a[i + 1], a[i]])
	ans_all.append(ans)
for i in ans_all:
	print(*i)


t = int(input())
for i in range(t):
	a = []
	b = []
	n = int(input())
	s = input().split()
	for j in range(n):
		a.append(int(s[j]))
	for j in range(0, n, 2):
		b.append(a[j + 1] * -1)
		b.append(a[j])
	print(*b)


tests = int(input())
for test in range(tests):
	n = int(input())
	a = [int(i) for i in input().split()]
	b = [0] * n
	for i in range(n):
		if i % 2 == 0:
			b[i] = a[i + 1]
		else:
			b[i] = -a[i - 1]
	print(' '.join([str(i) for i in b]))


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	data = []
	dict = {}
	for el in range(len(arr)):
		data.append([arr[el], el])
	data.sort(key=lambda x: x[0])
	znak = -1
	for i in data:
		dict[n - i[1] - 1] = i[0]
	print()
	for i in range(n):
		print(dict[i] * znak, end=' ')
		znak = -znak


doors = int(input())
for i in range(doors):
	p = int(input())
	ps = [int(i) for i in input().split()]
	o = len(ps) - 1
	o2 = len(ps) // 2 - 1
	for i in range(p):
		if i < len(ps) // 2:
			print(ps[o] * -1, end=' ')
			o -= 1
		else:
			print(ps[o2], end=' ')
			o2 -= 1
		if i == p - 1:
			print()


y = []
for i in range(0, int(input())):
	l = int(input())
	s = list(map(int, input().split()))
	for i in range(0, len(s), 2):
		(s[i], s[i + 1]) = (-s[i + 1], s[i])
	print(*s, sep=' ')


def solve():
	n = int(input())
	stamps = list(map(int, input().split()))
	stamps.reverse()
	for stamp_index in range(n - 1):
		if stamp_index % 2 == 0:
			print(-stamps[stamp_index], end=' ')
		else:
			print(stamps[stamp_index], end=' ')
	print(stamps[-1] if n % 2 == 0 else -stamps[-1])

def main():
	for _ in range(int(input())):
		solve()
main()


from math import gcd
for i in range(int(input())):
	n = int(input())
	nums = [int(x) for x in input().split()]
	for i in range(0, n, 2):
		lcm = nums[i] * nums[i + 1] // gcd(nums[i], nums[i + 1])
		print(lcm // nums[i], -(lcm // nums[i + 1]), end=' ')
	print()


def main():
	a = int(input())
	A = list(map(int, input().split()))
	N = []
	if a % 2 == 0:
		for i in range(0, a, 2):
			N.append(A[i + 1])
			N.append(A[i] * -1)
	else:
		for i in range(0, a - 3, 2):
			N.append(A[i + 1])
			N.append(A[i] * -1)
		N.append(A[-2] * A[-1])
		N.append(A[-3] * A[-1])
		N.append(A[-2] * A[-3] * -2)
	for j in range(len(N)):
		print(N[j], end=' ')
c = int(input())
for i in range(c):
	main()


a = int(input())
res = list()
for i in range(0, a):
	b = int(input())
	room = list(map(int, input().split()))
	res.append(list())
	for j in range(0, b // 2):
		c = room[j * 2]
		d = room[j * 2 + 1]
		res[i].append(d * -1)
		res[i].append(c)
for i in range(0, a):
	for j in res[i]:
		print(j, end=' ')
	print('\n')


def md(x):
	return x / abs(x)
l = int(input())
a = []
for _ in range(l):
	k = int(input())
	n = map(int, input().split())
	a.append(list(n))
for door in a:
	r = []
	for seal in range(len(door) // 2):
		if md(door[seal]) == md(door[len(door) - seal - 1]):
			r.insert(0, abs(door[seal]))
		else:
			r.insert(0, -abs(door[seal]))
	for seal in range(len(door) // 2, len(door)):
		if md(door[seal]) == md(door[len(door) - seal - 1]):
			r.insert(0, -abs(door[seal]))
		else:
			r.insert(0, -abs(door[seal]))
	print(*r)


T = int(input())
ans = []
for i in range(T):
	n = int(input())
	mas = list(map(int, input().split()))
	m = []
	for i in range(0, n - 1, +2):
		a = mas[i]
		b = mas[i + 1]
		if b < 0 and a < 0 or (b > 0 and a > 0):
			m.append(-b)
			m.append(a)
		elif a < 0:
			m.append(-b)
			m.append(a)
		else:
			m.append(b)
			m.append(-a)
	ans.append(m)
for i in range(T):
	for j in range(len(ans[i])):
		print(ans[i][j], end=' ')
	print()


for l in [*open(0)][2::2]:
	q = [*map(int, l.split())]
	r = []
	for i in range(0, len(q), 2):
		r += [-q[i + 1], q[i]]
	print(*r)


for i in range(int(input())):
	n = int(input())
	x = input().split()
	arr = [-int(x[n - j]) if j <= n // 2 else int(x[n - j]) for j in range(1, n + 1)]
	print(*arr)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = []
	a1 = a[::-1]
	for i in range(n):
		if i < n // 2:
			b.append(a1[i] * -1)
		else:
			b.append(a1[i])
	print(*b)


rooms_amount = int(input())
locks = []
locks2 = []
locks3 = []
s = ''
for x in range(rooms_amount):
	locks_amount = int(input())
	for _ in range(1):
		room_locks = list(map(int, input().split()))
		locks.append(room_locks)
for i in range(0, rooms_amount):
	for j in range(0, len(locks[i])):
		locks3.append(1)
	locks2.append(locks3)
	locks3 = []
for i in range(0, rooms_amount):
	for j in range(0, len(locks2[i]) - 1, 2):
		locks2[i][j] = -locks[i][j + 1]
for i in range(0, rooms_amount):
	for j in range(1, len(locks[i]), 2):
		locks2[i][j] = locks[i][j - 1]
for i in range(0, rooms_amount):
	for j in range(0, len(locks2[i])):
		s = s + str(locks2[i][j]) + ' '
	print(s)
	s = ''


T = int(input())
for i in range(T):
	n = int(input())
	A = input().split()
	b = ''
	for j in range(0, n, 2):
		b = b + str(-1 * int(A[j + 1])) + ' ' + str(int(A[j])) + ' '
	print(b)


a = int(input())
b = {}
c = None
d = None
o = None
for i in range(a):
	c = int(input())
	b[i] = [int(i) for i in input().split()]
for i in b.values():
	for (j, k) in enumerate(i):
		if j % 2 == 0:
			continue
		d = k * -1
		o = i[j - 1]
		print(d, o, end=' ')
	print()


for i in range(int(input())):
	n = int(input()) // 2
	a = [int(i) for i in input().split()]
	for i in range(n):
		a[i] *= -1
	print(*a[::-1])


t = int(input())
c = []
for i in range(t):
	n = int(input())
	s = input()
	k = s.split()
	b = k[:]
	if n % 2 == 0:
		for j in range(1, n, 2):
			if int(k[j]) < 0 and int(k[j - 1]) < 0 or (int(k[j]) > 0 and int(k[j - 1]) > 0):
				b[j - 1] = int(k[j])
				b[j] = int(k[j - 1]) * -1
			else:
				b[j - 1] = int(k[j])
				b[j] = int(k[j - 1]) * -1
		c.append(b)
	else:
		sum = 0
		for j in range(1, n):
			sum += int(k[j])
			b[j] = int(k[j]) * int(k[0]) * -1
		b[0] = int(k[0]) * sum
		c.append(b)
for i in range(t):
	p = c[i]
	print(*p)


t = int(input())
for i in range(t):
	n = int(input())
	ans = []
	inp = list(map(int, input().split()))
	if n % 2 == 0:
		for j in range(n // 2):
			a1 = inp[j * 2]
			b1 = inp[j * 2 + 1] * -1
			ans.append(b1)
			ans.append(a1)
	else:
		for j in range(n // 2):
			a1 = inp[j * 2]
			b1 = inp[j * 2 + 1] * -1
			ans.append(b1)
			ans.append(a1)
		if abs(ans[-1] - inp[-1]) > 100:
			ans[-1] = ans[-1] + inp[-1]
			ans.append(inp[-2] * -1)
		else:
			ans[-1] = ans[-1] - inp[-1]
			ans.append(inp[-2])
	print(*ans)


t = int(input())
door = []
for i in range(t):
	n = int(input())
	now = list(map(int, input().split()))
	door.append(now)
for i in range(t):
	for j in range(0, len(door[i]) - 1, 2):
		now1 = -door[i][j + 1]
		now2 = door[i][j]
		print(now1, now2, sep=' ', end=' ')
	print()


for i in range(int(input())):
	n = int(input())
	s = list(map(int, input().split()))
	ans = []
	for j in range(0, n, 2):
		(a, b) = (s[j], s[j + 1])
		if a > 0 and b > 0 or (a < 0 and b < 0):
			ans += [-b, a]
		else:
			ans += [abs(b), abs(a)]
	print(*ans)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, str(input()).split()))
	for k in range(n // 2):
		a[k] = a[k] * -1
	a.reverse()
	print(*a)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	for i in range(0, n, 2):
		print(-a[i + 1], a[i], end=' ')
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = []
	for i in range(0, len(a), 2):
		b.append(-a[i + 1])
		b.append(a[i])
	print(' '.join(map(str, b)))


for k in range(0, int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	for i in range(0, n, 2):
		(a[i], a[i + 1]) = (-a[i + 1], a[i])
	print(*a, sep=' ')


t = int(input())
for i in range(t):
	b = ''
	n = int(input())
	a = list(map(int, input().split()))
	for j in range(0, n, 2):
		b += str(a[j + 1]) + ' ' + str(-a[j]) + ' '
	b = b[:len(b) - 1]
	print(b)


tc = int(input())
while tc > 0:
	n = int(input())
	arr = list(map(int, input().split()))
	newarr = []
	for i in range(0, n, 2):
		newarr.extend([str(-arr[i + 1]), str(arr[i])])
	print(' '.join(newarr))
	tc -= 1


a = int(input())
for i in range(a):
	n = int(input())
	s = [int(x) for x in input().split()]
	k = []
	for j in range(0, n, 2):
		k.append(-s[j + 1])
		k.append(s[j])
	print(*k)


def gcd(a, b):
	while b != 0:
		(a, b) = (b, a % b)
	return a
n = int(input())
for i in range(n):
	nn = int(input())
	a = list(map(int, input().split()))
	for j in range(0, nn, 2):
		nok = a[j] * a[j + 1] // gcd(a[j], a[j + 1])
		print(-nok // a[j], nok // a[j + 1], end=' ')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	s = input().split(' ')
	a = []
	for c in s:
		a.append(int(c))
	a.reverse()
	for i in range(n):
		if i % 2 == 0:
			a[i] = -a[i]
	for i in range(n):
		print(a[i], end=' ')
	print()


def main():
	T = int(input())
	for i in range(T):
		n = int(input())
		A = list(map(int, input().split()))
		B = []
		for i in range(n):
			if i < n / 2:
				B.append(-A[n - i - 1])
			else:
				B.append(A[n - i - 1])
		for item in B:
			print(item, end=' ')
main()


t = int(input())
for i in range(t):
	n = int(input())
	a = [int(i) for i in map(int, input().split())]
	a = a[::-1]
	for j in range(n // 2, n):
		a[j] *= -1
	print(*a)


def solution(door):
	i = 0
	door_len = len(door)
	result = ''
	while i < door_len:
		result += str(door[i + 1] * -1) + ' ' + str(door[i]) + ' '
		i += 2
	return result
T = int(input())
doors = []
for i in range(T):
	n = input()
	doors.append(list(map(int, input().split())))
for door in doors:
	print(solution(door))


t = int(input())
for i in range(t):
	n = int(input())
	l = input()
	L = l.split()
	for i in range(n):
		L[i] = int(L[i])
	ch = ''
	while L != []:
		if L[1] * L[0] > 0:
			ch = ch + '-' + str(abs(L[1])) + ' ' + str(abs(L[0])) + ' '
		else:
			ch = ch + str(abs(L[1])) + ' ' + str(abs(L[0])) + ' '
		del L[0]
		del L[0]
	print(ch)


t = int(input())
result = []
for i in range(t):
	n = int(input())
	strengths = list(map(int, input().split()))
	ans = [0] * n
	for j in range(n // 2):
		ans[2 * j] = str(-strengths[2 * j + 1])
		ans[2 * j + 1] = str(strengths[2 * j])
	result.append(ans)
for r in result:
	print(' '.join(r))


for k in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	minus = 0
	b = []
	for i in range(n - 1, -1, -1):
		b.append(abs(a[i]))
		if a[i] < 0:
			minus += 1
	for i in range(n // 2):
		if a[i] < 0 and a[n - 1 - i] < 0 or (a[i] > 0 and a[n - 1 - i] > 0):
			b[i] = -b[i]
	print(*b)


for i in range(int(input())):
	n = int(input())
	A = list(map(int, input().split()))
	for j in range(0, n, 2):
		print(-A[j + 1], A[j], end=' ')
	print()


t = int(input())
for i in range(0, t):
	b = []
	n = int(input())
	a = input().split()
	for i in range(0, n, 2):
		b.insert(i, int(a[i + 1]))
		b.insert(i + 1, -int(a[i]))
	print(*b)


import sys
input = lambda : sys.stdin.readline().rstrip()
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = [0] * n
	for j in range(n // 2):
		b[j] = a[-j - 1]
		b[-j - 1] = a[j] * -1
	print(*b)


n = int(input())
for i in range(n):
	k = int(input())
	a = list(map(int, input().split()))
	a.reverse()
	for l in range(len(a)):
		if l % 2 == 0:
			a[l] *= -1
		print(a[l], end=' ')
	print()


for __ in range(int(input())):
	n = int(input())
	ar = list(map(int, input().split()))
	ans = []
	for i in range(n):
		if i < n // 2:
			ans.append(ar[n - i - 1])
		else:
			ans.append(-ar[n - i - 1])
	print(*ans)


import math

def lcm(a, b):
	return a * b // math.gcd(a, b)
for _ in range(int(input())):
	am = int(input())
	arr = list(map(int, input().split()))
	out = [0] * am
	for i in range(am // 2):
		l = lcm(arr[i], arr[am - i - 1])
		out[i] = -(l // arr[i])
		out[am - 1 - i] = l // arr[am - 1 - i]
	print(*out)


import math

def flcm(a, b):
	return a * b // math.gcd(a, b)
T = int(input())
for _ in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	for i in range(n // 2):
		lcm = flcm(a[2 * i], a[2 * i + 1])
		print(-(lcm // a[2 * i]), lcm // a[2 * i + 1], end=' ')
	print()


T = int(input())
for i in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	d = []
	for i in range(0, len(a), 2):
		d.append(a[i + 1])
		d.append(-a[i])
	print(*d)


T = int(input())
for i in range(T):
	n = int(input())
	a = input().split(' ')
	b = []
	for j in range(n // 2):
		b.append(str(-int(a[j * 2 + 1])))
		b.append(str(int(a[j * 2])))
	print(' '.join(b))


def p(d):
	s = ''
	for i in range(0, len(d), 2):
		s += str(d[i + 1] * -1) + ' '
		s += str(d[i]) + ' '
	return s
a = int(input())
s = ''
for i in range(a):
	a = int(input())
	d = list(map(int, input().split()))
	s += p(d) + '\n'
print(s)


t = int(input())
for _ in range(t):
	n = int(input())
	stamps = list(map(int, input().split()))
	ans = []
	for i in range(1, n, 2):
		one = stamps[i - 1]
		two = stamps[i]
		ans.append(-two)
		ans.append(one)
	print(' '.join(map(str, ans)))


def nok(a, b):
	import math
	return a * b // math.gcd(a, b)
n = int(input())
for i in range(n):
	k = int(input())
	lst = list(map(int, input().split()))
	answer = []
	for j in range(0, k, 2):
		a = lst[j]
		b = lst[j + 1]
		g = nok(a, b)
		answer.append(g // a)
		answer.append(-g // b)
	print(*answer)


t = int(input())
for ti in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	for i in range(0, n, 2):
		(a[i], a[i + 1]) = (-a[i + 1], a[i])
	print(' '.join(map(str, a)))


a = int(input())
for i in range(a):
	k = input()
	s = str(input()).split(' ')
	s = [int(y) for y in s]
	le = len(s)
	for j in range(le // 2):
		if j == le // 2 - 1:
			print(s[j * 2 + 1], -s[j * 2])
		else:
			print(s[j * 2 + 1], -s[j * 2], end=' ')


import math

def lcm(a, b):
	import math
	return a * b // math.gcd(a, b)
T = int(input())
z = [0] * T
for i in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	for j in range(int(n / 2)):
		k = lcm(a[2 * j], a[2 * j + 1])
		a[2 * j] = int(k / a[2 * j])
		a[2 * j + 1] = int(-k / a[2 * j + 1])
	z[i] = a
for i in range(T):
	print(*z[i])


t = int(input())
for i in range(t):
	n = int(input())
	asl = input().split()
	al = []
	bl = ''
	for j in asl:
		al.append(int(j))
	for j in range(len(al)):
		if j % 2 == 0:
			bl += str(al[j + 1]) + ' '
			bl += str(-al[j]) + ' '
	print(bl)


T = int(input())
for _ in range(T):
	n = int(input())
	nums = list(map(int, input().split()))
	l = []
	for i in range(len(nums) // 2):
		l.append(-nums[-i - 1])
	for i in range(len(nums) // 2 - 1, -1, -1):
		l.append(nums[i])
	print(' '.join(map(str, l)))


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	ans = []
	for i in range(0, n - 1, 2):
		m = gcd(a[i], a[i + 1])
		ans.append(-(a[i + 1] // m))
		ans.append(a[i] // m)
	print(*ans)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = []
	for i in range(0, n - 1, 2):
		b.append(-a[i + 1])
		b.append(a[i])
	print(*b)


def nok2(a, b):
	m = a * b
	while a != 0 and b != 0:
		if a > b:
			a %= b
		else:
			b %= a
	return m // (a + b)

def get_comb(nums):
	nok = None
	ans = ''
	for i in range(1, len(nums), 2):
		nok = nok2(abs(nums[i - 1]), abs(nums[i]))
		a = nok // abs(nums[i - 1])
		b = nok // abs(nums[i])
		if nums[i] > 0 and nums[i - 1] > 0 or (nums[i] < 0 and nums[i - 1] < 0):
			ans = ans + str(a) + ' ' + str(-b) + ' '
		else:
			ans = ans + str(a) + ' ' + str(b) + ' '
	return ans.rstrip()
n = int(input())
for i in range(n):
	_ = int(input())
	print(get_comb([int(x) for x in input().split(' ')]))


amountOfRooms = int(input())
amountOfPrints = []
forceOfPrints = []
for i in range(0, amountOfRooms):
	amountOfPrints.append(int(input()))
	forceOfPrints.append(list(map(int, input().split())))
for i in range(0, amountOfRooms):
	for j in range(0, amountOfPrints[i], 2):
		a = forceOfPrints[i][j + 1]
		b = -forceOfPrints[i][j]
		if j + 2 < amountOfPrints[i]:
			print(a, b, end=' ')
		else:
			print(a, b)


n = int(input())
aaa = []
for iii in range(n):
	x = int(input())
	data = list(map(int, input().split()))
	x = len(data)
	for i in range(x):
		data[i] = [data[i], i]
	data = sorted(data)
	data1 = []
	data2 = []
	for i in data:
		data1.append(i[0])
		data2.append(i[1])
	data1 = list(reversed(data1))
	for i in range(x):
		if i >= x / 2:
			data1[i] = data1[i] * -1
	data = []
	for i in range(x):
		data.append([data2[i], data1[i]])
	data = sorted(data)
	ans = ''
	for i in data:
		ans += str(i[1]) + ' '
	aaa.append(ans)
for i in aaa:
	print(i)


import math
for j in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	s = [0] * n
	for i in range(int(n / 2)):
		b = int(a[i] * a[len(a) - (i + 1)] / math.gcd(a[i], a[len(a) - (i + 1)]))
		s[i] = int(b / a[i])
		s[len(a) - (i + 1)] = -int(b / a[len(a) - (i + 1)])
	print(*s)


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	for i in range(0, n, 2):
		temp = a[i]
		a[i] = a[i + 1]
		a[i + 1] = 0 - temp
	print(*a)


def nok(a, b):
	m = a * b
	while a != 0 and b != 0:
		if a > b:
			a %= b
		else:
			b %= a
	return m // (a + b)
for i in range(int(input())):
	new = list()
	dl = int(input())
	nl = [int(x) for x in input().split()]
	for p in range(0, dl, 2):
		a = nl[p]
		b = nl[p + 1]
		nd = nok(abs(a), abs(b))
		if a > 0 and b > 0 or (a < 0 and b < 0):
			na = -1 * (nd // b)
			nb = nd // a
		elif a > 0 and b < 0:
			na = -nd // b
			nb = nd // a
		elif a < 0 and b > 0:
			na = nd // b
			nb = -nd // a
		new.append(nb)
		new.append(na)
	print(*new)


t = int(input())
for i in range(t):
	n = int(input())
	x = list(map(int, input().split()))
	c = []
	for j in range(0, len(x), 2):
		(a, b) = (x[j], x[j + 1])
		c.append(0 - b)
		c.append(a)
	print(*c)


for _ in range(int(input())):
	a = int(input())
	b = list(map(int, input().split()))
	ans = b[::-1]
	for i in range(a // 2):
		ans[i] = -ans[i]
	print(*ans)


t = int(input())
outputs = [''] * t
for i in range(t):
	n = int(input())
	a = input().split()
	outputs[i] = ' '.join([str(-int(a[k + 1])) if k % 2 == 0 else a[k - 1] for k in range(len(a))])
for out in outputs:
	print(out)


N = int(input())
for _ in range(N):
	n = int(input())
	nums = list(map(int, input().split()))
	nums1 = nums[::-1]
	for i in range(n // 2):
		nums1[i] = -nums1[i]
	print(*nums1)


t = int(input())
ns = []
ass = []
for i in range(t):
	ns.append(int(input()))
	ass.append(list(map(int, input().split())))
for i in range(t):
	n = ns[i]
	a = ass[i]
	ans = []
	for j in range(n):
		if j < n // 2:
			ans.append(a[n - j - 1])
		else:
			ans.append(-a[n - j - 1])
	print(*ans)


t = int(input())
for i in range(t):
	n = int(input())
	lst = input().split()
	ans_lst = []
	for j in range(0, n, 2):
		ans_lst += [lst[j + 1], str(-int(lst[j]))]
	print(' '.join(ans_lst))


T = int(input())
mas_all = []
for i in range(T):
	mas_b = []
	n = int(input())
	mas_a = input().split(' ')
	for b in range(n // 2):
		mas_b.append(str(int(mas_a.pop(1)) * -1))
		mas_b.append(str(int(mas_a.pop(0))))
	mas_all.append(mas_b)
for i in mas_all:
	print(' '.join(i))


T = int(input())
for _ in range(T):
	(n, a) = (int(input()), [int(i) for i in input().split()])
	res = [0] * n
	for i in range(0, n, 2):
		(res[i], res[i + 1]) = (-a[i + 1], a[i])
	print(*res)


T = int(input())
B = []
for j in range(T):
	n = int(input())
	A = list(map(int, input().split()))
	B += [A]
for j in range(T):
	for i in range(len(B[j])):
		if i % 2 == 0:
			print(-B[j][i + 1], ' ', end='', sep='')
		else:
			print(B[j][i - 1], ' ', end='', sep='')
	print('')


for t in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l = l[::-1]
	p = []
	for i in range(n):
		if i < n // 2:
			p.append(-1 * l[i])
		else:
			p.append(l[i])
	print(*p)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	for i in range(n):
		if i % 2 == 1:
			print(-a[i - 1], end=' ')
		else:
			print(a[i + 1], end=' ')
	print('\n')


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	answer = []
	for i in range(0, n, 2):
		answer.append(-arr[i + 1])
		answer.append(arr[i])
	print(*answer)


for i in range(int(input())):
	(n, nums, answ) = (int(input()), list(map(int, input().split())), [])
	for num in range(0, n, 2):
		first = nums[num]
		sec = nums[num + 1]
		if first > 0 and sec > 0 or (first < 0 and sec < 0):
			answ += [-sec, first]
		else:
			answ += [abs(sec), abs(first)]
	print(*answ)


t = int(input())
for i in range(t):
	n = int(input())
	mas = [int(s) for s in input().split()]
	for i in range(n):
		if i % 2 == 0:
			print(-mas[i + 1], end=' ')
		else:
			print(mas[i - 1], end=' ')
	print()


for T in range(int(input())):
	n = int(input())
	spa = list(map(int, input().split()))
	spb = [0] * n
	n2 = n // 2
	for i in range(n2):
		a1 = spa[i]
		a2 = spa[i + n2]
		if a1 == a2:
			spb[i] = '1'
			spb[i + n2] = '-1'
		else:
			spb[i] = str(a2)
			spb[i + n // 2] = str(-a1)
	print(' '.join(spb))


t = int(input())
for q in range(t):
	n = int(input())
	a = []
	f = 1
	a = list(map(int, input().split()))
	s = 0
	for i in range(n):
		if f == 0:
			if a[-i - 1] * a[i] > 0:
				print(a[-i - 1], end=' ')
			else:
				print(-a[-i - 1], end=' ')
			f = 1
		else:
			if a[-i - 1] * a[i] > 0:
				print(-a[-i - 1], end=' ')
			else:
				print(a[-i - 1], end=' ')
			f = 0
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	ans = []
	a = [int(i) for i in input().split()]
	for i in range(n):
		if i == 0:
			ans.append(a[1])
		elif i == n - 1:
			ans.append(-a[-2])
		elif not i % 2:
			ans.append(a[i + 1])
		else:
			ans.append(-a[i - 1])
	print(*ans)


from math import gcd
lcm = lambda a, b: a // gcd(a, b) * b
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	res = [0] * n
	for i in range(n // 2):
		l = lcm(a[i], a[n - i - 1])
		res[i] = l // a[i]
		res[n - i - 1] = -l // a[n - i - 1]
	for el in res:
		print(el, end=' ')
	print()


ans = []
for o in range(int(input())):
	k = int(input())
	v = list(map(int, input().split()))
	ans.append([])
	for i in range(0, len(v) - 1, 2):
		ans[o].append(-v[i + 1])
		ans[o].append(v[i])
for i in ans:
	print(*i)


t = int(input())
for i in range(t):
	n = int(input())
	b = [int(h) for h in input().split()]
	for j in range(0, n, 2):
		print(b[j + 1], -b[j], end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	s = list(map(int, input().split()))
	t = []
	for i in range(0, n, 2):
		f = False
		t.append(str(-s[i + 1]))
		t.append(str(s[i]))
	print(' '.join(t))


t = int(input())
for i in range(t):
	n = int(input())
	a = input().split()
	k = ''
	for j in range(0, len(a), 2):
		k += str(-int(a[j + 1])) + ' ' + a[j] + ' '
	print(k)


x = ''
n = int(input())
for i in range(n):
	a = []
	s = int(input())
	s1 = list(map(int, input().split()))
	for j in range(0, len(s1), 2):
		a.append(s1[j + 1])
		a.append(s1[j] * -1)
	for k in range(len(a)):
		x += str(a[k]) + ' '
	print(x)
	x = ''


t = int(input())
for i in range(0, t):
	n = int(input())
	m = list(map(int, input().split()))
	spo = []
	for j in range(0, n, +2):
		spo.append(-m[j + 1])
		spo.append(m[j])
	print(*spo)


doors = []
for i in range(int(input())):
	input()
	doors.append([int(n) for n in input().split()])
for forces in doors:
	for i in range(0, len(forces), 2):
		print(forces[i + 1], -forces[i], end=' ')
	print('')


T = int(input())
for i in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	a.reverse()
	for y in range(int(len(a) / 2)):
		a[y] = -a[y]
	for item in a:
		print(item, end=' ')


for i in range(int(input())):
	n = int(input())
	a = [int(s) for s in input().split()][::-1]
	print(' '.join([str(k) for k in [-a[i] if i % 2 == 0 else a[i] for i in range(n)]]))


import math
t = int(input())
all_ans = []
for j in range(t):
	n = int(input())
	n_prints = [int(i) for i in input().split()]
	ans = []
	for i in range(n // 2):
		a1 = n_prints[i * 2]
		a2 = n_prints[i * 2 + 1]
		common = abs(a1 * a2) // math.gcd(a1, a2)
		b1 = abs(common // a1)
		b2 = abs(common // a2)
		if a1 * b1 + a2 * b2 != 0:
			b1 *= -1
		ans.extend([b1, b2])
	all_ans.append(ans)
[print(*ans) for ans in all_ans]


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	for i in range(0, len(a) - 1, 2):
		print(a[i + 1], -1 * a[i], end=' ')
	print()


def gcd(a, b):
	if a == 0 or b == 0:
		return max(a, b)
	elif a > b:
		return gcd(a - b, b)
	else:
		return gcd(a, b - a)
T = int(input())
for q in range(T):
	int(input())
	l = list(map(int, input().split()))
	for i in range(0, len(l) - 1, 2):
		nod = gcd(abs(l[i]), abs(l[i + 1]))
		nok = l[i] * l[i + 1] // nod
		a1 = nok // l[i]
		a2 = nok // l[i + 1]
		if a1 * l[i] + a2 * l[i + 1] != 0:
			a1 = -a1
		print(a1, a2, end=' ')


t = int(input())
a = []
for i in range(t):
	n = int(input())
	p = list(map(int, input().split()))
	for j in range(1, n // 2 + 1):
		print(-p[-j], end=' ')
	for j in range(n // 2 + 1, n + 1):
		print(p[-j], end=' ')
	print('')


import sys

def main():
	inp = sys.stdin.read().strip().split('\n')
	out = []
	for s in inp[2::2]:
		l = list(map(int, s.split()))
		t = []
		for (i, j) in zip(l[::2], l[1::2]):
			t.extend((-j, i))
		out.append(' '.join(map(str, t)))
	return out
print(*main(), sep='\n')


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	for i in range(n):
		s = a[n - i - 1] * (i < n // 2) - a[n - i - 1] * (i >= n // 2)
		print(s, end=' ')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	a = a[::-1]
	for i in range(n):
		if i < n // 2:
			print(-a[i], end=' ')
		else:
			print(a[i], end=' ')
	print('')


def solution(doors_a):
	doors_b = [[] for i in range(len(doors_a))]
	for da_idx in range(len(doors_a)):
		da = doors_a[da_idx]
		db = doors_b[da_idx]
		for s_idx in range(len(da) - 1):
			if s_idx % 2 != 0:
				continue
			db.append(-1 * da[s_idx + 1])
			db.append(da[s_idx])
	return doors_b
T = int(input())
doors_a = [[] for i in range(T)]
for d in doors_a:
	_ = input()
	d += list(map(int, input().split()))
doors_b = solution(doors_a)
for d in doors_b:
	print(' '.join(map(str, d)))


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = []
	for i in range(n):
		if i % 2 == 0:
			b.append(-a[i + 1])
		else:
			b.append(a[i - 1])
	print(' '.join([str(item) for item in b]))


import sys
num_of_doors = int(sys.stdin.readline())
for i in range(0, num_of_doors):
	_ = int(sys.stdin.readline())
	seals = list(map(int, sys.stdin.readline().split()))
	energy = []
	for n in range(0, len(seals) - 1, 2):
		energy.append(seals[n + 1])
		energy.append(seals[n] * -1)
	print(*energy)


t = int(input())
for i in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	result = []
	if n % 2 == 0:
		for i in range(0, n, 2):
			result.append(-a[i + 1])
			result.append(a[i])
	else:
		result.append(a[1] + a[2])
		result.append(-a[0])
		result.append(-a[0])
		if n > 3:
			for i in range(4, n, 2):
				result.append(-a[i + 1])
				result.append(a[i])
	result = [str(x) for x in result]
	print(' '.join(result))


n = int(input())
a = [[]] * n
for i in range(n):
	a[i] = [] * int(input())
	b = list(map(int, input().split()))
	for j in range(len(b) - 1, -1, -1):
		print(b[j] - b[j] * 2 * (j >= len(b) // 2), end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	h = list(map(int, input().split()))
	ans = []
	for i in range(0, n, 2):
		ans.append(h[i + 1])
		ans.append(-h[i])
	print(*ans)


def main():
	n = int(input())
	q = list(map(int, input().split()))
	o = 0
	for i in q[::-1]:
		o += 1
		t = i
		if o > n // 2:
			t = -i
		print(t, end=' ')
	print()
for i in range(int(input())):
	main()


t = int(input())
c = []
for i in range(t):
	n = int(input())
	l = [0] * n
	a = list(map(int, input().split()))
	for k in range(n // 2):
		l[k] = -a[n - k - 1]
		l[n - k - 1] = a[k]
	c.append(l)
for i in range(t):
	for j in range(len(c[i])):
		print(c[i][j], end=' ')
	print()


t = int(input())
a = []
for i in range(t):
	n = int(input())
	b = input().split()
	a.append(b)
for i in range(len(a)):
	a[i] = list(map(int, a[i]))
for i in range(t):
	ans = ''
	for j in range(len(a[i])):
		if j % 2 == 0:
			ans += str(a[i][-1 - j] * -1) + ' '
		else:
			ans += str(a[i][-1 - j]) + ' '
	print(ans)


for testCase in range(int(input())):
	n = int(input()) - 2
	arr = list(map(int, input().split()))
	while n >= 0:
		arr[n] *= -1
		(arr[n], arr[n + 1]) = (arr[n + 1], arr[n])
		n -= 2
	for i in arr:
		print(i, end=' ')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	lst = list(map(int, input().split()))
	ans = []
	for i in range(0, len(lst) - 1, 2):
		a = lst[i]
		b = lst[i + 1]
		if a < 0 and b < 0:
			ans.append(b)
			ans.append(-a)
		elif a > 0 and b > 0:
			ans.append(b)
			ans.append(-a)
		elif a < 0 and b > 0:
			ans.append(b)
			ans.append(-a)
		elif a > 0 and b < 0:
			ans.append(-b)
			ans.append(a)
	print(*ans)


t = int(input())
for test_case in range(t):
	n = [int(x) for x in input().split()]
	n = n[0]
	a = [int(y) for y in input().split()]
	res = []
	for i in range(0, n, 2):
		if a[i] > 0 and a[i + 1] > 0:
			res.append(abs(a[i + 1]) * -1)
			res.append(abs(a[i]))
		elif a[i] < 0 and a[i + 1] > 0:
			res.append(abs(a[i + 1]))
			res.append(abs(a[i]))
		elif a[i] > 0 and a[i + 1] < 0:
			res.append(abs(a[i + 1]))
			res.append(abs(a[i]))
		elif a[i] < 0 and a[i + 1] < 0:
			res.append(abs(a[i + 1]) * -1)
			res.append(abs(a[i]))
	print()
	print(*res)
	print()


n = int(input())
rooms = [[int(input()), [int(lock) for lock in input().split()]] for num in range(n)]
answer = []
for room in rooms:
	for lock in range(0, len(room[1]) // 2):
		answer += [-room[1][-lock - 1]]
	for lock in range(len(room[1]) // 2 - 1, -1, -1):
		answer += [room[1][lock]]
	print(' '.join([str(lock) for lock in answer]))
	answer = []


from sys import stdout, stdin, setrecursionlimit
from io import BytesIO, IOBase
from collections import *
from itertools import *
from random import *
from bisect import *
from string import *
from queue import *
from heapq import *
from math import *
from re import *
from os import *

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = read(self._fd, max(fstat(self._fd).st_size, 8192))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = read(self._fd, max(fstat(self._fd).st_size, 8192))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(stdin, stdout) = (IOWrapper(stdin), IOWrapper(stdout))

def input():
	return stdin.readline().strip()

def fast():
	return stdin.readline().strip()

def zzz():
	return [int(i) for i in fast().split()]
(z, zz) = (fast, lambda : map(int, z().split()))
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def output(answer, end='\n'):
	stdout.write(str(answer) + end)
dx = [-1, 1, 0, 0, 1, -1, 1, -1]
dy = [0, 0, 1, -1, 1, -1, -1, 1]
num = int(z())
for _ in range(num):
	n = int(z())
	arr = zzz()
	j = -1
	for i in arr[::-1]:
		j *= -1
		print(j * i, end=' ')
	print()


for _ in range(int(input())):
	int(input())
	a = [int(x) for x in input().split()]
	l = []
	for i in range(len(a)):
		if i >= len(a) // 2:
			l.append(str(a[-i - 1]))
		else:
			l.append(str(-a[-i - 1]))
	print(' '.join(l))


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	for j in range(0, n, 2):
		if a[j] > 0 and a[j + 1] > 0 or (a[j] < 0 and a[j + 1] < 0):
			print(a[j + 1], -a[j], end=' ')
		elif a[j] > 0:
			print(a[j + 1], -a[j], end=' ')
		else:
			print(-a[j + 1], a[j], end=' ')
	print()


t = int(input())
for i in range(t):
	ot = []
	n = int(input())
	a = list(map(int, input().split()))
	s = 0
	if n % 2 == 0:
		for j in range(n):
			if j % 2 == 0:
				ot.append(a[j + 1])
			elif j % 2 != 0:
				ot.append(a[j - 1] * -1)
	elif n % 2 != 0:
		for j in range(n):
			s += a[j]
		ww = s // 2
		for j in range(n):
			if a[j] < ww:
				if a[j] < 0:
					ot.append(-1)
				elif a[j] > 0:
					ot.append(1)
			elif a[j] == ww:
				if a[j] < 0:
					ot.append(1)
				elif a[j] > 0:
					ot.append(-1)
	print(*ot)


T = int(input())
m = []
for i in range(T):
	a = int(input())
	n = list(map(int, input().split()))
	for j in range(0, a, 2):
		n1 = n[j]
		n[j] = -n[j + 1]
		n[j + 1] = n1
	m.append(n)
for i in range(len(m)):
	for j in range(len(m[i])):
		print(m[i][j], end=' ')
	print()


def lcm(a, b):
	m = a * b
	while a != 0 and b != 0:
		if a > b:
			a %= b
		else:
			b %= a
	return m // (a + b)

def main():
	l = int(input())
	A = list(map(int, input().split()))
	B = [1 for i in range(l)]
	for i in range(l // 2):
		B[i] = -A[l - i - 1]
		B[l - i - 1] = A[i]
	print(' '.join(map(str, B)))
for i in range(int(input())):
	main()


for i in range(int(input())):
	d = input()
	A = list(map(int, input().split()))
	gg = []
	for k in range(0, len(A), 2):
		a = A[k]
		b = A[k + 1]
		gg.append(b)
		gg.append(-a)
	print(*gg)


num_of_rooms = int(input(''))
for i in range(num_of_rooms):
	help_list = []
	num_of_seals = int(input(''))
	strong_of_seals = list(map(int, input().split()))
	for j in range(0, len(strong_of_seals) - 1, 2):
		help_list.append(strong_of_seals[j + 1])
		help_list.append(strong_of_seals[j] * -1)
	print(*help_list)


for i in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	ans = []
	for j in range(len(lst)):
		if j % 2 == 0:
			ans.append(-lst[j + 1])
		else:
			ans.append(lst[j - 1])
	print(*ans)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	res = []
	for i in range(0, n, 2):
		res.append(-a[i + 1])
		res.append(a[i])
	res = list(map(str, res))
	print(' '.join(res))


def gcd(a, b):
	if a < b:
		(a, b) = (b, a)
	while a and b:
		(a, b) = (b, a % b)
	return a

def nok(a, b):
	return a * b / gcd(a, b)
n = int(input())
for i in range(n):
	k = int(input())
	l = list(map(int, input().split()))
	for i in range(k):
		a = nok(l[i], l[-i - 1]) / l[i]
		if i < k / 2:
			a *= -1
		print(int(a), end=' ')
	print()


for x in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	for i in range(0, len(l), 2):
		print(-l[i + 1], l[i], end=' ')
	print()


a = int(input())
ans = []
for i in range(a):
	n = int(input())
	s = list(map(int, input().split()))
	l = []
	for j in range(n - 1, -1, -1):
		if j >= (n + 1) // 2:
			l.append(0 - s[j])
		else:
			l.append(s[j])
	ans.append(l)
for i in range(a):
	print(*ans[i])


for i in range(int(input())):
	n = int(input())
	seals = list(map(int, input().split()))
	answ = []
	for j in range(0, n, 2):
		(a, b) = (seals[j], seals[j + 1])
		if a > 0 and b > 0 or (a < 0 and b < 0):
			answ += [-b, a]
		else:
			answ += [abs(b), abs(a)]
	print(*answ)


t = int(input())
for i in range(t):
	n = int(input())
	d = list(map(int, input().split()))
	for j in range(1, len(d), 2):
		(d[j - 1], d[j]) = (-1 * d[j], d[j - 1])
	print(' '.join([str(j) for j in d]))


for _ in range(int(input())):
	x = int(input())
	A = list(map(int, input().split()))
	for i in range(len(A) // 2):
		print(A[2 * i + 1], -A[2 * i], end=' ')
	print()


import math
t = int(input())
for k1 in range(t):
	n = int(input())
	nums = list(map(int, input().rstrip().split()))
	res = []
	for i in range(0, len(nums), 2):
		if nums[i + 1] > 0:
			res.append(int('-' + str(nums[i + 1])))
		if nums[i + 1] < 0:
			res.append(abs(nums[i + 1]))
		res.append(nums[i])
	print(*res)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))[::-1]
	one = list(map(lambda x: -int(x), a[:n // 2]))
	print(*one, end=' ')
	print(*a[n // 2:])


T = int(input())
a = []
b = []
for i in range(T):
	a = []
	b = []
	n = int(input())
	a = list(map(int, input().split()))
	i2 = len(a) - 1
	i3 = 0
	for i5 in range(n):
		b.append(0)
	while i2 > len(a) / 2 - 1:
		b[i3] = -a[i2]
		b[i2] = a[i3]
		i2 -= 1
		i3 += 1
	for i4 in range(len(b)):
		print(b[i4], end=' ')


t = int(input())
for i in range(t):
	n = int(input())
	line = list(map(int, input().split()))
	j = 0
	while j < len(line):
		print(-line[j + 1], line[j], end=' ')
		j += 2


t = int(input())
a = []
count = 0
st = ''
count_num = 0
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	if n == 2:
		print(-a[1], a[0])
	else:
		for j in range(0, n - 1, 2):
			n1 = -a[j + 1]
			n2 = a[j]
			print(n1, n2, end=' ')
		print()


T = int(input())
results = []
for comnata in range(T):
	n = int(input())
	ai = [int(i) for i in input().split(' ')]
	result = []
	for pair in range(0, n - 1, 2):
		result.append(0 - ai[pair + 1])
		result.append(ai[pair])
	results.append(result)
for result in results:
	for element in result:
		print(element, end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	A = list(map(int, input().split()))
	B = [0] * n
	for i in range(1, n, 2):
		(B[i - 1], B[i]) = (-A[i], A[i - 1])
	print(*B)


def ok(s):
	for i in range(len(s) - len(s) // 2):
		s[i] = -s[i]
	return s[::-1]
n = int(input())
for i in range(n):
	a = int(input())
	s = list(map(int, input().split()))
	print(' '.join(map(str, ok(s))))


t = int(input())
while t != 0:
	k = int(input())
	mas = [int(a) for a in input().split()]
	mas.reverse()
	m = []
	for i in range(k):
		if i < k // 2:
			m += [-mas[i]]
		else:
			m += [mas[i]]
	print(*m)
	t = t - 1


from math import gcd
for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	for j in range(0, n, 2):
		dl = a[j] * a[j + 1] // gcd(a[j], a[j + 1])
		print(-dl // a[j], end=' ')
		print(dl // a[j + 1], end=' ')
	print()


N = int(input())
reses = []
for i in range(N):
	n = int(input())
	ls = list(map(int, input().split()))
	lsres = []
	i = 0
	for el in ls:
		if i % 2 == 0:
			lsres.append(-ls[i + 1])
		else:
			lsres.append(ls[i - 1])
		i += 1
	reses.append(lsres)
for el in reses:
	print(' '.join(map(str, el)))


t = int(input())
for i in range(t):
	count = int(input())
	a = list(map(int, input().split()))
	for i in range(0, count, 2):
		(a[i], a[i + 1]) = (-a[i + 1], a[i])
	print(*a)


for i in range(int(input())):
	n = int(input())
	s = [int(x) for x in input().split()]
	q = []
	for j in range(n // 2):
		print(s[2 * j + 1], end=' ')
		print(s[2 * j] * -1, end=' ')
	print()


n = int(input())
for i in range(n):
	a = int(input())
	massiv = list(map(int, input().split()))
	for j in range(1, len(massiv), 2):
		(massiv[j - 1], massiv[j]) = (massiv[j] * -1, massiv[j - 1])
	print(' '.join([str(j) for j in massiv]))


a = int(input())
for i in range(a):
	n = int(input())
	d = list(map(int, input().split()))
	out = []
	d1 = d[:n // 2]
	d2 = d[n // 2:]
	for j in reversed(range(n // 2)):
		out.append(-d2[j])
	for f in reversed(range(n // 2)):
		out.append(d1[f])
	out = str(out)
	print(out.replace('[', '').replace(']', '').replace(',', ''))


def solve():
	n = int(input())
	lst = list(map(int, input().split()))
	la = [0 for i in range(n)]
	for i in range(n):
		if i % 2 == 0:
			la[i] = lst[i ^ 1]
		else:
			la[i] = -lst[i ^ 1]
	print(*la)
for i in range(int(input())):
	solve()


for test in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	for i in range(0, n, 2):
		a1 = a[i]
		a2 = a[i + 1]
		print(-a2, a1, end=' ')
	print()


import math
n = int(input())
for x in range(0, n):
	s = int(input())
	p = input().split()
	ot = ''
	for m in range(0, s):
		if m % 2 == 1:
			continue
		y = int(p[m])
		z = int(p[m + 1])
		nok = y * z // math.gcd(y, z)
		st1 = str(nok // y)
		st2 = str(-nok // z)
		ot = ot + st1 + ' ' + st2 + ' '
	print(ot)


N = int(input())
for i in range(N):
	n = int(input())
	arr = list(map(int, input().split()))
	ind = []
	for i in range(0, n // 2):
		i1 = 2 * i
		i2 = 2 * i + 1
		ind.append(-arr[i2])
		ind.append(arr[i1])
	print(*ind, sep=' ')


t = int(input())
mn = []
mat = []
mb = []
l = 0
l1 = 0
for i in range(t):
	n = int(input())
	mn.append(n)
	at = list(map(int, input().split()))
	mat.append(at)
for i in range(len(mn)):
	for j in range(0, len(mat[i]), 2):
		l = mat[i][j] * mat[i][j + 1]
		mb.append(mat[i][j + 1])
		l1 = mat[i][j + 1] * -mat[i][j]
		if l == -l1:
			mb.append(-mat[i][j])
	for tt in range(len(mb)):
		print(mb[tt], '', end='')
	print()
	mb = []


import sys
for i in range(0, int(sys.stdin.readline())):
	n = int(sys.stdin.readline())
	ints = list(map(int, sys.stdin.readline().split()))
	out = n * [0]
	for j in range(0, int(n / 2)):
		out[2 * j] = str(ints[2 * j + 1])
		out[2 * j + 1] = str(-ints[2 * j])
	sys.stdout.write(' '.join(out) + '\n')


n = int(input())
for i in range(n):
	length = int(input())
	l = [int(x) for x in input().split()]
	for j in range(length // 2):
		(a, b) = (l[2 * j], l[2 * j + 1])
		print(-b, a, end=' ')
	print()


T = int(input())
for i in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	ind = 0
	ans = []
	while len(a) != 0:
		ans.append(a[ind + 1])
		ans.append(-a[ind])
		a.pop(0)
		a.pop(0)
	print(*ans)


def main():
	n = int(input())
	for i in range(n):
		n1 = int(input())
		L = [int(l) for l in input().split()]
		res = []
		for i in range(0, len(L), 2):
			h = L[i] * (L[i + 1] * -1)
			res.append(h // L[i])
			res.append(h * -1 // L[i + 1])
		print(*res)
main()


from math import gcd
t = int(input())
ans = []
for i in range(t):
	n = int(input())
	arr = [int(i) for i in input().split()]
	tmp = []
	itog = []
	for j in arr:
		if len(tmp) < 2:
			tmp.append(j)
		else:
			(f, s) = map(int, tmp)
			tmp = [j]
			g = gcd(f, s)
			nok = f * s // g
			itog.append(-nok // f)
			itog.append(nok // s)
	if len(tmp) == 2:
		(f, s) = map(int, tmp)
		tmp = [j]
		g = gcd(f, s)
		nok = f * s // g
		itog.append(-nok // f)
		itog.append(nok // s)
	ans.append(itog)
for i in ans:
	print(*i)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	nod = 1
	n = n // 2
	for j in range(n):
		k = a[2 * j]
		l = a[2 * j + 1]
		print(a[2 * j + 1], -a[2 * j], end=' ')
	print()


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	b = []
	for j in range(0, len(a), 2):
		b.append(a[j + 1])
		b.append(-a[j])
	print(*b)


def f():
	n = int(input())
	arr = list(map(int, input().split()))
	arr2 = []
	for i in range(n):
		if i % 2 == 0:
			arr2.append(arr[i + 1])
		else:
			arr2.append(-arr[i - 1])
	print(*arr2)
for i in range(int(input())):
	f()


def keys(a1, a2):
	b2 = a1
	b1 = -a2
	return [b1, b2]
T = int(input())
doors = []
for i in range(T):
	n = int(input())
	doors.append([])
	seals = input()
	doors[i] = seals.split(' ')
for i in range(T):
	key = []
	for j in range(0, len(doors[i]) - 1, 2):
		pairKeys = keys(int(doors[i][j]), int(doors[i][j + 1]))
		key.append(str(pairKeys[0]))
		key.append(str(pairKeys[1]))
	keyString = ' '.join(key)
	print(keyString)


for t in range(int(input())):
	n = int(input())
	l1 = list(map(int, input().split()))
	l2 = l1[::2]
	l3 = l1[1::2]
	l4 = []
	j = 0
	k = 0
	for i in range(n):
		if i % 2 == 0:
			l4.append(-1 * l3[j])
			j += 1
		elif i % 2 != 0:
			l4.append(l2[k])
			k += 1
	print(*l4)


a = int(input())
for d in range(a):
	n = int(input())
	b = []
	b = list(map(int, input().split()))
	for i in range(0, n - 1, 2):
		if b[i] > 0:
			if b[i + 1] > 0:
				print(b[i + 1], end=' ')
			else:
				print(int(str(b[i + 1])[1:]), end=' ')
		elif b[i + 1] < 0:
			print(b[i + 1], end=' ')
		else:
			print(int('-' + str(b[i + 1])), end=' ')
		if b[i + 1] > 0:
			if b[i] < 0:
				print(b[i], end=' ')
			else:
				print(int('-' + str(b[i])), end=' ')
		elif b[i] > 0:
			print(b[i], end=' ')
		else:
			print(int(str(b[i])[1:]), end=' ')
		print()


def lcm(a, b):
	import math
	return a * b // math.gcd(a, b)
t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	for i in range(0, n, 2):
		nok = lcm(a[i], -1 * a[i + 1])
		print(nok // a[i], -1 * nok // a[i + 1], end=' ')
	print()


def lcm(a, b):
	import math
	return a * b // math.gcd(a, b)
T = int(input())
for x in range(T):
	n = int(input())
	a = [i for i in map(int, input().split())]
	for z in range(0, n - 1, 2):
		i = a[z]
		i1 = a[z + 1]
		b = lcm(i, i1) / i
		b1 = lcm(i, i1) / i1 * -1
		print(int(b), int(b1), end=' ')


for _ in range(int(input())):
	n = int(input())
	seals = list(map(int, input().split()))
	final = []
	for i in range(n):
		i = -i - 1
		s = seals[i]
		if i % 2:
			s = -s
		final.append(s)
	print(*final)


t = int(input())
for i in range(t):
	n = int(input())
	sp_a = list(map(int, input().split()))
	sp_b = [0] * len(sp_a)
	for j in range(n // 2):
		sp_b[j] = sp_a[(j + 1) * -1] * -1
		sp_b[(j + 1) * -1] = sp_a[j]
	print(*sp_b)


N = int(input())
ans = []
for i in range(N):
	n = int(input())
	p = [int(i) for i in input().split()]
	if n == 2:
		ans.append([-p[1], p[0]])
	else:
		lst = []
		print('\n')
		p.reverse()
		for i in range(len(p) // 2):
			lst.append(-p[i])
		for i in range(len(p) // 2, len(p)):
			lst.append(p[i])
		ans.append(lst)
for elem in ans:
	print(*elem)


num_doors = int(input())
stamps = list()
count_stamps = list()
answer = list()
x = 0
for i in range(0, num_doors):
	count_stamps.append(int(input()))
	stamps.append(input().split())
	for j in range(1, len(stamps[i]), 2):
		if int(stamps[i][j - 1]) > 0 and int(stamps[i][j]) > 0 or (int(stamps[i][j - 1]) < 0 and int(stamps[i][j]) < 0):
			answer.append(int(stamps[i][j]) * -1)
			answer.append(int(stamps[i][j - 1]))
		elif int(stamps[i][j - 1]) > 0 and int(stamps[i][j]) < 0:
			answer.append(int(stamps[i][j]) * -1)
			answer.append(int(stamps[i][j - 1]))
		elif int(stamps[i][j - 1]) < 0 and int(stamps[i][j]) > 0:
			answer.append(int(stamps[i][j]))
			answer.append(int(stamps[i][j - 1]) * -1)
for i in count_stamps:
	print()
	for j in answer[x:x + i]:
		print(j, end=' ')
	x = x + i


T = int(input())
mas = []
for i in range(T):
	mas.append(list())
	n = int(input())
	arr = list(map(int, input().split()))
	for j in range(0, n, 2):
		if arr[j] * arr[j + 1] > 0:
			mas[i].append(-1 * arr[j + 1])
			mas[i].append(arr[j])
		else:
			mas[i].append(abs(arr[j + 1]))
			mas[i].append(abs(arr[j]))
for i in mas:
	print(*i)


doors = int(input())
n = []
m = []
for i in range(0, doors):
	n.append(int(input()))
	m.append(list(map(int, input().split())))
for q in range(0, len(n)):
	ans = []
	for j in range(0, len(m[q])):
		if (j + 1) % 2 == 0:
			ans.append(-m[q][j])
		else:
			ans.append(m[q][j])
	print(*ans[::-1])


input = __import__('sys').stdin.readline
for _ in range(int(input())):
	n = int(input())
	s = list(map(int, input().split()))
	b = [0] * n
	for i in range(0, n, 2):
		b[i] = s[i + 1]
		b[i + 1] = -s[i]
	print(*b)


for j in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = a[::-1]
	for i in range(n // 2):
		if a[i] * a[n - 1 - i] < 0:
			b[i] = abs(b[i])
			b[n - 1 - i] = abs(b[n - 1 - i])
		else:
			b[i] = -abs(b[i])
			b[n - 1 - i] = abs(b[n - 1 - i])
	print(*b)


n = int(input())
for _ in range(n):
	m = int(input())
	a = [int(i) for i in input().split()]
	d = a[::-1]
	for i in range(0, m // 2):
		d[i] = d[i] * -1
	print(*d)


T = int(input())
for i in range(T):
	n = int(input())
	seals_orochi = [int(x) for x in input().split()]
	k = n // 2
	a = 0
	b = 1
	seals_naruto = [0] * n
	for j in range(k):
		seals_naruto[a] = -seals_orochi[b]
		seals_naruto[b] = seals_orochi[a]
		a += 2
		b += 2
	print(' '.join(map(str, seals_naruto)))


import os
import sys
from io import BytesIO, IOBase
import math
from decimal import Decimal
from decimal import *
from collections import defaultdict, deque
import heapq
from decimal import Decimal
getcontext().prec = 25
abcd = 'abcdefghijklmnopqrstuvwxyz'
MOD = 1000000007
BUFSIZE = 8192
from bisect import bisect_left, bisect_right

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split(' ')))
	a = []
	for i in range(n - 1, -1, -1):
		if i < n // 2:
			a.append(-l[i])
		else:
			a.append(l[i])
	print(*a)


a = int(input())
ans = [] * a
for i in range(a):
	x = int(input())
	n = list(map(int, input().split()))
	ans.append([])
	for j in range(len(n)):
		if j % 2 == 0:
			ans[i].append(-n[j + 1])
		else:
			ans[i].append(n[j - 1])
for i in range(a):
	print(' '.join(map(str, ans[i])))


komnaty = int(input())
for i in range(komnaty):
	pechat = []
	dveri = int(input())
	pechat = input().split(' ')
	b = []
	n = 1
	while n <= round(dveri / 2):
		b.append(str(int(pechat[2 * n - 1]) * -1))
		b.append(pechat[2 * n - 2])
		n += 1
	print(' '.join(b))


room_count = input('')
rooms = []
for x in range(int(room_count)):
	prints = input('')
	s = input('').split(' ')
	rooms.append(s)
for r in rooms:
	s = [int(f) for f in reversed(r)]
	for x in range(int(len(s) / 2)):
		s[x] *= -1
	a = [str(d) for d in s]
	print(' '.join(a))


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	b = [-a[-i] if i <= n // 2 else a[-i] for i in range(1, n + 1)]
	print(*b)


T = int(input())
for _ in range(T):
	n = int(input())
	arr = list(map(int, input().split()))
	arr2 = []
	for i in range(len(arr)):
		arr2.append([arr[i], i])
	arr2.sort(key=lambda x: x[0])
	arr3 = dict()
	sign = -1
	for i in arr2:
		arr3[n - i[1] - 1] = i[0]
	print()
	res = 0
	for i in range(n):
		print(arr3[i] * sign, end=' ')
		res += arr[i] * arr3[i] * sign
		if sign == 1:
			sign = -1
		else:
			sign = 1


a = int(input())
for i in range(a):
	k = int(input())
	n = list(map(int, input().split()))
	n2 = []
	for i in range(0, k, 2):
		n2.append(n[i + 1])
		n2.append(-n[i])
	print(*n2)


for _ in range(int(input())):
	n = int(input())
	lst = list(map(int, input().split()))
	print(*[-lst[i + 1] if i % 2 == 0 else lst[i - 1] for i in range(len(lst))])


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	for i in range(1, n, 2):
		print(-a[i], end=' ')
		print(a[i - 1], end=' ')
	print()


for i in range(int(input())):
	s = int(input())
	seals = list(map(int, input().split()))
	for i in range(0, s, 2):
		print(-seals[i + 1], seals[i], end=' ')


n = int(input())
for _ in range(n):
	n_seals = int(input())
	a_seals = [int(seal) for seal in input().split()]
	b_seals = []
	counter = 0
	while counter < n_seals:
		b_seals.append(-a_seals[counter + 1])
		b_seals.append(a_seals[counter])
		counter += 2
	print(' '.join((str(x) for x in b_seals)))


t = int(input())
for i in range(t):
	s = []
	n = int(input())
	s1 = [int(i) for i in input().split()]
	s = [0] * n
	i1 = 0
	i2 = 0
	while i1 < n:
		s[i2] = s1[n - i2 - 1]
		s[n - i2 - 1] = -s1[i2]
		i1 += 2
		i2 += 1
	print(*s)


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = [-elem for elem in a[::-1][:n // 2]] + a[::-1][n // 2:]
	print(*b)


n = int(input())
B = []
for i in range(1, n + 1):
	k = int(input())
	A = input().split()
	B.append(A)
for ln in B:
	for ael in range(0, len(ln), 2):
		del1 = ln[ael + 1]
		del2 = str(int(ln[ael]) * -1)
		ln[ael] = del1
		ln[ael + 1] = del2
	print(*ln, sep=' ')


l = int(input())
answerArrStr = []
for i in range(l):
	input()
	arr = list(map(int, input().split()))
	answersArr = list(map(lambda _: 0, arr))
	for i in range(0, len(arr) - 1, 2):
		answersArr[i + 1] = arr[i]
		answersArr[i] = arr[i + 1] * -1
	answerArrStr.append(' '.join(list(map(str, answersArr))))
for (_, element) in enumerate(answerArrStr):
	print(element)


import copy

def main():
	n = int(input())
	for i in range(n):
		nn = int(input())
		in_arr = list(map(int, input().split()))
		rev_list = copy.copy(in_arr)
		rev_list.reverse()
		cnt = 1
		for j in range(nn):
			if cnt <= nn // 2:
				if in_arr[j] < 0:
					print(abs(rev_list[j]), end=' ')
				else:
					print(-abs(rev_list[j]), end=' ')
			elif in_arr[j] < 0:
				print(-abs(rev_list[j]), end=' ')
			else:
				print(abs(rev_list[j]), end=' ')
			cnt += 1
		print()
main()


from math import gcd
n = int(input())
for i in range(n):
	t = int(input())
	nn = [int(s) for s in input().split()]
	tt = []
	for k in range(1, t, 2):
		if nn[k] > 0 and nn[k - 1] > 0 or (nn[k - 1] < 0 and nn[k]) < 0:
			tt.append(nn[k] * -1)
			tt.append(nn[k - 1])
		else:
			tt.append(nn[k] * -1)
			tt.append(nn[k - 1])
	print(*tt)


T = int(input())
for i in range(T):
	n = int(input())
	s = input().split()
	for k in range(n // 2):
		print(int(s[-k - 1]) * -1, end=' ')
	for k in range(n // 2, n):
		print(int(s[-k - 1]), end=' ')
	print()


import sys
import math
t = int(input().strip())
for a0 in range(t):
	n = int(input())
	l1 = [int(i) for i in input().split()]
	m = []
	for i in range(n):
		if i % 2 != 0:
			m.append(l1[i])
			m.append(l1[i - 1])
	s = ''
	for i in range(n):
		if i % 2 == 0:
			s += str(-m[i]) + ' '
		else:
			s += str(m[i]) + ' '
	print(s)


for s in [*open(0)][2::2]:
	a = list(map(int, s.split()))
	for (x, y) in zip(a[::2], a[1::2]):
		print(-y, x, end=' ')
	print()


t = int(input())
import math
for _ in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	for i in range(0, n, 2):
		print(a[i + 1], -a[i], end=' ')
	print()


n = int(input())
d = []
for i in range(n):
	_ = input()
	d.append(list(map(int, input().split())))
for i in d:
	for j in range(0, len(i)):
		if j % 2 == 0:
			print(-i[j + 1], end=' ')
		else:
			print(i[j - 1], end=' ')
	print()


e = int(input())
o = []
for i in range(e):
	n = int(input())
	z = input().split()
	k = [0] * n
	for i in range(n // 2):
		k[i] = -int(z[n - i - 1])
		k[n - i - 1] = int(z[i])
	o.append(k)
for j in range(e):
	print(*o[j])


num_of_rooms = int(input(''))
for i in range(num_of_rooms):
	seals = []
	num_of_seals = int(input(''))
	strong_of_seals = list(map(int, input().split()))
	for a in range(0, len(strong_of_seals) - 1, 2):
		seals.append(strong_of_seals[a + 1])
		seals.append(strong_of_seals[a] * -1)
	print(*seals)


T = int(input())
for i in range(T):
	n = int(input())
	a = [int(x) for x in input().split()]
	b = [0] * n
	for j in range(n // 2):
		b[j] = a[n - j - 1]
	for j in range(n // 2, n):
		b[j] = -a[n - j - 1]
	print(*b)


def main():
	T = int(input())
	for _ in range(T):
		n = int(input())
		a = list(map(int, input().split()))
		p = []
		for i in range(0, n, 2):
			p.append(-a[i + 1])
			p.append(a[i])
		print(*p)
main()


d = int(input())
for i in range(d):
	quantityArray = int(input())
	array = list(map(int, input().split()))
	for i in range(quantityArray - 1, quantityArray // 2 - 1, -1):
		print(array[i], end=' ')
	i = 0
	for i in range(quantityArray // 2 - 1, -1, -1):
		print(-array[i], end=' ')


T = int(input())
for i in range(T):
	input()
	data = list(map(int, input().split()))
	ans = list()
	for j in range(len(data)):
		if j % 2 == 1:
			ans.append(data[j - 1] * -1)
		else:
			ans.append(data[j + 1])
	for j in ans:
		print(j, end=' ')


def nok(a, b):
	m = a * b
	while a != 0 and b != 0:
		if a > b:
			a %= b
		else:
			b %= a
	return m // (a + b)
answ = []
t = int(input())
answ = []
for i in range(t):
	n = int(input())
	power = input().split()
	power2 = list(map(int, power))
	k = 0
	lst_b = []
	for q in range(n):
		while k + 1 < n:
			n1 = power2[k]
			n2 = power2[k + 1]
			n12 = abs(n1)
			n22 = abs(n2)
			if n1 > 0 and n2 > 0 or (n1 < 0 and n2 < 0):
				NOK = nok(n12, n22)
				lst_b.append(NOK // n1)
				lst_b.append(-(NOK // n2))
			if n1 > 0 and n2 < 0 or (n1 < 0 and n2 > 0):
				NOK = nok(n12, n22)
				lst_b.append(NOK // n12)
				lst_b.append(NOK // n22)
			k += 2
	answ.append(lst_b)
for lst in answ:
	print(*lst)


def opener(nn, an, left_hand, right_hand, b):
	if nn == 2:
		b[left_hand] = -an[right_hand]
		b[right_hand] = an[left_hand]
		return b
	if nn >= 4:
		b[left_hand] = -an[right_hand]
		b[right_hand] = an[left_hand]
		left_hand += 1
		right_hand -= 1
		nn = nn - 2
		return opener(nn, an, left_hand, right_hand, b)
T = int(input())
a = []
for i in range(0, T):
	b = []
	n = int(input())
	a = list(map(int, input().split()))
	b = [0] * n
	k = list(opener(n, a, 0, len(a) - 1, b))
	c = ''
	for il in k:
		c += str(il) + ' '
	print(c)


def gcd(a, b):
	while b != 0:
		a %= b
		(a, b) = (b, a)
	return a
T = int(input())
for i in range(T):
	N = int(input())
	A = list(map(int, input().split()))
	for i in range(0, N, 2):
		c = gcd(A[i], A[i + 1])
		print(A[i + 1] // c, -A[i] // c, end=' ')
	print()


from functools import reduce
t = int(input())
k = 0
c = []
for i in range(t):
	a = int(input())
	b = input().split()
	b = [int(x) for x in b]
	while k != a:
		c.append(-b[k + 1])
		c.append(b[k])
		k += 2
	for l in c:
		print(l, end=' ')
	c = []
	b = []
	k = 0


def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		values = list(map(int, input().split()))
		answer = [0 for i in range(n)]
		for i in range(n):
			if i % 2 == 0:
				answer[i] = -values[i + 1]
			else:
				answer[i] = values[i - 1]
		print(*answer)
main()


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	answer = ''
	for j in range(n):
		if j % 2 == 0:
			answer += str(-a[j + 1]) + ' '
		else:
			answer += str(a[j - 1]) + ' '
	print(answer)


count = int(input())
r = []
for i in range(count):
	n = int(input())
	a = [int(x) for x in input().split()]
	for j in range(n // 2):
		(a[2 * j + 1], a[2 * j]) = (a[2 * j], -a[2 * j + 1])
	print(*a)


num_of_tests = int(input())
for i in range(num_of_tests):
	num = int(input())
	arr = list(map(int, input().split()))
	for j in range(num // 2):
		(a, b) = (arr.pop(0), arr.pop(0))
		print(-b, a, end=' ')
	print()


k = int(input())
count = []
S1 = []
for i in range(k):
	n = int(input())
	S = list(map(int, input().split()))
	for i in range(n - 1, n // 2 - 1, -1):
		S1.append(S[i] * -1)
	for i in range(n // 2 - 1, -1, -1):
		S1.append(S[i])
	count.append(S1)
	S1 = []
for i in count:
	print(' '.join(map(str, i)))


T = int(input())
c = ''
g = []
k = 0
for i in range(T):
	k = int(input())
	c = input().split()
	for ij in range(k):
		if ij % 2 == 0:
			g.append(int(c[ij + 1]))
		else:
			g.append(-int(c[ij - 1]))
	print(*g)
	g.clear()


def oneLineArrayPrint(arr):
	print(' '.join([str(x) for x in arr]))
import sys
input = sys.stdin.buffer.readline
t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	b = []
	for i in range(0, n, 2):
		a1 = a[i]
		a2 = a[i + 1]
		b.append(-a2)
		b.append(a1)
	oneLineArrayPrint(b)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	for k in range(len(a)):
		if k % 2 == 0:
			print(-a[k + 1], end=' ')
		else:
			print(a[k - 1], end=' ')
	print()


for doors in range(int(input())):
	(a, k) = ([], -1)
	num = int(input())
	stamps = map(int, input().split())
	for i in stamps:
		a += [i * k]
		k *= -1
	print(*a[::-1])


for i0 in range(int(input())):
	num_0 = int(input())
	list_0 = list(map(int, input().split()))
	if num_0 % 2 == 0:
		[print(list_0[i1 + 1], -list_0[i1], end=' ') for i1 in range(0, len(list_0), 2)]


import math
a = int(input())
for i in range(a):
	b = int(input())
	ans = []
	l = list(map(int, input().split()))
	for j in range(0, b, 2):
		lcm = l[j] * l[j + 1] / math.gcd(l[j], l[j + 1])
		ans.append(lcm // l[j])
		ans.append(-lcm // l[j + 1])
	for j in ans:
		print(int(j), end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	i = 1
	while i < n:
		print(a[i] * -1, end=' ')
		print(a[i - 1], end=' ')
		i = i + 2
	print()


for i in range(int(input())):
	n = int(input())
	arr = map(int, input().split())
	res = []
	for i in range(n // 2):
		res.append(next(arr))
	for i in range(n // 2, n):
		res.append(-next(arr))
	print(*reversed(res))


t = int(input())
dct = []
for i in range(t):
	d = int(input())
	arr = list(map(int, input().split()))
	dct.append({d: arr})
for i in range(len(dct)):
	count_p = list(dct[i].keys())[0]
	arr = list(*dct[i].values())
	out = []
	n = len(arr) - 1
	for j in range(len(arr)):
		if j < n / 2:
			out.append(-arr[n - j])
		else:
			out.append(arr[n - j])
	print(*out)


from math import *
import os, sys
from io import BytesIO
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if n % 2 == 0:
		for i in range(n // 2):
			print(-a[2 * i + 1], a[2 * i], end=' ')
		print()
	else:
		pass


R = lambda : map(int, input().split())
for _ in range(int(input())):
	(n,) = R()
	arr = list(R())
	for i in range(0, n, 2):
		print(-arr[i + 1], arr[i], end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	for j in range(0, n, 2):
		print(-a[j + 1], a[j], end=' ')
	print()


for t in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	i = 0
	ans = []
	while i < n:
		ans.append(-l[i + 1])
		ans.append(l[i])
		i += 2
	print(' '.join((str(i) for i in ans)))


N = int(input())
S = []
for i in range(0, N):
	a = int(input())
	S.append(input().split())
for i in range(0, N):
	for j in range(len(S[i]) - 1, -1, -1):
		if j + 1 > len(S[i]) / 2:
			print(-int(S[i][j]), end=' ')
		else:
			print(int(S[i][j]), end=' ')
	print()


T = int(input())
for i in range(T):
	n = int(input())
	if n % 2 != 0:
		print('N не соответствует условию')
	else:
		a = str(input())
		a = list(map(int, a.split(' ')))
		a.reverse()
		if len(a) != n:
			print('кол-во замков не соответствует a')
		else:
			b = []
			for j in range(len(a)):
				if j < len(a) / 2:
					b.append(a[j] * -1)
				else:
					b.append(a[j])
			b = list(map(str, b))
			print(' '.join(b))


t = int(input())
for _ in range(t):
	nSelos = int(input())
	selos = input().split()
	resposta = [0 for _ in range(nSelos)]
	for i in range(0, nSelos, 2):
		resposta[i + 1] = selos[i]
		resposta[i] = str(int(selos[i + 1]) * -1)
	print(' '.join(resposta))


input = __import__('sys').stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	for i in range(1, len(a), 2):
		(a[i - 1], a[i]) = (-a[i], a[i - 1])
	print(*a)


ans = []
for _ in range(int(input())):
	n = int(input())
	u = list(map(int, input().split()))
	u.reverse()
	for i in range(n // 2):
		u[i] = -u[i]
	ans.append(' '.join(map(str, u)))
print(*ans, sep='\n')


def inplst():
	return list(map(int, input().split()))
for _ in range(int(input())):
	n = int(input())
	l = inplst()
	for i in range(1, n, 2):
		print(-l[i], l[i - 1], end=' ')
	print()


import sys
import math

def iinput():
	return [int(i) for i in input().split()]
t = int(input())
for _ in range(t):
	n = int(input())
	mas = iinput()
	ans = []
	for i in range(0, n, 2):
		(mas[i], mas[i + 1]) = (mas[i + 1], -mas[i])
	print(*mas)


T = int(input())
for i in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	ans = []
	for i in range(n):
		if i <= n // 2 - 1:
			ans.append(a[-1 - i])
		else:
			ans.append(a[-1 - i] * -1)
	print(' '.join(map(str, ans)))


n = int(input())
for i in range(n):
	kp = int(input())
	t = [int(k) for k in input().split()]
	res = ''
	for j in range(kp):
		if j % 2 == 0:
			res += str(0 - t[j + 1]) + ' '
		else:
			res += str(t[j - 1]) + ' '
	res = res.strip()
	print(res)


def energy_yeeter(not_really_array):
	to_return = []
	for i in range(0, len(not_really_array) - 1, 2):
		to_return += [not_really_array[i + 1], -not_really_array[i]]
	return to_return
for i in range(int(input())):
	useless = input()
	to_output = list(map(int, input().split()))
	to_output = energy_yeeter(to_output)
	print(*to_output)


g = int(input())
for h in range(g):
	n = int(input())
	ch = list(map(int, input().split()))
	sun = 0
	out = ''
	if len(ch) % 2 == 0:
		for i in range(0, len(ch), 2):
			out += str(ch[i + 1] * -1) + ' ' + str(ch[i]) + ' '
	print(out)
	out = ''
	sun = 0


t = int(input())
for i in range(t):
	n = int(input())
	pech = [int(i) for i in input().split()]
	result = []
	for j in range(1, n, 2):
		result.append(-pech[j])
		result.append(pech[j - 1])
	print(*result)


def main():
	rar = int(input())
	for _ in range(rar):
		n = int(input())
		array = list(map(int, input().split()))
		for i in range(1, len(array), 2):
			print(-array[i], array[i - 1], end=' ')
		print()
main()


t = int(input())
for qwe in range(t):
	n = int(input())
	listt = list(map(int, input().split()))
	for i in range(0, n, 2):
		print(listt[i + 1] * -1, listt[i], end=' ')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	sp = [int(el) for el in input().split()]
	for i in range(n):
		if i % 2 == 0:
			print(sp[i + 1] * -1, end=' ')
		else:
			print(sp[i - 1], end=' ')
	print()


import math
from collections import deque
from sys import stdin, stdout, setrecursionlimit
from string import ascii_letters
letters = ascii_letters[:26]
from collections import defaultdict
input = stdin.readline
print = stdout.write
for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	for i in range(0, n, 2):
		a = arr[i]
		b = arr[i + 1]
		nod = abs(a) * abs(b) // math.gcd(abs(a), abs(b))
		print(str(nod // a) + ' ' + str(-(nod // b)) + ' ')
	print('\n')


n = int(input())
for i in range(n):
	k = int(input())
	a = [int(g) for g in input().split()]
	for j in range(k):
		if j % 2 == 0:
			print(-a[j + 1], end=' ')
		else:
			print(a[j - 1], end=' ')
	print()


from math import *
from cmath import *
from itertools import *
from decimal import *
from fractions import *
from sys import *
for _ in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	for x in range(0, n, 2):
		print(a[x + 1], -a[x], end=' ')
	print()


def generate_a(b, n):
	a = [0] * n
	for i in range(0, n, 2):
		a[i] = -b[i + 1]
		a[i + 1] = b[i]
	return a
t = int(input())
for _ in range(t):
	n = int(input())
	b = [int(i) for i in input().split()]
	a = generate_a(b, n)
	print(*a)


a = int(input())
n = []
b = []
for x in range(a):
	n.append(int(input()))
	b.append(input().split())
	for y in range(len(b[x])):
		b[x][y] = int(b[x][y])
for i in range(len(b)):
	for j in range(len(b[i]) // 2):
		(b[i][j], b[i][len(b[i]) - 1 - j]) = (b[i][len(b[i]) - 1 - j], b[i][j] * -1)
	for q in range(len(b[i])):
		print(b[i][q], end=' ')
	print()


T = int(input())
for i in range(T):
	n = int(input())
	ans = [0] * n
	a = list(map(int, input().split()))
	for j in range(len(a) // 2):
		(ans[j], ans[len(a) - j - 1]) = (a[len(a) - j - 1] * -1, a[j])
	print(*ans)


from math import gcd

def solve():
	n = int(input())
	a = list(map(int, input().split()))
	ans = [0] * n
	for i in range(n // 2):
		p = a[i] * a[-(i + 1)] // gcd(a[i], a[-(i + 1)])
		ans[i] = -p // a[i]
		ans[-(i + 1)] = p // a[-(i + 1)]
	print(*ans)
for i in range(int(input())):
	solve()


t = int(input())
doors = []
answers = []
for i in range(t):
	n = int(input())
	doors.append(list(map(int, input().split(' ')[0:n])))
for i in doors:
	a = []
	b = []
	for j in range(len(i) // 2):
		a.append(i[-j - 1])
		b.append(-i[j])
	a += b[::-1]
	for j in a:
		print(j, end=' ')
	print()


def solve(a, n):
	s = len(a)
	for i in range(len(a)):
		if i < len(a) // 2:
			print(-a[s - i - 1], end=' ')
		else:
			print(a[s - i - 1], end=' ')
	print()
t = int(input())
for i in range(t):
	n = input()
	a = list(map(int, input().split()))
	solve(a, n)


t = int(input())
for i in range(t):
	n = int(input())
	ans = list(map(int, input().split()))[::-1]
	for j in range(n // 2):
		print(-ans[j], end=' ')
	for j in range(n // 2, n):
		print(ans[j], end=' ')
	print()


def main():
	tc_count = int(input())
	for tc in range(tc_count):
		n = int(input())
		lst = list(map(int, input().split()))
		sol = []
		for i in range(0, n, 2):
			sol.append(lst[i + 1] * -1)
			sol.append(lst[i])
		print('{}'.format(' '.join(map(str, sol))))
main()


import sys as _sys

def main():
	t = int(input())
	for i_t in range(t):
		(n,) = _read_ints()
		a = list(_read_ints())
		assert n % 2 == 0
		(first_part, second_part) = (a[:n // 2], a[n // 2:])
		b = [-x for x in second_part][::-1] + first_part[::-1]
		print(*b)

def _read_line():
	result = _sys.stdin.readline()
	assert result[-1] == '\n'
	return result[:-1]

def _read_ints():
	return map(int, _read_line().split())
main()


T = int(input())
while T:
	T = T - 1
	N = int(input())
	L = [i for i in list(map(int, input().split()))]
	for i in range(N):
		if i % 2 == 0:
			print(L[i + 1], end=' ')
		else:
			print(-L[i - 1], end=' ')
	print('')


for _ in range(int(input())):
	input()
	A = input().split()
	Z = ''
	for i in range(0, len(A), 2):
		Z = Z + ' ' * (-0 ** i + 1) + str(-int(A[i + 1])) + ' ' + A[i]
	print(Z)


m = int(input())
l = []
for _ in range(m):
	t = int(input())
	a = input().split()
	for i in range(0, t - 1, 2):
		b = a[i]
		c = a[i + 1]
		a[i] = f'{-int(c)}'
		a[i + 1] = b
	l.append(' '.join(a))
for i in l:
	print(i)


T = int(input())
while T:
	T -= 1
	n = int(input())
	v = list(map(int, input().split(' ')))
	u = []
	for i in range(0, n, 2):
		u.append(-v[i + 1])
		u.append(v[i])
	u = list(map(int, u))
	u = list(map(str, u))
	print(' '.join(u))


for i in range(int(input())):
	x = int(input())
	a = [i for i in list(map(int, input().split()))]
	b = []
	for i in range(x):
		b.append([a[i], i])
	c = sorted(b, key=lambda s: s[0])
	c2 = [[j for j in i] for i in c]
	for i in range(x // 2):
		c[i][0] = c[-(i + 1)][0] * -1
	for i in range(x // 2, x):
		c[i][0] = c2[x - i - 1][0]
	c = sorted(c, key=lambda s: s[1])
	print(*[i[0] for i in c])


import math
t = int(input())
res = []
for q in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	res.append([''] * n)
	for i in range(n // 2):
		b = a[i]
		c = a[n - i - 1]
		x = c * b // math.gcd(c, b)
		res[q][i] = str(x // b)
		res[q][n - i - 1] = str(-x // c)
for i in range(t):
	print(*res[i])


T = int(input())
n = list()
a = list()
for i in range(T):
	n.append(int(input()))
	ai = input()
	ai = ai.split()
	for (idx, v) in enumerate(ai):
		ai[idx] = int(v)
	a.append(ai)
for i in range(T):
	mes = ''
	for j in range(0, n[i], 2):
		mes += str(-a[i][j + 1]) + ' ' + str(a[i][j]) + ' '
	print(mes)


t = int(input())
for i in range(t):
	n = int(input())
	d = list(map(int, input().split()))
	d = d[::-1]
	a = ''
	for j in d[:len(d) // 2]:
		a += f'{-j} '
	for j in d[len(d) // 2:]:
		a += f'{j} '
	print(a[:-1])


t = int(input())
for i in range(t):
	result = []
	n = int(input())
	pechat = [int(n) for n in input().split()]
	for k in range(0, len(pechat)):
		if k % 2 == 0:
			result.append(-1 * pechat[k + 1])
		else:
			result.append(pechat[k - 1])
	print(' '.join(map(str, result)))


T = int(input())
inputs = []
outputs = []
for i in range(0, T):
	n = int(input())
	k = [int(p) for p in input().split(' ')]
	inputs.append(k)
for i in inputs:
	for j in range(0, len(i)):
		if j % 2 == 0:
			outputs.append(str(-i[j + 1]))
		else:
			outputs.append(str(i[j - 1]))
	print(' '.join(outputs))
	outputs = []


for _ in range(int(input())):
	input()
	arr = list(map(int, input().split()))
	for i in range(0, len(arr), 2):
		(arr[i], arr[i + 1]) = (-arr[i + 1], arr[i])
	print(*arr)


n = int(input())
for i in range(n):
	k = int(input())
	s = [int(j) for j in input().split()]
	for x in range(0, k, 2):
		print(-s[x + 1], s[x], end=' ')


t = int(input())
for i in range(t):
	n = int(input())
	res = []
	s = list(map(int, input().split()))
	for j in range(0, n, 2):
		x = s[j]
		y = s[j + 1]
		res.append(-1 * y)
		res.append(x)
	print(*res)


cd = int(input())
for i in range(cd):
	cs = int(input())
	s2 = input().split()
	s = []
	for j in s2:
		s.append(int(j))
	s0 = []
	for j in range(int(len(s) / 2)):
		s0.append(s[j * 2 + 1])
		s0.append(-s[j * 2])
	for x in s0:
		print(x, end=' ')
	print()


t = int(input())
ans = []
for i in range(t):
	n = int(input())
	L = [int(i) for i in input().split()]
	d = [0] * n
	for j in range(0, n, 2):
		if j % 2 == 0:
			d[j] = -L[j + 1]
			d[j + 1] = L[j]
	ans.append(d)
for i in range(t):
	print(*ans[i])


x = int(input())
k = []
for i in range(x):
	dor_p = int(input())
	l = dor_p
	p = input().split(' ')
	k.append(p)
for el in k:
	ans_str = ''
	i = 0
	for sm_el in el:
		try:
			ans1 = -int(el[i + 1])
			ans2 = int(el[i])
			i += 2
			ans_str += f'{ans1} {ans2} '
		except IndexError:
			break
	print(ans_str[0:-1])


a = int(input())
for i in range(a):
	n = int(input())
	f = list(map(int, input().split()))
	ans = []
	for i in range(0, n, 2):
		ans.append(-1 * f[i + 1])
		ans.append(f[i])
	print(*ans)


door = int(input())
keys = [0] * door
for d in range(door):
	lock = int(input())
	keys[d] = [int(i) for i in input().split()]
for j in keys:
	for i in range(0, len(j), 2):
		print(j[i + 1] * -1, j[i], end=' ')
	print()


N0 = int(input())
for l in range(N0):
	N1 = input()
	a = [int(i) for i in input().split()]
	for i in range(0, len(a), 2):
		print(a[i + 1], -a[i], end=' ')


def narutooo(a):
	b = []
	for i in range(1, len(a), 2):
		b.append(-a[i])
		b.append(a[i - 1])
	return b
t = int(input())
for i in range(t):
	n = int(input())
	a = [int(i) for i in input().split()]
	print(*narutooo(a))


T = int(input())
for i in range(T):
	n = int(input())
	inp = list(map(int, input().split()))
	left = inp[:len(inp) // 2]
	right = inp[len(inp) // 2:]
	out = []
	for h in range(len(left)):
		out.append(str(-right[h]))
	print(' '.join(out), ' '.join(list(map(str, left))))


import sys
rooms = int(sys.stdin.readline())
for _ in range(rooms):
	nr_seals = int(sys.stdin.readline())
	seals = list(map(int, sys.stdin.readline().split()))
	energies = []
	for i in range(int(len(seals) / 2)):
		b1 = str(-seals[2 * i + 1])
		b2 = str(seals[2 * i])
		energies.append(b1)
		energies.append(b2)
	print(' '.join(energies))


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	for n in range(0, n, 2):
		print(a[n + 1] * -1, a[n])


t = int(input())
prints = []
for i in range(t):
	count = int(input())
	prints.append(list(map(int, input().split())))
for i in range(len(prints)):
	b_prints = prints[i][::-1]
	for j in range(len(b_prints)):
		if j < len(b_prints) / 2:
			b_prints[j] *= -1
		else:
			break
	print(' '.join([str(i) for i in b_prints]))


T = int(input())
B = []
y = int()
for i in range(T):
	n = int(input())
	A = input().split()
	for x in range(len(A)):
		if len(A) % 2 == 0:
			if x % 2 == 0:
				y = -int(A[x + 1])
			else:
				y = int(A[x - 1])
			B.append(y)
	print(*B)
	B.clear()


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	for i in range(0, n, 2):
		temp = l[i]
		l[i] = -l[i + 1]
		l[i + 1] = temp
	for i in range(n):
		print(l[i], end=' ')
	print()


from math import gcd
dv = int(input())

def lcm(a, b):
	m = a * b
	return m // gcd(a, b)
for i in range(dv):
	n = int(input())
	lst = list(map(int, input().split()))
	for pech in range(1, n, 2):
		lc = lcm(lst[pech], lst[pech - 1])
		print(-(lc // lst[pech - 1]), lc // lst[pech], end=' ')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	for i in range(0, n, 2):
		k = a[i]
		l = a[i + 1]
		nok = k * l
		(a[i], a[i + 1]) = (-nok // a[i], nok // a[i + 1])
	print(*a)


for _ in range(int(input())):
	n = int(input())
	a = [int(s) for s in input().split()]
	for i in range(0, n, 2):
		print(-a[i + 1], a[i], sep=' ', end=' ')
	print()


n = int(input())
for _ in range(n):
	o = int(input())
	ans = [1 for _ in range(o)]
	a = [int(i) for i in input().split()]
	for i in range(0, len(a), 2):
		ans[i] = -a[i + 1]
		ans[i + 1] = a[i]
	print(*ans)


def f(a, b):
	if a * b > 0:
		return -1
	return 1
t = int(input())
r = []
for i in range(0, t):
	n = int(input())
	a = list(map(int, input().split(' ')))
	for j in range(0, int(n / 2)):
		b = int(a[j])
		a[j] = f(a[j], a[n - 1 - j]) * a[n - 1 - j]
		a[n - 1 - j] = -1 * f(b, a[n - 1 - j]) * b
	r.append(a)
for i in r:
	print(*i)


from sys import stdin
input = stdin.readline
t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	ans = [0] * n
	for i in range(n):
		if i % 2 == 0:
			ans[i + 1] = a[i]
		else:
			ans[i - 1] = -a[i]
	print(*ans)


def main(n, a):
	resout = []
	for i in range(n // 2):
		resout.append(a[2 * i + 1])
		resout.append(-a[2 * i])
	return resout
res = []
for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	res.append(main(n, a))
for resout in res:
	print(*resout)


t = int(input())
for i in range(t):
	n = int(input())
	p = list(map(int, input().split()))
	ans = []
	for i in range(0, n, 2):
		ans.append(-p[i + 1])
		ans.append(p[i])
	print(*ans)


qwe = int(input())
for qwer in range(qwe):
	n = int(input())
	mas = [int(i) for i in input().split()]
	for i in range(len(mas)):
		if i % 2 == 0:
			print(mas[i + 1] * -1, mas[i], end=' ')
	print()


a = int(input())
y = str()
for i in range(a):
	input()
	x = list(map(int, input().split()))
	for ii in range(0, len(x), 2):
		if x[ii + 1] < 0 or x[ii] < 0:
			if x[ii + 1] < 0 and x[ii] < 0:
				print(abs(x[ii + 1]), x[ii], end=' ')
			else:
				print(abs(x[ii + 1]), abs(x[ii]), end=' ')
		else:
			print(x[ii + 1], -x[ii], end=' ')
	print()


g = int(input())
for i in range(g):
	k = int(input())
	a = [int(h) for h in input().split()]
	for j1 in range(k):
		if j1 % 2 == 0:
			print(-a[j1 + 1], end=' ')
		else:
			print(a[j1 - 1], end=' ')
	print()


t = int(input())

def check(n, m):
	while True:
		if m == 1 or n == 1:
			return 1
		maximum = max(n, m)
		if n == maximum:
			n = n % m
		else:
			m = m % n
		if n == 0:
			return m
		if m == 0:
			return n
for p in range(t):
	n = int(input())
	array = list(map(int, input().split()))
	for i in range(0, n, 2):
		a = check(abs(array[i]), abs(array[i + 1]))
		if array[i] < 0 and array[i + 1] > 0 or (array[i + 1] < 0 and array[i] > 0):
			print(abs(array[i] * array[i + 1] // a // array[i]) * -1, end=' ')
			print(abs(array[i] * array[i + 1] // a // array[i + 1]) * -1, end=' ')
		else:
			print(abs(array[i] * array[i + 1] // a // array[i]) * -1, end=' ')
			print(abs(array[i] * array[i + 1] // a // array[i + 1]), end=' ')


t = int(input())
b = []
for i in range(t):
	n = int(input())
	for i in range(n):
		a = [int(i) for i in input().split()]
		b.append(a)
		break
for k in range(len(b)):
	for j in range(1, len(b[k]), 2):
		print(b[k][j] * -1, b[k][j - 1], end=' ')
	print()


t = int(input())
for i in range(t):
	n = int(input())
	a = [0] * n
	m = [int(x) for x in input().split()]
	for j in range(n // 2):
		a[j] = -m[-j - 1]
		a[-j - 1] = m[j]
	print(*a)


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	res = [0] * n
	for i in range(n):
		if i % 2 == 0:
			res[i] = -a[i + 1]
		else:
			res[i] = a[i - 1]
	print(' '.join(map(str, res)))


t = int(input())
for j in range(t):
	n = int(input())
	ans = []
	s = list(map(int, input().split()))
	for i in range(n):
		if i % 2 == 0:
			ans.append(-s[i + 1])
			ans.append(s[i])
	print(*ans)


T = int(input())
for _ in range(T):
	n = int(input())
	arr = [int(x) for x in input().split()]
	answ = arr[::-1]
	for i in range(n // 2):
		answ[i] *= -1
	print(*answ)


from math import gcd
t = int(input())

def func(a, b):
	m = a * b
	return m // gcd(a, b)
for i in range(t):
	n = int(input())
	numbers = list(map(int, input().split()))
	for pair in range(1, n, 2):
		ans = func(numbers[pair], numbers[pair - 1])
		print(-(ans // numbers[pair - 1]), ans // numbers[pair], end=' ')


t = int(input())
for i in range(t):
	n = int(input())
	ls = list(map(int, input().split()))
	j = 0
	k = 0
	while j < n:
		if j <= n - 2:
			k = ls[j] * ls[j + 1]
			if k > 0:
				print(k // ls[j], k // -ls[j + 1], end=' ')
			else:
				print(k // ls[j], k // -ls[j + 1], end=' ')
			j += 1
		j += 1
	print()


T = int(input())
for jkl in range(T):
	n = int(input())
	a = [int(i) for i in input().split()]
	for i in range(0, n, 2):
		print(a[i + 1], -a[i], '', end='')
	print()


t = int(input())
for _ in range(t):
	stamps = int(input())
	forces = list(map(int, input().split()))
	a = [-s for s in forces[stamps // 2:]]
	b = forces[:stamps // 2]
	ans = a + b
	print(*ans)


a = int(input())
for i in range(a):
	b = int(input())
	c = list(map(int, input().split()))
	for j in range(b // 2 - 1):
		print(c[2 * j + 1], -c[2 * j], end=' ')
	print(c[-1], -c[-2])


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	for i in range(n):
		if i & 1:
			l[i] = -l[i]
	print(*l[::-1])


from collections import defaultdict
import sys
import math as mt
import random
sys.setrecursionlimit(10 ** 6)

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
for _ in range(int(input())):
	n = int(input())
	a = get_array()
	b = []
	for i in range(0, n, 2):
		b.append(-a[i + 1])
		b.append(a[i])
	print(*b)


for q in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	for i in range(0, n, 2):
		print(-a[i + 1], a[i], end=' ')


t = int(input())

def read1():
	input()
	c = list(map(lambda x: int(x), input().split()))
	z = []
	for i in range(len(c) // 2):
		i = i * 2
		z += ans(c[i], c[i + 1])
	print(' '.join(list(map(lambda x: str(x), z))))

def ddr(a, b):
	a = abs(a)
	b = abs(b)
	m = abs(a * b)
	while a != 0 and b != 0:
		if a > b:
			a %= b
		else:
			b %= a
	return m // (a + b)

def ans(a, b):
	d = ddr(a, b)
	x1 = abs(d // a)
	x2 = abs(d // b)
	if a * b > 0:
		x1 = -x1
	return (x1, x2)
for i in range(t):
	read1()


t = int(input())
list1 = []
count = 0
flag = True
container_dict = {}
for n in range(0, t):
	container_dict['door%i' % n] = {}
for i in range(t):
	n = int(input())
	a = input().split()
	for var in ['n', 'a']:
		container_dict['door%i' % i][var] = eval(var)
for i in range(t):
	list1 = container_dict['door%i' % i]['a']
	list1 = [int(i) for i in list1]
	for n in range(0, len(list1) - 1, 2):
		print(-list1[n + 1], list1[n], end=' ')


t = int(input())
for q in range(t):
	n = int(input())
	mass = [int(x) for x in input().split()]
	answer = [0] * n
	for i in range(n // 2):
		answer[i] = -mass[n - i - 1]
		answer[n - i - 1] = mass[i]
	print(*answer)


p = []
for i in range(int(input())):
	input()
	p.append([int(n) for n in input().split()])
res = []
for i in p:
	k = []
	for j in range(len(i) // 2):
		k.append(i[2 * j + 1])
		k.append(-i[2 * j])
	res.append(k)
for j in res:
	print(' '.join([str(n) for n in j]))


t = int(input())
output = []
for i in range(t):
	k = int(input())
	a = input().split()
	for i in range(int(len(a) / 2)):
		a[i] = int(a[i])
		a[i] *= -1
		a[i] = str(a[i])
	a.reverse()
	output.append(a)
for i in output:
	print(' '.join(i))


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	a = []
	g = -1
	for i in range(n - 1, -1, -1):
		a.append(g * arr[i])
		g *= -1
	for i in range(n):
		print(a[i], end=' ')


n = int(input())
for i in range(n):
	count = int(input())
	arr = list(map(int, input().split()))
	answer = []
	for j in range(0, len(arr), 2):
		answer.append(arr[j + 1])
		answer.append(-arr[j])
	print(*answer)


t = int(input())
for i in range(t):
	k = int(input())
	pech = input().split(' ')
	for i in range(1, len(pech), 2):
		print(int(pech[i]) * -1, ' ', int(pech[i - 1]), end=' ')
	print()


from math import *
from random import *
from bisect import *
from math import *
for i in range(int(input())):
	n = int(input())
	mas = list(map(int, input().split()))
	otv = [0 for i in range(n)]
	for i in range(0, n, 2):
		cr = mas[i]
		nx = mas[i + 1]
		otv[i] = nx
		otv[i + 1] = -cr
	print(' '.join(map(str, otv)))


n = int(input())
for j in range(n):
	k = int(input())
	l = list(map(int, input().split()))
	for i in range(0, k, 2):
		print(-l[i + 1], l[i], end=' ')


a = int(input())
for e in range(a):
	d = int(input())
	k = input().split()
	kk = []
	for w in range(1, d + 1, 2):
		kk.append(int(k[w]))
		kk.append(-1 * int(k[w - 1]))
	print(*kk)


T = int(input())
for _ in range(T):
	n = int(input())
	mas = list(map(int, input().split()))
	for i in range(n // 2):
		print(mas[2 * i + 1] * -1, mas[2 * i], end=' ')
	print()


t = int(input())
n = 0
otv = list()
otv_n = list()
pech = list()
for i in range(t):
	n = int(input())
	pech = list(map(int, input().split()))
	for j in range(n // 2):
		otv_n.append(-pech[n - j - 1])
	for j in range(n // 2, n):
		otv_n.append(pech[n - j - 1])
	otv.append(otv_n)
	otv_n = []
for i in range(t):
	print(*otv[i])


a = []
c = ' '
T = int(input())
for i in range(T):
	b = []
	n = int(input())
	a = input().split()
	for j in range(int(n / 2)):
		j += j + 1
		b.insert(0, a[j - 1])
		b.insert(0, str(-int(a[j])))
	print(c.join(b))


t = int(input())
array = []
for i in range(0, t):
	n = int(input())
	array = input().split(' ')
	result = []
	for j in range(0, n, 2):
		(a, b) = (int(array[j]), int(array[j + 1]))
		if a > 0 and b > 0 or (a < 0 and b < 0):
			result += [-b, a]
		else:
			result += (abs(b), abs(a))
	print(*result)


n = int(input())
ans = []
for i in range(n):
	k = int(input())
	s = list(map(int, input().split()))
	u = []
	for j in range(0, len(s) - 1, 2):
		u.extend([-s[j + 1], s[j]])
	ans.append(u)
for m in ans:
	print(*m)


T = int(input())
for i in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	s = list()
	for i in range(n // 2):
		s.append(-a[i * 2 + 1])
		s.append(a[i * 2])
	for i in range(len(s) - 1):
		print(s[i], end=' ')
	print(s[-1])


def main():
	n = int(input())
	arr = list(map(int, input().split()))
	x = 1
	for el in arr:
		x *= el
	for i in range(0, n, 2):
		print(arr[i + 1], -arr[i], end=' ')
	print()
for _ in range(int(input())):
	main()


for _ in range(int(input())):
	n = int(input())
	num = list(map(int, input().split()))
	for i in range(0, n, 2):
		print(num[i + 1] * -1, num[i], end=' ')
	print()


doors = int(input())
for door in range(doors):
	n = int(input())
	seals = list(map(int, input().split()))
	final = []
	for i in range(n):
		if i % 2:
			final.append(str(-seals[-(i + 1)]))
		else:
			final.append(str(seals[-(i + 1)]))
	print(' '.join(final))


t = int(input())
for _ in range(t):
	n = int(input())
	als = list(map(int, input().split()))
	ansls = [0 for _ in range(n)]
	for i in range(n // 2):
		ansls[2 * i] = -1 * als[2 * i + 1]
		ansls[2 * i + 1] = als[2 * i]
	print(' '.join(map(str, ansls)))


t = int(input())
doors = []
for _ in range(t):
	input()
	doors.append([int(i) for i in input().split()])
for d in doors:
	print(' '.join((str(i) for i in d[len(d) // 2:])) + ' ' + ' '.join((str(-i) for i in d[:len(d) // 2])))


t = int(input())
k = []
n1 = []
ans = []
for i in range(t):
	n = int(input())
	n1.append(n)
	a = list(map(int, input().split()))
	for i in range(n // 2):
		ans.append(-1 * a[n - i - 1])
	for i in range(n // 2, n):
		ans.append(a[n - i - 1])
	k.append(ans)
	ans = []
for i in range(t):
	for j in range(n1[i]):
		print(k[i][j], end=' ')
	print()


t = int(input())
minspi = []
maxspi = []
vspi = []
for i in range(t):
	n = int(input())
	vspi = list(map(int, input().split()))
	for j in range(n // 2):
		minspi.append(vspi[j] * -1)
	for j in range(n // 2, n):
		minspi.append(vspi[j])
	minspi.reverse()
	maxspi.append(minspi)
	minspi = []
for i in range(t):
	for k in range(len(maxspi[i])):
		print(maxspi[i][k], end=' ')
	print()


t = int(input())
for k in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	answ = []
	for i in range(n // 2):
		if a[i] > 0:
			answ.append(-abs(a[n - i - 1]))
		else:
			answ.append(abs(a[n - i - 1]))
	for i in range(n // 2, n):
		if a[i] > 0:
			answ.append(abs(a[n - i - 1]))
		else:
			answ.append(-abs(a[n - i - 1]))
	print(*answ)


T = int(input())
for q in range(T):
	N = int(input())
	a = list(map(int, input().split()))
	for p in range(1, N, 2):
		print(-a[p], a[p - 1], end=' ')
	print(end='\n')


def solve(n, a):
	b = []
	for i in range(n):
		if i % 2:
			b.append(-a[i - 1])
		else:
			b.append(a[i + 1])
	return b
t = int(input())
for i in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	print(*solve(n, arr))


from math import gcd
T = int(input())
rooms = []
for i in range(T):
	n = int(input())
	rooms.append([int(i) for i in input().split()])
for r in rooms:
	result = []
	for i in range(len(r) // 2):
		a = r[i * 2]
		b = r[i * 2 + 1]
		g = gcd(a, b)
		e = a * b // g
		c = e // a
		d = e // b
		result += [-c, d]
	print(' '.join(map(str, result)))


import sys
ii = lambda : sys.stdin.readline().strip()
idata = lambda : [int(qw) for qw in ii().split()]
mod = 998244353

def solve():
	n = int(ii())
	data = idata()
	for i in range(0, n, 2):
		(data[i], data[i + 1]) = (-data[i + 1], data[i])
	print(*data)
	return
for _t in range(int(ii())):
	solve()


n = int(input())
a = []
c = []

def dva(c, n):
	b = []
	for i in range(0, n - 1, 2):
		b.append(-1 * c[i + 1])
		b.append(c[i])
	return b

def tri(x, y, z):
	d = [0] * 3
	for i in range(-100, 101):
		for j in range(-100, 101):
			for k in range(-100, 101):
				if x * i + y * j + z * k == 0:
					d[0] = i
					d[1] = j
					d[2] = k
					return d
for i in range(n):
	a.append(int(input()))
	c.append(list(map(int, input().split())))
for i in range(n):
	if a[i] % 2 == 0:
		b = dva(c[i], a[i])
		print(' '.join(map(str, b)))
	else:
		b = dva(c[i], a[i] - 3) + tri(c[i][a[i] - 3], c[i][a[i] - 2], c[i][a[i] - 1])
		print(' '.join(map(str, b)))


import math
t = int(input())
masfinal = []
masfinal1 = []
for i in range(t):
	n = int(input())
	mas = [int(s) for s in input().split()]
	for k in range(0, len(mas), 2):
		nok = mas[k] * mas[k + 1] // math.gcd(mas[k], mas[k + 1])
		masfinal1.append(-(nok // mas[k]))
		masfinal1.append(nok // mas[k + 1])
	masfinal.append([])
	masfinal[i] = masfinal1
	masfinal1 = []
for i in range(t):
	for j in masfinal[i]:
		print(j, end=' ')
	print()


t = int(input())
anss = []
for _ in range(t):
	n = int(input())
	inp = list(map(int, input().split()))
	q = []
	for i in range(n // 2):
		q.append(inp[2 * i + 1])
		q.append(-1 * inp[2 * i])
	anss.append(q)
for i in anss:
	s = ''
	for j in i:
		s = s + str(j) + ' '
	print(s)


t = int(input())
b__ = []
for _ in range(t):
	n = int(input())
	a_ = [int(i) for i in input().split()]
	b_ = []
	for i in range(0, len(a_), 2):
		a1 = a_[i]
		a2 = a_[i + 1]
		b_.append(-a2)
		b_.append(a1)
	b__.append(b_)
for b_ in b__:
	print(' '.join([str(i) for i in b_]))


t = int(input())

def re(a, b):
	(q, r) = (a, b)
	while b != 0:
		(a, b) = (b, a % b)
	return q * (r // a)
for i in range(t):
	q = []
	r = int(input())
	e = list(map(int, input().split()))
	for w in range(len(e) // 2):
		q.append(-1 * (re(e[w], e[len(e) - 1 - w]) // e[w]))
		q.append(re(e[w], e[len(e) - 1 - w]) // e[len(e) - 1 - w])
	print(*q[::2], end=' ')
	print(*q[::-2])


def solve():
	n = int(input().strip())
	a = [int(x) for x in input().strip().split()]
	b = list(range(n))
	i = 0
	while i + 1 < n:
		(b[i], b[i + 1]) = (-a[i + 1], a[i])
		i += 2
	print(' '.join((str(x) for x in b)))
for _ in range(int(input().strip())):
	solve()


t = int(input())
for j in range(t):
	n = int(input())
	pa = list(map(lambda x: int(x), input().split()))
	pb = []
	for i in range(n // 2):
		perem = pa[i * 2 + 1]
		perem2 = -1 * pa[i * 2]
		pb.append(perem)
		pb.append(perem2)
	print(*pb)


for _ in range(int(input())):
	n = int(input())
	nums = [int(i) for i in input().split()]
	half = n // 2
	for i in range(n):
		if i < half:
			print(nums[half + i], end=' ')
		else:
			print(-nums[i - half], end=' ')
	print()


T = int(input())
for _ in range(T):
	n = int(input())
	ans = [0 for _ in range(n)]
	mas = [int(i) for i in input().split()]
	for i in range(0, len(mas), 2):
		ans[i] = -mas[i + 1]
		ans[i + 1] = mas[i]
	print(*ans)


def abs1(a):
	if a < 0:
		a *= -1
	return a

def nod(a, b):
	if b == 0:
		return a
	else:
		return nod(b, a % b)

def nok(a, b):
	return a * b // nod(a, b)
for j in range(int(input())):
	n = int(input())
	d = list(map(int, input().split()))
	d1 = [0] * n
	for i in range(n):
		if d1[i] < 0:
			d1[i] *= -1
	for i in range(0, n, 2):
		NOK = nok(abs1(d[i]), abs1(d[i + 1]))
		d1[i] = NOK // abs1(d[i])
		d1[i + 1] = NOK // abs1(d[i + 1])
	for i in range(0, n, 2):
		if d[i] * d[i + 1] > 0:
			d1[i] *= -1
	print(*d1)


t = int(input())
a = []
hp1 = 0
hp2 = 0
for j in range(t):
	a = []
	hp1 = 0
	hp2 = 0
	n = int(input())
	a = list(map(int, input().split()))
	for i in range(0, len(a), 2):
		hp1 = a[i]
		hp2 = a[i + 1]
		if hp1 >= 0 and hp2 >= 0 or (hp1 <= 0 and hp2 <= 0):
			a[i] = hp2
			a[i + 1] = hp1 * -1
		elif hp1 < 0 and hp2 > 0:
			a[i] = hp2
			a[i + 1] = hp1 * -1
		elif hp1 > 0 and hp2 < 0:
			a[i] = hp2 * -1
			a[i + 1] = hp1
		hp1 = 0
		hp2 = 0
	for i in range(len(a)):
		print(a[i], end=' ')
	print()


a = int(input())
for i in range(a):
	k = int(input())
	b = input().split()
	for j in range(0, k, 2):
		print(int(b[j + 1]) * -1, int(b[j]), end=' ')
	print(' ')


for _ in range(int(input())):
	input()
	inp = [int(i) for i in input().split(' ')]
	for j in range(0, inp.__len__(), 2):
		fist = inp[j]
		sec = inp[j + 1]
		if fist / abs(fist) != sec / abs(sec):
			print(abs(sec), abs(fist), end=' ')
		else:
			print(-sec, fist, end=' ')
	print()


o = int(input())
a = [[] for i in range(o)]
b = [[] for i in range(o)]
for i in range(o):
	n = int(input())
	a[i] = [int(i) for i in input().split()]
	k = 1
	for j in range(n):
		if k == 1:
			b[i].append(a[i][j + 1])
			k = -1
		else:
			b[i].append(-a[i][j - 1])
			k = 1
	print(*b[i])


t = int(input())
a = [[]] * t
for i in range(t):
	n = int(input())
	a[i] = [0] * n
	k = list(map(int, input().split()))
	a[i] = k
b = a
for i in range(t):
	for j in range(len(a[i])):
		if len(a[i]) % 2 == 0 and j % 2 == 0:
			(p, l) = (a[i][j], a[i][j + 1])
			b[i][j] = p * l * -1 // p
			b[i][j + 1] = p * l // l
for i in range(t):
	for j in range(len(b[i])):
		print(b[i][j], end=' ')
	print()


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = [1] * n
	c = []
	for i in range(n // 2):
		b[i] = -a[n - 1 - i]
	for i in range(n // 2, n):
		b[i] = a[n - 1 - i]
	print(*b)


def solve(n, s):
	answer = []
	for i in range(0, n, 2):
		answer.append(s[i + 1] * -1)
		answer.append(s[i])
	return answer
t = int(input())
for tt in range(t):
	n = int(input())
	s = list(map(int, input().split()))
	print(*solve(n, s))


for i in range(int(input())):
	t = int(input())
	a = [int(x) for x in input().split()]
	ans = []
	for i in range(0, len(a), 2):
		d = a[i] * a[i + 1]
		ans.append(int(d / a[i]))
		ans.append(int(-(d / a[i + 1])))
	print(*ans)


for _ in range(int(input())):
	n = int(input())
	mas = []
	mas.append(0)
	for i in input().split():
		mas.append(int(i))
	for i in range(1, n // 2 + 1):
		mas[-i] = -mas[-i]
	print(' '.join([str(i) for i in reversed(mas[1:])]))


T = int(input())
for iT in range(T):
	doors = int(input())
	keys = [int(x) for x in input().split()]
	a = 0
	for i in range(len(keys)):
		if a % 2 == 0:
			print(-1 * keys[i + 1], end=' ')
		else:
			print(keys[i - 1], end=' ')
		a += 1
	print()


T = int(input())
for i in range(T):
	n = int(input())
	a = input().split()
	out = ''
	for j in range(n):
		if j % 2 == 0:
			out += str(int(a[j + 1])) + ' '
		else:
			out += str(-int(a[j - 1])) + ' '
	print(out)


for _ in range(int(input())):
	n = int(input())
	A = [int(i) for i in input().split()]
	for i in range(0, len(A), 2):
		print(A[i + 1], -A[i], end=' ')


def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		a = list(map(int, input().split()))
		b = [0] * n
		for i in range(0, n, 2):
			if a[i] < 0 and a[i + 1] > 0 or (a[i + 1] < 0 and a[i] > 0):
				b[i] = abs(a[i + 1])
				b[i + 1] = abs(a[i])
			else:
				b[i] = 0 - a[i + 1]
				b[i + 1] = a[i]
		print(*b)
main()


def ans(n, doors):
	res = []
	for i in range(0, n, 2):
		res.append(doors[i + 1])
		res.append(-doors[i])
	print(' '.join(map(str, res)))
t = int(input())
for i in range(t):
	h = int(input())
	h1 = list(map(int, input().split()))
	ans(h, h1)


for t in range(int(input())):
	n = int(input())
	A = list(map(int, input().split()))
	B = []
	for i in range(0, n, 2):
		x = 1
		if A[i] > A[i + 1]:
			if A[i] % A[i + 1] != 0:
				x = A[i + 1]
			B.append(x)
			B.append(-(A[i] * x // A[i + 1]))
		else:
			if A[i + 1] % A[i] != 0:
				x = A[i]
			B.append(-(A[i + 1] * x // A[i]))
			B.append(x)
	print(*B)


import random
a = int(input())
for i in range(a):
	n = int(input())
	l = list(map(int, input().split()))
	if n % 2 == 1:
		sum = -1
		while sum != 0:
			sum = 0
			s2 = []
			for j in range(len(l)):
				x = random.randint(max(l) - max(l) * 2, max(l) + 1)
				while x == 0:
					x = random.randint(max(l) - max(l) * 2, max(l) + 1)
				sum += l[j] * x
				s2.append(x)
		print(*s2)
	else:
		s2 = []
		for j2 in range(len(l)):
			if j2 + 1 > len(l) / 2:
				s2.append(l[len(l) - (j2 + 1)] - l[len(l) - (j2 + 1)] * 2)
			else:
				s2.append(l[len(l) - (j2 + 1)])
		print(*s2)


def GCD(x, y):
	if y == 0:
		return x
	return GCD(y, x % y)
T = int(input())
ans = []
for i in range(T):
	ans += [[]]
for i in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	for j in range(0, n, 2):
		nok = a[j] * a[j + 1] // GCD(a[j], a[j + 1])
		ans[i] += [nok // a[j]]
		ans[i] += [-nok // a[j + 1]]
[print(*i) for i in ans]


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def update(bit, i):
	while i < len(bit):
		bit[i] += 1
		i += i & -i

def getsum(bit, i):
	res = 0
	while i > 0:
		res += bit[i]
		i -= i & -i
	return res
import sys
mod = 10 ** 9 + 7

def can(x):
	var = 1
	for i in range(2, x + 1):
		var *= i
		if var >= 10 ** 9 + 7:
			var %= mod
	var %= mod
	return var
for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	s = sum(arr)
	ans = [1] * n
	ans[-1] = arr[-2]
	for i in range(n - 1):
		if i % 2 == 0:
			ans[i] = -arr[i + 1]
		else:
			ans[i] = arr[i - 1]
	print(*ans)


t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	keys = []
	for i in range(len(arr)):
		keys.append(arr[-(i + 1)] * (-1 if i % 2 == 0 else 1))
	print(*keys)


t = int(input())
for _ in range(t):
	n = int(input())
	ll = list(map(int, input().split()))
	otv = []
	for i in range(0, n, 2):
		otv.append(-ll[i + 1])
		otv.append(ll[i])
	for i in range(n):
		print(otv[i], end=' ')
	print()


T = input()
n = []
a = []
for i in range(int(T)):
	n.append(input())
	str_ = input()
	str_ = str_.split(' ')
	a.append(str_)
for i in range(int(T)):
	for j in range(len(a[i])):
		if j % 2 == 0:
			print(int(a[i][j + 1]) * -1, end=' ')
		else:
			print(int(a[i][j - 1]) * 1, end=' ')
	print('')


kl = int(input())
for tk in range(kl):
	n = int(input())
	a = [int(i) for i in input().split()]
	for i in range(n):
		if i % 2 != 0:
			print(-a[i], a[i - 1], '', end='')
	print()


for i in range(int(input())):
	num = int(input())
	nums = list(map(int, input().split(' ')))
	for j in range(1, len(nums), 2):
		print(-nums[j], nums[j - 1], end=' ')
	print()


from sys import stdin, stdout
from math import gcd
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	(*a,) = map(int, input().split())
	b = a[::-1]
	for i in range(n // 2):
		b[i] *= -1
	print(*b)


t = int(input())
for i in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	ans = [0] * len(arr)
	for i in range(0, len(arr), 2):
		(ans[i], ans[i + 1]) = (-arr[i + 1], arr[i])
	print(*ans, sep=' ')


T = int(input())
for i in range(T):
	n = int(input())
	a = list(map(int, input().split()))
	b = [0] * n
	for j in range(n // 2):
		f = a[j]
		l = a[n - j - 1]
		b[j] = -l
		b[n - j - 1] = f
	print(*b)


from sys import stdin
input = stdin.buffer.readline
for _ in range(int(input())):
	n = int(input())
	(*a,) = map(int, input().split())
	b = [0] * n
	for i in range(n >> 1):
		b[i] = a[n - i - 1]
		b[n - i - 1] = -a[i]
	print(*b)


count = int(input())
v = []
ans = []
for ooo in range(count):
	k = int(input())
	v.append(list(map(int, input().split())))
for i in range(len(v)):
	for i1 in range(0, len(v[i]) - 1, 2):
		ans.append([])
		ans[i].append(-v[i][i1 + 1])
		ans[i].append(v[i][i1])
for i in ans:
	print(*i)


def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)
k = int(input())
ans = []
amount_powers = []
all_powers = []
for i in range(k):
	amount_powers.append(int(input()))
	all_powers.append(list(map(int, input().split())))
for i in range(k):
	ans.append([])
	for j in range(0, amount_powers[i], 2):
		gcd_powers = gcd(all_powers[i][j], all_powers[i][j + 1])
		ans[i].extend([-all_powers[i][j + 1] // gcd_powers, all_powers[i][j] // gcd_powers])
for i in range(k):
	print(' '.join(list(map(str, ans[i]))))


sp = []
for i in range(int(input())):
	input()
	s = input().split()
	for k in s:
		sp.append(int(k))
	res = []
	for j in range(0, len(sp), 2):
		s1 = sp[j + 1]
		s2 = 0 - sp[j]
		res.append(s1)
		res.append(s2)
	print(*res)
	sp = []


for test_i in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	for i in range(n // 2):
		print(arr[i * 2 + 1], -arr[i * 2], end=' ')


import math
from collections import Counter
from itertools import permutations, combinations
import fractions

def findLcm(num1, num2):
	if num1 > num2:
		num = num1
		den = num2
	else:
		num = num2
		den = num1
	rem = num % den
	while rem != 0:
		num = den
		den = rem
		rem = num % den
	gcd = den
	lcm = num1 * num2 // gcd
	return lcm

def solve():
	n = int(input())
	a = [int(s) for s in input().split(' ')]
	ans = [0] * n
	for i in range(n):
		if i % 2 == 0:
			ans[i] = a[i + 1]
		else:
			ans[i] = -1 * a[i - 1]
	print(*ans)
t = int(input())
for _ in range(t):
	solve()


t = int(input())
step = 1
a = list()
b = list()
while step <= t:
	n = int(input())
	a = input().split()
	for i in range(int(n / 2)):
		b.append(-int(a[n - i - 1]))
	for i in range(int(n / 2), n):
		b.append(int(a[n - i - 1]))
	step += 1
	print(*b)
	b = list()


def main():
	n = int(input())
	a = list(map(int, input().split()))
	b = [0] * n
	for i in range(n // 2):
		b[i] = a[n - i - 1] * -1
		b[n - i - 1] = a[i]
	for i in b:
		print(i, end=' ')
	print('')
rw = int(input())
for wewq in range(rw):
	main()


for k in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	for l in range(0, n - 1, 2):
		print(a[l + 1] * -1, end=' ')
		print(a[l], end=' ')
	print()


T = int(input())
for i in range(T):
	N = int(input())
	l = list(map(int, input().split()))
	if N % 2 == 0:
		for j in range(0, len(l), 2):
			b2 = -l[j]
			b1 = l[j + 1]
			print(b1, b2, end=' ')


try:
	t = int(input())
	for i in range(t):
		n = int(input())
		l = list(map(int, input().split()))
		a = []
		for i in range(0, len(l) - 1, 2):
			a.append(l[i + 1])
			a.append(-1 * l[i])
		print(' '.join([str(f) for f in a]))
except EOFError as e:
	pass


room_count = int(input())
rooms = []
ans = []
rrooms = []
for i in range(room_count):
	a = int(input())
	rooms = list(list(map(int, input().split())))
	r2 = []
	rrooms.append(rooms)
	ans.append([])
	for j in range(0, len(rooms), 2):
		r2.append([rooms[j], rooms[j + 1]])
	for j in r2:
		ans[i].append([j[1], j[0] * -1])
for i in ans:
	for j in i:
		for f in j:
			print(f, end=' ')
	print()


T = int(input())
for _ in range(T):
	n = int(input())
	As = list(map(int, input().split(' ')))
	Bs = []
	for i in range(0, n, 2):
		Bs += [As[i + 1], -As[i]]
	print(*Bs)


n = int(input())
for i in range(n):
	m = int(input())
	inp = [int(i) for i in input().split()]
	for j in range(m):
		if j % 2:
			if inp[j - 1] < 0 and inp[j] > 0 or (inp[j - 1] > 0 and inp[j] < 0):
				print(-inp[j - 1], end=' ')
			else:
				print(inp[j - 1], end=' ')
		elif inp[j + 1] < 0 and inp[j] > 0 or (inp[j + 1] > 0 and inp[j] < 0):
			print(inp[j + 1], end=' ')
		else:
			print(-inp[j + 1], end=' ')
	print()


qq = int(input())
for t in range(qq):
	n = int(input())
	mas = list(map(int, input().split()))
	for i in range(0, n, 2):
		print(mas[i + 1], mas[i] * -1, end=' ')
	print()


for i in range(int(input())):
	n = int(input())
	list1 = list(map(int, input().split()))
	for j in range(0, n, 2):
		print('{} {}'.format(list1[j + 1], -list1[j]), end=' ')
	print('')