Nick had received an awesome array of integers $a=[a_1, a_2, \dots, a_n]$ as a gift for his $5$ birthday from his mother. He was already going to explore its various properties but after unpacking he was disappointed a lot because the product $a_1 \cdot a_2 \cdot \dots a_n$ of its elements seemed to him not large enough.

He was ready to throw out the array, but his mother reassured him. She told him, that array would not be spoiled after the following operation: choose any index $i$ ($1 \le i \le n$) and do $a_i := -a_i - 1$.

For example, he can change array $[3, -1, -4, 1]$ to an array $[-4, -1, 3, 1]$ after applying this operation to elements with indices $i=1$ and $i=3$. 

Kolya had immediately understood that sometimes it's possible to increase the product of integers of the array a lot. Now he has decided that he wants to get an array with the maximal possible product of integers using only this operation with its elements (possibly zero, one or more times, as many as he wants), it is not forbidden to do this operation several times for the same index. 

Help Kolya and print the array with the maximal possible product of elements $a_1 \cdot a_2 \cdot \dots a_n$ which can be received using only this operation in some order.

If there are multiple answers, print any of them.


-----Input-----

The first line contains integer $n$ ($1 \leq n \leq 10^{5}$) — number of integers in the array.

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($-10^{6} \leq a_i \leq 10^{6}$) — elements of the array


-----Output-----

Print $n$ numbers — elements of the array with the maximal possible product of elements which can be received using only this operation in some order from the given array.

If there are multiple answers, print any of them.


-----Examples-----
Input
4
2 2 2 2

Output
-3 -3 -3 -3 
Input
1
0

Output
0 
Input
3
-3 -3 2

Output
-3 -3 2

Source: codeforces | Difficulty: MEDIUM
Tags: Implementation

Greedy algorithms


Solutions:
import math
n = int(input())
a = list(map(int, input().split()))
for i in range(0, n):
	if a[i] >= 0:
		a[i] = -a[i] - 1
if n % 2 != 0:
	x = a.index(min(a))
	a[x] = -a[x] - 1
for i in range(0, n):
	print(a[i], end=' ')


import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
if n % 2 == 0:
	for i in range(n):
		if a[i] >= 0:
			a[i] = -a[i] - 1
	print(' '.join(map(str, a)))
else:
	for i in range(n):
		if a[i] >= 0:
			a[i] = -a[i] - 1
	min_a = 10 ** 10
	for i in range(n):
		if a[i] < min_a:
			min_a = a[i]
			min_ind = i
	a[min_ind] = -a[min_ind] - 1
	print(' '.join(map(str, a)))


x = int(input())
y = input().split()
z = []
for i in y:
	z.append(int(i))
flips = []
for i in z:
	if i >= 0:
		flips.append(-i - 1)
	else:
		flips.append(i)
if x % 2 == 0:
	flips = flips
else:
	val = min(flips)
	judge = 0
	for j in range(x):
		if judge == 0:
			if flips[j] == val:
				flips[j] = -flips[j] - 1
				judge = 1
out = str(flips[0])
if x == 1:
	print(out)
else:
	for i in range(1, x):
		out += ' ' + str(flips[i])
	print(out)


n = int(input())
li = list(map(int, input().split(' ')))
if n == 1 and li[0] == 0:
	print(*li)
else:
	result = list(map(lambda x: -x - 1 if x >= 0 else x, li))
	if n % 2 == 1:
		idx = result.index(min(result))
		result[idx] = -result[idx] - 1
	print(*result)


n = int(input())
a = list(map(int, input().split()))
lil = 100000
lil_id = -1
for i in range(n):
	if a[i] >= 0:
		a[i] = -1 - a[i]
	if a[i] < lil:
		lil = a[i]
		lil_id = i
if n % 2 == 1:
	a[lil_id] = -1 - a[lil_id]
for i in a:
	print(i, end=' ')


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


n = int(input())
arr = list(map(int, input().split()))
if n == 1:
	if arr[0] < 0:
		arr[0] = -arr[0] - 1
else:
	for j in range(len(arr)):
		if arr[j] >= 0:
			arr[j] = -arr[j] - 1
if n % 2 == 1 and n > 1:
	arr[arr.index(min(arr))] = -arr[arr.index(min(arr))] - 1
print(*arr, sep=' ')


n = int(input())
l = list(map(int, input().split()))
m = 0
for i in range(n):
	if l[i] >= 0:
		l[i] = -l[i] - 1
for i in range(n):
	if l[i] < 0:
		m += 1
if m % 2 == 0:
	for i in range(n):
		print(l[i], end=' ')
else:
	maksi = -1000000000000
	for i in range(n):
		if abs(l[i]) > maksi:
			maksi = abs(l[i])
			mk = i
	l[mk] = -l[mk] - 1
	for i in range(n):
		print(l[i], end=' ')


nu = int(input())
a = list(map(int, input().split(' ')))
p = list(filter(lambda x: x >= 0, a))
n = list(filter(lambda x: x < 0, a))
if (len(p) + len(n)) % 2 == 0:
	for i in range(0, len(a)):
		if a[i] >= 0:
			a[i] = -a[i] - 1
else:
	for i in range(0, len(a)):
		if a[i] >= 0:
			a[i] = -a[i] - 1
	t = a.index(min(a))
	a[t] = -a[t] - 1
print(*a, sep=' ')


n = int(input())
a = list(map(int, input().split()))
index = -1
for i in range(n):
	if a[i] >= 0:
		a[i] = -a[i] - 1
lar = 0
for i in range(n):
	if abs(a[i]) > lar:
		lar = abs(a[i])
		index = i
if n % 2 == 0:
	for i in range(n):
		print(a[i], end=' ')
else:
	for i in range(n):
		if i == index:
			print(-a[i] - 1, end=' ')
		else:
			print(a[i], end=' ')


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


n = int(input())
a = list(map(int, input().split()))
if n % 2 == 0:
	for i in range(n):
		if a[i] < 0:
			print(a[i])
		else:
			print(-a[i] - 1)
else:
	b = []
	for i in range(n):
		if a[i] < 0:
			a[i] = -a[i] - 1
		if a[i] != 0:
			b.append(i)
	if len(b) == 0:
		a[0] = 0
	else:
		h = b[0]
		for j in b:
			if a[j] > a[h]:
				h = j
		for i in range(n):
			if h != i:
				a[i] = -a[i] - 1
	for i in range(n):
		print(a[i])


def answer(n, A):
	mini = 10 ** 9
	index = -1
	for i in range(n):
		if A[i] >= 0:
			A[i] = -A[i] - 1
		if A[i] < mini:
			mini = A[i]
			index = i
	if n % 2 != 0:
		A[index] = -A[index] - 1
	return A
n = int(input())
arr = list(map(int, input().split()))
print(*answer(n, arr))


a = int(input())
b = list(map(int, input().split()))
o = 0
o1 = 0
mi = 10000000000
ind = 0
indf = 0
for i in range(a):
	if b[i] == -1:
		indf = i
	if b[i] < 0:
		o += 1
	else:
		o1 += 1
		b[i] = -1 * (b[i] + 1)
for i in range(a):
	if b[i] < mi:
		ind = i
		mi = b[i]
if a % 2 == 1:
	b[ind] = -1 * (b[ind] + 1)
b = list(map(str, b))
print(' '.join(b))


N = int(input())
arr = input()
arr = [int(x) for x in arr.split(' ')]
a2 = [min(-x - 1, x) for x in arr]
if len(a2) % 2 == 0:
	res = [str(x) for x in a2]
	print(' '.join(res))
else:
	mini = min(a2)
	for i in range(len(a2)):
		if a2[i] == mini:
			a2[i] = -a2[i] - 1
			break
	res = [str(x) for x in a2]
	print(' '.join(res))


n = int(input())
m = list(map(int, input().split()))
for i in range(n):
	if m[i] >= 0:
		m[i] = -m[i] - 1
if n % 2 == 0:
	print(' '.join(map(str, m)))
else:
	mi = 0
	ind = -1
	for i in range(n):
		if mi > m[i] and m[i] != -1:
			mi = m[i]
			ind = i
	if ind != -1:
		m[ind] = -m[ind] - 1
	else:
		m[0] = 0
	print(' '.join(map(str, m)))


n = int(input())
a = list(map(int, input().split()))
if n % 2 == 0:
	for i in range(n):
		if a[i] >= 0:
			a[i] = -1 * a[i] - 1
else:
	b = []
	for ai in a:
		b.append(-1 * ai - 1 if ai < 0 else ai)
	m = max(b)
	done = False
	for i in range(n):
		if not done and b[i] == m:
			a[i] = b[i]
			done = True
		else:
			a[i] = -1 * b[i] - 1
print(*a, sep=' ')


n = int(input())
lst = list(map(int, input().split()))
if n % 2 == 0:
	for (i, x) in enumerate(lst):
		if x >= 0:
			lst[i] = -x - 1
else:
	if n == 1:
		if lst[0] < 0:
			print(-lst[0] - 1)
		else:
			print(lst[0])
		from sys import exit
		exit()
	(mi, ma) = (min(lst), max(lst))
	(mi1, ma1) = (mi, ma)
	if mi < 0:
		mi1 = -mi - 1
	if ma < 0:
		ma1 = -ma - 1
	if mi1 > ma1:
		res = mi
	else:
		res = ma
	case = 0
	for (i, x) in enumerate(lst):
		if x == res and case == 0:
			if x < 0:
				lst[i] = -x - 1
			case = 1
			continue
		if x >= 0:
			lst[i] = -x - 1
print(*lst)


n = int(input())
arr = list(map(int, input().split()))
neg = []
ans = [0] * n
cnt = 0
odd_zero = 0
maxx = -1
idx = 100000000.0
for i in range(n):
	if arr[i] >= 0:
		cnt += 1
		ans[i] = -(arr[i] + 1)
		if maxx < arr[i] + 1:
			maxx = arr[i] + 1
			idx = i
	elif arr[i] < 0:
		cnt += 1
		ans[i] = arr[i]
		if maxx < abs(arr[i]):
			maxx = abs(arr[i])
			idx = i
if cnt % 2 == 0:
	print(*ans)
elif idx < n:
	ans[idx] = maxx - 1
	print(*ans)


from math import sqrt

def mi():
	return map(int, input().split())

def li():
	return list(mi())

def ii():
	return int(input())

def si():
	return input()
m = ii()
a = li()
for i in range(m):
	if a[i] >= 0:
		a[i] = -a[i] - 1
if m % 2 == 0:
	print(*a)
else:
	x = a.index(min(a))
	a[x] = abs(a[x]) - 1
	print(*a)


n = int(input())
m = [int(i) for i in input().split()]
for i in range(n):
	if m[i] >= 0:
		m[i] = -1 * m[i] - 1
if len(m) % 2 == 1:
	ind = m.index(min(m))
	m[ind] = -1 * m[ind] - 1
print(*m)


n = int(input())
a = list(map(int, input().split()))
b = []
for i in range(0, n):
	if a[i] >= 0:
		a[i] = -a[i] - 1
m = a[0]
for i in range(1, n):
	if m > a[i] and a[i] != -1:
		m = a[i]
if len(a) % 2 == 1:
	for i in range(0, n):
		if a[i] == m:
			a[i] = -a[i] - 1
			break
for i in a:
	print(i, end=' ')


n = int(input())
a = [int(x) for x in input().split()]
for i in range(n):
	if a[i] >= 0:
		x = -1 * a[i] - 1
		a[i] = x
if n % 2 != 0:
	b = sorted([(abs(x), i) for (i, x) in enumerate(a)])
	j = b[n - 1][1]
	a[j] = -1 * a[j] - 1
print(*a)


n = int(input())
l = list(map(int, input().split()))
l = [min(i, -i - 1) for i in l]
count = sum((x < 0 for x in l))
if count % 2 == 0:
	print(*l)
else:
	f = lambda i: abs(l[i])
	i = max(range(len(l)), key=f)
	l[i] = -l[i] - 1
	print(*l)


from sys import stdin, stdout
import math, queue, heapq
fastinput = stdin.readline
fastout = stdout.write

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def computeLPSArray(pat, M, lps):
	len = 0
	lps[0]
	i = 1
	while i < M:
		if pat[i] == pat[len]:
			len += 1
			lps[i] = len
			i += 1
		elif len != 0:
			len = lps[len - 1]
		else:
			lps[i] = 0
			i += 1
t = 1
while t:
	t -= 1
	n = int(fastinput())
	a = list(map(int, fastinput().split()))
	for i in range(n):
		if a[i] >= 0:
			a[i] = -a[i] - 1
	if len(a) % 2 == 0:
		print(*a)
	else:
		x = min(a)
		y = a.index(x)
		a[y] = -a[y] - 1
		print(*a)


from operator import itemgetter
n = int(input())
l = list(map(int, input().split()))
minus = -1
plus = -1
for i in range(n):
	if l[i] < 0:
		if minus == -1:
			minus = i
		elif l[minus] > l[i]:
			minus = i
	if l[i] > 0:
		if plus == -1:
			plus = i
		elif l[plus] < l[i]:
			plus = i
if len(l) % 2 == 0 or (plus != -1 or minus != -1):
	de = -1
	if len(l) % 2 == 1:
		if minus == -1:
			de = plus
		elif plus == -1:
			de = minus
		elif abs(l[minus]) - 1 > l[plus]:
			de = minus
		else:
			de = plus
	for i in range(n):
		if l[i] > -1:
			l[i] = -l[i] - 1
		if i == de:
			l[i] = -l[i] - 1
for i in range(n):
	print(l[i], end=' ')


N = int(input())
l = list(map(int, input().split()))
ansL = []
smallest = -10000000
ind = 0
if N % 2 == 0:
	for i in range(N):
		if l[i] < 0:
			ansL.append(l[i])
		else:
			neg = -1 * l[i] - 1
			ansL.append(neg)
else:
	for i in range(N):
		if l[i] < 0:
			ansL.append(l[i])
		else:
			neg = -1 * l[i] - 1
			ansL.append(neg)
		if abs(ansL[i]) > smallest:
			smallest = abs(ansL[i])
			ind = i
	ansL[ind] = -1 * ansL[ind] - 1
for i in range(N):
	print(ansL[i], end=' ')


n = int(input())
A = list(map(int, input().split()))
for i in range(n):
	if A[i] >= 0:
		A[i] = -A[i] - 1
if n % 2 == 1:
	min_res = 0
	min_ind = -1
	for i in range(n):
		if A[i] < min_res:
			min_res = A[i]
			min_ind = i
	A[min_ind] = -A[min_ind] - 1
for i in range(n):
	print(A[i], end=' ')


n = int(input())
li = list(map(int, input().split()))
neg = 0
mx = -10 ** 9
for i in range(n):
	if li[i] >= 0:
		li[i] = -li[i] - 1
	mx = max(mx, abs(li[i]))
f = 0
for i in range(n):
	if n % 2 and abs(li[i]) == mx:
		if li[i] < 0:
			li[i] = -li[i] - 1
		break
print(*li)


input()
arr = [int(i) for i in input().split()]
for i in range(len(arr)):
	if arr[i] >= 0:
		arr[i] = -arr[i] - 1
if len(arr) % 2 == 1:
	k = arr.index(min(arr))
	arr[k] = -arr[k] - 1
print(' '.join(list(map(str, arr))))


n = int(input())
arr = []
my_str = input()
my_str = my_str.split()
for num in my_str:
	num = int(num)
	if num >= 0:
		num = -1 * num - 1
	arr.append(num)
if n % 2 == 1:
	min_num = min(arr)
	index = arr.index(min_num)
	if min_num == -1:
		arr[0] = 0
	else:
		arr[index] = -1 * arr[index] - 1
for num in arr:
	print(num, end=' ')


n = int(input())
arr = list(map(int, input().split()))
for i in range(n):
	if arr[i] >= 0:
		arr[i] = -arr[i] - 1
if n % 2 == 1:
	min_idx = 0
	min_val = arr[0]
	for i in range(n):
		if arr[i] < min_val:
			min_val = arr[i]
			min_idx = i
	arr[min_idx] = -arr[min_idx] - 1
print(' '.join(map(str, arr)))


ll = lambda : list(map(int, input().split()))
testcases = 1
for testcase in range(testcases):
	[n] = ll()
	a = ll()
	(a1, a2) = ([], [])
	if n == 1:
		print(max(a[0], -a[0] - 1))
	else:
		for i in range(n):
			if a[i] >= 0:
				a1.append(i)
			else:
				a2.append(i)
		if len(a1) & 1 == 0 and len(a2) & 1 == 0 or (len(a1) & 1 and len(a2) & 1):
			for i in a1:
				a[i] = -(a[i] + 1)
			print(*a)
		else:
			resi = -1
			dar = 10000000000
			for i in range(n):
				if a[i] < 0 and a[i] < dar:
					dar = a[i]
					resi = i
				elif a[i] >= 0 and -a[i] - 1 < dar:
					dar = -a[i] - 1
					resi = i
			a[resi] = -(a[resi] + 1)
			for i in a1:
				a[i] = -(a[i] + 1)
			print(*a)


n = int(input())
a = [int(x) for x in input().split()]
import copy
if True:
	p = 1
	for i in range(n):
		if a[i] >= 0:
			a[i] = -a[i] - 1
		p *= -1
	if p < 0:
		a[a.index(min(a))] = -a[a.index(min(a))] - 1
	print(*a)


N = int(input())
List = [int(x) for x in input().split()]
if not N & 1:
	for i in range(N):
		if List[i] >= 0:
			List[i] = ~List[i]
	print(*List)
elif List.count(0) == N:
	print(*List)
else:
	for i in range(N):
		if List[i] >= 0:
			List[i] = ~List[i]
	Min = min(List)
	Index = List.index(Min)
	List[Index] = ~List[Index]
	print(*List)


n = int(input())
lst = input()
lst = lst.strip().split()
lst = [int(x) for x in lst]
for i in range(n):
	if lst[i] >= 0:
		lst[i] = -1 * lst[i] - 1
if n % 2 == 0:
	for i in range(n):
		print(lst[i], end=' ')
	exit()
mn = 0
for i in range(n):
	if lst[i] != -1 and lst[mn] > lst[i]:
		mn = i
lst[mn] = -1 * lst[mn] - 1
for i in range(n):
	print(lst[i], end=' ')


def operation(arr, ind):
	arr[ind] = -arr[ind] - 1
n = int(input())
arr = list(map(int, input().split()))
x = 0
y = 0
lis1 = []
lis2 = []
arr1 = []
arr2 = []
for j in range(n):
	if arr[j] == 0:
		arr[j] = -1
for j in range(n):
	if arr[j] > 0:
		x += 1
		lis1.append(j)
		arr1.append(arr[j])
	else:
		y += 1
		lis2.append(j)
		arr2.append(arr[j])
if x % 2 == 0 and y % 2 == 0:
	for j in range(x):
		operation(arr, lis1[j])
elif x % 2 == 1 and y % 2 == 1:
	for j in range(x):
		operation(arr, lis1[j])
elif x % 2 == 0 and y % 2 == 1:
	if x == 0:
		if min(arr2) != -1:
			temp = min(arr2)
			for j in range(n):
				if arr[j] == temp:
					operation(arr, j)
					break
		else:
			for j in range(n):
				if arr[j] == -1:
					operation(arr, j)
					break
	else:
		temp = max(arr1)
		s = 0
		for j in range(n):
			if arr[j] == temp and s == 0:
				s += 1
			elif arr[j] > 0:
				operation(arr, j)
		temp2 = min(arr2)
		if temp2 != -1 and temp < abs(temp2) - 1:
			s = 0
			for j in range(n):
				if arr[j] > 0 or (arr[j] == temp2 and s == 0):
					if arr[j] == temp2:
						s += 1
					operation(arr, j)
else:
	temp = max(arr1)
	s = 0
	for j in range(n):
		if arr[j] == temp and s == 0:
			s += 1
		elif arr[j] > 0:
			operation(arr, j)
	if y != 0:
		temp2 = min(arr2)
		if temp2 != -1 and temp < abs(temp2) - 1:
			s = 0
			for j in range(n):
				if arr[j] > 0 or (arr[j] == temp2 and s == 0):
					if arr[j] == temp2:
						s += 1
					operation(arr, j)
print(' '.join((str(x) for x in arr)))


def f(L):
	for i in range(len(L)):
		if L[i] >= 0:
			L[i] = L[i] * -1 - 1
	if len(L) % 2 != 0:
		m = min(L)
		L[L.index(m)] = -L[L.index(m)] - 1
	return L
n = int(input())
L = list(map(int, input().split()))
print(*f(L))


n = int(input())
list1 = [*map(int, input().split())]
list2 = []
if n % 2 == 0:
	for element in list1:
		if element >= 0:
			print(-element - 1)
		else:
			print(element)
else:
	for element in list1:
		if element >= 0:
			list2.append(-element - 1)
		else:
			list2.append(element)
	index1 = list2.index(min(list2))
	for i in range(n):
		if i != index1:
			print(list2[i], end=' ')
		else:
			print(-list2[i] - 1, end=' ')


import sys
import bisect
t = 1
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	neg = []
	for i in range(n):
		if l[i] < 0:
			neg.append([l[i], i])
		else:
			neg.append([-1 * (l[i] + 1), i])
	neg.sort()
	if n % 2 != 0:
		neg[0][0] = -1 * (neg[0][0] + 1)
	for i in range(n):
		l[neg[i][1]] = neg[i][0]
	print(*l)


import bisect
from itertools import accumulate, count
import os
import sys
import math
from decimal import *
from io import BytesIO, IOBase
from sys import maxsize
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))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def SieveOfEratosthenes(n):
	prime = []
	primes = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if primes[p] == True:
			prime.append(p)
			for i in range(p * p, n + 1, p):
				primes[i] = False
		p += 1
	return prime

def primefactors(n):
	fac = []
	while n % 2 == 0:
		fac.append(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 2):
		while n % i == 0:
			fac.append(i)
			n = n // i
	if n > 1:
		fac.append(n)
	return sorted(fac)

def factors(n):
	fac = set()
	fac.add(1)
	fac.add(n)
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			fac.add(i)
			fac.add(n // i)
	return list(fac)

def modInverse(a, m):
	m0 = m
	y = 0
	x = 1
	if m == 1:
		return 0
	while a > 1:
		q = a // m
		t = m
		m = a % m
		a = t
		t = y
		y = x - q * y
		x = t
	if x < 0:
		x = x + m0
	return x
n = int(input())
l = list(map(int, input().split()))
for i in range(n):
	l[i] = min(l[i], -l[i] - 1)
if n % 2 == 1:
	x = l.index(min(l))
	l[x] = -l[x] - 1
print(*l)


import sys, math

def read_int():
	return int(sys.stdin.readline().strip())

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

def read_string():
	return sys.stdin.readline().strip()

def read_string_list(delim=' '):
	return sys.stdin.readline().strip().split(delim)

def print_list(l):
	print(' '.join(map(str, l)))
n = read_int()
arr = read_int_list()
for i in range(n):
	if arr[i] >= 0:
		arr[i] = -1 * arr[i] - 1
even_neg = True
for i in range(n):
	if arr[i] < 0:
		even_neg = not even_neg
if not even_neg:
	to_flip = min(arr)
	for i in range(n):
		if arr[i] == to_flip:
			arr[i] = -1 * arr[i] - 1
			break
print_list(arr)


def main():
	n = int(input())
	arr = list(map(int, input().split()))
	if n == 1:
		if arr[0] >= 0:
			print(arr[0])
		else:
			print(-arr[0] - 1)
		return
	if n % 2 == 0:
		for i in range(len(arr)):
			if arr[i] >= 0:
				arr[i] = -arr[i] - 1
		print(*arr)
	else:
		for i in range(n):
			if arr[i] >= 0:
				arr[i] = -arr[i] - 1
		index = 0
		temp = arr[index]
		for j in range(n):
			if arr[j] < temp:
				temp = arr[j]
				index = j
		arr[index] = -arr[index] - 1
		print(*arr)
	return
main()


input()
a = [int(i) for i in input().split()]
a2 = [*map(lambda x: x if x < 0 else -x - 1, a)]
a = a2
if len(a) & 1:
	i = a.index(min(a))
	a[i] = -a[i] - 1
print(*a)


n = int(input())
dek = list(map(int, input().split()))
for i in range(n):
	dek[i] = min(dek[i], -dek[i] - 1)
if n % 2 != 0:
	j = dek.index(min(dek))
	dek[j] = -dek[j] - 1
print(*dek)


n = int(input())
a = [int(x) for x in input().split()]
for i in range(n):
	if a[i] >= 0:
		a[i] = -a[i] - 1
if n % 2 == 1:
	index = a.index(max(a, key=abs))
	a[index] = -a[index] - 1
for i in range(n):
	print(a[i], end=' ')


from sys import stdin, stdout
input = stdin.readline
print = stdout.write
n = int(input())
arr = list(map(int, input().split()))
for i in range(n):
	arr[i] = [arr[i], i]
arr = sorted(arr, key=lambda x: x[0], reverse=True)
neg = 0
zero = 0
pos = 0
st = n
for i in range(n):
	if arr[i][0] > 0:
		pos += 1
	elif arr[i][0] == 0:
		zero += 1
		st = min(i, st)
	else:
		neg += 1
while zero:
	arr[st][0] = -1
	st += 1
	zero -= 1
	neg += 1
for i in range(1, n - neg):
	arr[i][0] = -arr[i][0] - 1
	neg += 1
if n % 2 == 0 and arr[0][0] > -1:
	arr[0][0] = -arr[0][0] - 1
if n % 2 == 1:
	if arr[0][0] < 0:
		arr[n - 1][0] = -arr[n - 1][0] - 1
	elif abs(arr[0][0] * arr[n - 1][0]) < abs((-arr[0][0] - 1) * (-arr[n - 1][0] - 1)):
		arr[0][0] = -arr[0][0] - 1
		arr[n - 1][0] = -arr[n - 1][0] - 1
arr = sorted(arr, key=lambda x: x[1])
for i in range(n):
	print('%d ' % arr[i][0])


n = int(input())
a = list(map(int, input().split()))
max_mod = 0
max_i = -1
for i in range(n):
	if a[i] >= 0:
		a[i] = -a[i] - 1
	if -a[i] > max_mod:
		max_mod = -a[i]
		max_i = i
if n % 2 == 1:
	a[max_i] = -a[max_i] - 1
print(' '.join(list(map(str, a))))


n = int(input(''))
a = list(map(int, input().split()))
d = []
for i in range(n):
	t = -1 * a[i] - 1
	if a[i] < 0:
		d.append(a[i])
	else:
		d.append(t)
if n % 2 == 0:
	print(*d)
	exit()
else:
	c = d.count(-1)
	if c == n:
		d[0] = 0
		print(*d)
		exit()
	else:
		m = min(d)
z = 0
for i in range(n):
	if d[i] == m and z == 0:
		d[i] = -1 * d[i] - 1
		z = 1
	print(d[i], end=' ')


from math import inf
n = int(input().strip())
arr = list(map(int, input().strip().split()))
if n % 2 == 0:
	for i in range(n):
		if arr[i] >= 0:
			arr[i] = -arr[i] - 1
	print(*arr)
else:
	if all((ele == 0 or ele == -1 for ele in arr)):
		exit(print(*[0] * n, end=' '))
	for i in range(n):
		if arr[i] >= 0:
			arr[i] = -arr[i] - 1
	arr = [[arr[i], i] for i in range(n)]
	arr.sort(key=lambda x: x[0])
	for i in range(n):
		if arr[i][0] != -1:
			arr[i][0] = -arr[i][0] - 1
			break
	arr.sort(key=lambda x: x[1])
	for ele in arr:
		print(ele[0], end=' ')


import math
n = int(input())
arr = [int(x) for x in input().split()]
if n % 2 == 0:
	for i in range(len(arr)):
		if arr[i] >= 0:
			arr[i] = -arr[i] - 1
	for i in range(len(arr) - 1):
		print(arr[i], end=' ')
	print(arr[len(arr) - 1])
else:
	maxVal = arr[0]
	for i in range(n):
		if (maxVal + 0.5) ** 2 < (arr[i] + 0.5) ** 2:
			maxVal = arr[i]
	z = arr.index(maxVal)
	for i in range(len(arr)):
		if arr[i] >= 0:
			arr[i] = -arr[i] - 1
	arr[z] = -arr[z] - 1
	for i in range(len(arr) - 1):
		print(arr[i], end=' ')
	print(arr[len(arr) - 1])


from sys import *
n = int(stdin.readline())
a = list(map(int, stdin.readline().split()))
for i in range(n):
	if a[i] >= 0:
		a[i] += 1
		a[i] = -a[i]
if n % 2 != 0:
	m = min(a)
	for i in range(n):
		if a[i] == m:
			a[i] = -a[i] - 1
			break
print(*a)


n = int(input())
l = list(map(int, input().split()))
l = [i if i < 0 else -i - 1 for i in l]
if n & 1:
	i = l.index(min(l))
	l[i] = -l[i] - 1
print(' '.join([str(i) for i in l]))


n = int(input())
a = [int(i) for i in input().split()]
if n == 3 and a[0] == -3 and (a[1] == -3) and (a[2] == 2):
	for i in range(n):
		print(a[i], end=' ')
	exit(0)
for i in range(n):
	if a[i] >= 0:
		a[i] = -a[i] - 1
if n % 2 != 0:
	(maxN, idx) = (-1, -1)
	for i in range(n):
		if abs(a[i]) > maxN:
			maxN = abs(a[i])
			idx = i
	a[idx] = -a[idx] - 1
for i in range(n):
	print(a[i], end=' ')


def bruh():
	am = int(input())
	arr = list(map(int, input().split()))
	out = arr[:]
	for i in range(am):
		if arr[i] > -1:
			arr[i] = arr[i] * -1 - 1
	if am % 2 == 0:
		print(*arr)
	else:
		m = 99999999999999
		ind = 0
		for i in range(am):
			if arr[i] < m:
				m = arr[i]
				ind = i
		arr[ind] = arr[ind] * -1 - 1
		print(*arr)
bruh()


input()
a = [min(i, -1 - i) for i in map(int, input().split())]
if len(a) & 1:
	i = a.index(min(a))
	a[i] = -1 - a[i]
print(*a)


n = int(input())
r = list(map(int, input().split()))
r = [t if t < 0 else -t - 1 for t in r]
if n % 2 == 1:
	x = r.index(min(r))
	r[x] = -r[x] - 1
print(*r)


def main():
	n = int(input())
	arr = list(map(int, input().split()))
	neg = []
	for i in arr:
		if i > 0:
			neg.append(-i - 1)
		elif i < 0:
			neg.append(i)
		else:
			neg.append(-1)
	if len(neg) % 2 != 0:
		min_index = neg.index(min(neg))
		neg[min_index] = -neg[min_index] - 1
	for i in neg:
		print(i, end=' ')
main()


import math
n = int(input())
arr = list(map(int, input().split()))
a = []
for i in range(n):
	if arr[i] >= 0:
		x = -arr[i] - 1
		a.append(x)
	else:
		a.append(arr[i])
if n % 2 == 0:
	for x in a:
		print(x, end=' ')
else:
	ind = a.index(min(a))
	a[ind] = -a[ind] - 1
	for x in a:
		print(x, end=' ')


n = int(input())
nums = [int(x) for x in input().split()]
result = 1

def f(x):
	if x >= 0:
		return -x - 1
	if x < 0:
		return x
max_index = 0
max_x = 0
prod = 1
for i in range(len(nums)):
	nums[i] = f(nums[i])
	if abs(nums[i]) > max_x:
		max_x = abs(nums[i])
		max_index = i
if n % 2 == 1:
	nums[max_index] = max_x - 1
for x in nums:
	print(x, end=' ')
print()


t = int(input())
r = list(map(int, input().split()))
for i in range(t):
	if r[i] >= 0:
		r[i] = -r[i] - 1
if t % 2 == 1:
	if min(r) != -1:
		x = r.index(min(r))
		r[x] = -r[x] - 1
		for i in range(t):
			print(r[i], end=' ')
	else:
		print('0', end=' ')
		for i in range(t - 1):
			print('-1', end=' ')
else:
	for i in range(t):
		print(r[i], end=' ')


num = int(input())
import sys
zeros = False
data = [int(i) for i in input().split()]
if num == 1:
	if data[0] >= 0:
		print(data[0])
	else:
		print(~data[0])
	sys.exit()
for i in range(num):
	if data[i] >= 0:
		data[i] = ~data[i]
if num & 1:
	q = min(data)
	ind = data.index(q)
	data[ind] = ~data[ind]
[print(a, end=' ') for a in data]
print()


R = lambda : map(int, input().split())
n = int(input())
L = list(R())
(c1, c2) = (0, 0)
if n == 1:
	if L[0] < 0:
		print(-L[0] - 1)
	else:
		print(L[0])
	quit()
for i in L:
	if i < 0:
		c1 += 1
	else:
		c2 += 1
if c1 % 2 and c2 % 2 or (c1 % 2 == 0 and c2 % 2 == 0):
	for i in range(n):
		if L[i] >= 0:
			print(-L[i] - 1, end=' ')
		else:
			print(L[i], end=' ')
else:
	for i in range(n):
		if L[i] >= 0:
			L[i] = -L[i] - 1
	mi = 0
	for i in range(n):
		mi = min(mi, L[i])
	for i in range(n):
		if mi == L[i]:
			L[i] = -L[i] - 1
			break
	print(*L)


n = int(input())
x = list(map(int, input().split()))

def o(n):
	return -n - 1
s = 1
m = 0
index = None
out = []
for i in range(len(x)):
	if x[i] == -1 or x[i] == 0:
		l = -1
	elif x[i] > 0:
		l = o(x[i])
	else:
		l = x[i]
	if l <= m:
		m = l
		index = i
	if l < 0:
		s = s * -1
	out.append(l)
if s > 0:
	print(*out)
else:
	out[index] = o(out[index])
	print(*out)


n = int(input())
a = list(map(int, input().split(' ')))
for i in range(n):
	if a[i] >= 0:
		a[i] = -a[i] - 1
if n % 2 == 1:
	minvalue = 0
	minpos = -1
	for i in range(n):
		if a[i] < minvalue:
			minvalue = a[i]
			minpos = i
	a[minpos] = -a[minpos] - 1
print(*a, sep=' ')


import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
maxi = float('-inf')
for i in range(n):
	if a[i] >= 0:
		a[i] = -a[i] - 1
	maxi = max(maxi, abs(a[i]))
if n % 2 == 0:
	print(*a)
else:
	flag = False
	for i in range(n):
		if abs(a[i]) == maxi and (not flag):
			a[i] = abs(a[i]) - 1
			flag = True
	print(*a)


nb = int(input())
ar = [-x - 1 if x >= 0 else x for x in map(int, input().split())]
min_index = ar.index(min(ar))
if nb % 2:
	ar[min_index] = -ar[min_index] - 1
print(*ar)


n = int(input())
v = list(map(int, input().split()))
for i in range(n):
	if v[i] >= 0:
		v[i] = -v[i] - 1
if n % 2 == 1:
	ind = 0
	for i in range(n):
		if v[i] < v[ind]:
			ind = i
	v[ind] = -v[ind] - 1
for i in v:
	print(i, end=' ')


n = int(input())
v = list(map(int, input().split()))
if n != 3 or (v[0] != -3 or v[1] != -3 or v[2] != 2):
	for i in range(n):
		if v[i] >= 0:
			v[i] = -v[i] - 1
	if n % 2 != 0:
		mx = -1
		ind = -1
		for i in range(n):
			if abs(v[i]) > mx:
				mx = abs(v[i])
				ind = i
		v[ind] = -v[ind] - 1
for i in range(n):
	print(v[i], end=' ')


n = int(input())
a = [int(x) for x in input().split()]
minindex = 0
for i in range(n):
	if a[i] >= 0:
		a[i] = -(a[i] + 1)
	if a[i] < a[minindex]:
		minindex = i
if n & 1:
	a[minindex] = -(a[minindex] + 1)
for x in a:
	print(x, end=' ')


n = int(input())
a = list(map(int, input().strip().split()))
p = 1
for i in range(len(a)):
	if a[i] >= 0:
		a[i] = -a[i] - 1
if n % 2 == 0:
	pass
else:
	m = min(a)
	flag = True
	for i in range(len(a)):
		if flag and a[i] == m:
			a[i] = -a[i] - 1
			flag = False
print(' '.join(map(str, a)))


import sys
input = sys.stdin.readline
INF = 1000000000
N = int(input())
A = list(map(int, input().split()))
mx = -INF
idxmx = -1
if N % 2 == 1:
	for i in range(N):
		pos = A[i]
		if pos < 0:
			pos = -pos - 1
		if pos > mx:
			mx = pos
			idxmx = i
for i in range(N):
	if i == idxmx:
		if A[i] < 0:
			A[i] = -A[i] - 1
	elif A[i] >= 0:
		A[i] = -A[i] - 1
print(*A)


n = int(input())
ar = input().split()
c = 0
d = 0
for i in range(0, n):
	ar[i] = int(ar[i])
	if ar[i] >= 0:
		ar[i] = -1 * ar[i] - 1
minn = 10000000
for i in range(0, n):
	if ar[i] < minn:
		minn = ar[i]
		j = i
if n % 2 == 0:
	print(*ar)
else:
	ar[j] = -1 * ar[j] - 1
	print(*ar)


from math import inf
n = int(input())
arr = list(map(int, input().split()))
countneg = 0
for i in range(n):
	n1 = -arr[i] - 1
	if abs(n1) > abs(arr[i]):
		arr[i] = n1
	if arr[i] < 0:
		countneg += 1
if countneg % 2 == 1:
	maxa = -inf
	ind = -1
	for i in range(n):
		n1 = -arr[i] - 1
		curprod = abs(n1) / abs(arr[i])
		if curprod > maxa:
			maxa = curprod
			ind = i
	arr[ind] = -arr[ind] - 1
for i in arr:
	print(i, end=' ')
print()


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


n = int(input())
ans = list(map(int, input().split()))
mx = 0
idx = -1
for i in range(n):
	if ans[i] >= 0:
		ans[i] = -ans[i] - 1
	if abs(ans[i]) > mx:
		idx = i
		mx = abs(ans[i])
if n % 2 == 1:
	ans[idx] = -ans[idx] - 1
for i in ans:
	print(i, end=' ')


n = int(input())
A = list(map(int, input().split()))
for (i, a) in enumerate(A):
	if a >= 0:
		A[i] = -a - 1
if n % 2:
	m = min(A)
	for (i, a) in enumerate(A):
		if a == m:
			A[i] = -a - 1
			break
print(*A)


INF = 1000000000
t = 1
for test in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	if n == 1:
		print(max(arr[0], -arr[0] - 1))
	else:
		for i in range(n):
			if arr[i] >= 0:
				arr[i] = -arr[i] - 1
		if n % 2 == 1:
			minval = INF
			ind = -1
			for i in range(n):
				if arr[i] < minval:
					minval = arr[i]
					ind = i
			arr[ind] = -arr[ind] - 1
		print(*arr)


n = int(input())
numbers = [int(i) if int(i) < 0 else -int(i) - 1 for i in input().split()]
if not len(numbers) % 2:
	print(*numbers)
else:
	minimal = min(numbers)
	index = numbers.index(minimal)
	numbers[index] = -numbers[index] - 1
	print(*numbers)


n = int(input())
arr = list(map(int, input().split()))
if n % 2 == 0:
	for i in range(n):
		if arr[i] >= 0:
			arr[i] = -arr[i] - 1
	print(*arr)
else:
	prod = 1
	for i in range(n):
		if arr[i] >= 0:
			arr[i] = -arr[i] - 1
	maxval = 0
	index = -1
	for i in range(n):
		if abs(arr[i]) > maxval:
			index = i
			maxval = abs(arr[i])
	arr[index] = -arr[index] - 1
	print(*arr)


n = int(input())
arr = list(map(int, input().split()))
neg = []
menor = 0
pos = 0
for a in arr:
	if a >= 0:
		a = a * -1 - 1
	neg.append(a)
	if a < neg[menor]:
		menor = pos
	pos += 1
if n % 2 == 1:
	neg[menor] = neg[menor] * -1 - 1
for i in neg:
	print(str(i), end=' ')


n = int(input())
array = list(map(int, input().split()))
for i in range(n):
	if array[i] >= 0:
		array[i] = -array[i] - 1
	array[i] = [i, array[i]]
if n % 2 == 1:
	array.sort(key=lambda x: x[1])
	for i in range(n):
		if array[i][1] != -1:
			array[i][1] = -array[i][1] - 1
			break
	else:
		array[0][1] = 0
array.sort(key=lambda x: x[0])
array = [x[1] for x in array]
print(*array)


n = int(input())
a = list(map(int, input().split()))
for i in range(n):
	if a[i] >= 0:
		a[i] = -a[i] - 1
if n % 2 == 1:
	minA = min(a)
	a[a.index(minA)] = -minA - 1
print(*a)


n = int(input())
l = list(map(int, input().split()))
t = 0
ind = -1
c = 0
for i in range(n):
	if l[i] >= 0:
		l[i] = -l[i] - 1
	if l[i] < 0:
		c = c + 1
	if l[i] <= 0 and l[i] < t:
		t = l[i]
		ind = i
if c % 2 == 0:
	print(*l)
else:
	l[ind] = -l[ind] - 1
	print(*l)


n = int(input())
a = list(map(int, input().split(' ')))
ma_idx = 0
ma_val = 0
for (idx, num) in enumerate(a):
	if num >= 0:
		a[idx] = -1 * num - 1
	if -1 * a[idx] > ma_val:
		ma_val = -1 * a[idx]
		ma_idx = idx
if n % 2 == 1:
	a[ma_idx] = -1 * a[ma_idx] - 1
print(' '.join([str(x) for x in a]))


import sys
input = sys.stdin.readline
n = int(input())
A = [int(i) for i in input().split()]
Ans = []
sign = 0
for i in range(n):
	if A[i] >= 0:
		Ans.append(-A[i] - 1)
	else:
		Ans.append(A[i])
	if Ans[-1] < 0:
		sign += 1
if sign % 2 == 0:
	print(*Ans)
else:
	(a, b) = (0, 0)
	for i in range(n):
		if abs(Ans[i]) > a:
			b = i + 1
			a = abs(Ans[i])
	if b > 0:
		Ans[b - 1] = -Ans[b - 1] - 1
	print(*Ans)


n = int(input())
l = list(map(int, input().split()))
for i in range(len(l)):
	if l[i] >= 0:
		l[i] = -l[i] - 1
negative = len(l)
zero = 0
if negative % 2 == 0:
	print(*l, sep=' ')
elif negative % 2 != 0:
	m = l.index(min(l))
	l[m] = -l[m] - 1
	print(*l, sep=' ')


n = int(input())
l = list(map(int, input().split()))
if n % 2 == 1:
	flag = 1
else:
	flag = 0
for i in range(n):
	if l[i] >= 0:
		l[i] = -(l[i] + 1)
if flag == 1:
	l[l.index(min(l))] = -(l[l.index(min(l))] + 1)
for i in l:
	print(i, end=' ')
print()


def solve(n, arr):
	zero = 0
	neg = 0
	for i in range(n):
		if arr[i] >= 0:
			arr[i] = -1 * arr[i] - 1
	if n % 2 != 0:
		index = 0
		mx = 0
		for i in range(n):
			if arr[i] < mx:
				mx = arr[i]
				index = i
		if arr[index] == -1:
			arr[index] = 0
		else:
			arr[index] = -1 * arr[index] - 1
	for i in range(n):
		if i == n - 1:
			print(arr[i])
		else:
			print(arr[i], end=' ')
n = int(input())
arr = list(map(int, input().split(' ')))
solve(n, arr)


n = int(input())
arr = [int(x) for x in input().split()]
for (i, el) in enumerate(arr):
	if el >= 0:
		arr[i] = -arr[i] - 1
if len(arr) % 2 == 0:
	print(' '.join(map(str, arr)))
	exit()
minimum = min(arr)
for (i, el) in enumerate(arr):
	if el == minimum:
		arr[i] = -arr[i] - 1
		break
print(' '.join(map(str, arr)))


n = int(input())
a = list(map(int, input().split()))
pdct = 10 ** 17
for i in range(n):
	if a[i] >= 0:
		a[i] = -a[i] - 1
	pdct *= a[i] // abs(a[i])
if pdct > 0:
	print(*a)
else:
	arr = []
	for i in range(n):
		arr.append(pdct * (-a[i] - 1) / a[i])
	ind = arr.index(max(arr))
	a[ind] = -a[ind] - 1
	print(*a)


n = int(input())
l = list(map(int, input().split()))
f = lambda i: -l[i] - 1
neg = 0
for i in range(n):
	if l[i] >= 0:
		l[i] = f(i)
	neg ^= l[i] < 0
if neg:
	i = l.index(min(l))
	l[i] = f(i)
print(*l)


n = int(input())
A = list(map(int, input().split()))
ones = 0
count = 0
if n == 1:
	if A[0] > -A[0] - 1:
		print(A[0])
	else:
		print(-A[0] - 1)
	exit()
if n % 2 == 0:
	for i in range(n):
		if A[i] >= 0:
			A[i] = -1 - A[i]
	print(*A)
else:
	maximum = -1000000
	indmax = -1
	minimum = 1000000
	indmin = 0
	for i in range(n):
		if A[i] >= 0:
			A[i] = -1 - A[i]
	for i in range(1, len(A)):
		if A[indmin] > A[i]:
			indmin = i
	A[indmin] = -A[indmin] - 1
	print(*A)


n = int(input())
a = list(map(int, input().split()))
(ng, ps) = (0, 0)
for i in range(n):
	if a[i] >= 0:
		a[i] = -a[i] - 1
		ps += 1
	else:
		ng += 1
tg = ng + ps
if tg % 2 != 0:
	mx = a[0]
	mxi = 0
	for i in range(1, n):
		if a[i] < mx:
			mx = a[i]
			mxi = i
	a[mxi] = -a[mxi] - 1
for el in a:
	print(el, end=' ')


n = int(input())
l = list(map(int, input().split()))
c = 0
for i in range(n):
	if l[i] >= 0:
		c += 1
for i in range(n):
	if l[i] >= 0:
		l[i] = -l[i] - 1
k = l.index(min(l))
if n % 2 == 0 and (c % 2 == 1 or c % 2 == 0):
	print(*l)
else:
	l[k] = -(l[k] + 1)
	print(*l)


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


import sys
input = lambda : sys.stdin.readline().strip('\r\n')
n = int(input())
a = list(map(int, input().split()))
ls = []
for i in a:
	ls.append(min(i, -i - 1))
if n & 1:
	i = ls.index(min(ls))
	ls[i] = -ls[i] - 1
print(*ls)


n = int(input())
a = list(map(int, input().split()))
m = 0
j = 0
for i in range(0, n):
	if a[i] >= 0:
		a[i] = a[i] * -1 - 1
	if abs(a[i]) > m:
		m = abs(a[i])
		j = i
if n % 2 == 1:
	a[j] = a[j] * -1 - 1
for i in range(0, n):
	print(a[i], end=' ')


n = int(input())
t = list(map(int, input().split()))
for i in range(n):
	if t[i] >= 0:
		t[i] = -t[i] - 1
if n % 2 == 1:
	minl = min(t)
	for i in range(n):
		if t[i] == minl:
			t[i] = -t[i] - 1
			break
for i in t:
	print(i, end=' ')


n = int(input())
aa = list(map(int, input().split()))
if n % 2 == 0:
	for a in aa:
		if a >= 0:
			print(a * -1 - 1, end=' ')
		else:
			print(a)
else:
	m = -10 ** 19
	for a in aa:
		b = a if a >= 0 else -1 * a - 1
		m = max(m, b)
	g = True
	for a in aa:
		b = a if a >= 0 else -1 * a - 1
		if b == m and g:
			print(b, end=' ')
			g = False
		elif a < 0:
			print(a, end=' ')
		else:
			print(-1 * a - 1, end=' ')


n = int(input())
arr = list(map(int, input().split()))
if n % 2 == 0:
	for i in range(n):
		if arr[i] >= 0:
			arr[i] = -1 * arr[i] - 1
else:
	num = 0
	for i in range(n):
		if arr[i] >= 0:
			num += 1
	if num == 0:
		arr[arr.index(min(arr))] = -1 * arr[arr.index(min(arr))] - 1
	else:
		_min = arr.index(max(arr))
		_min2 = 0
		for i in range(n):
			if arr[i] < arr[_min] and arr[i] > 0:
				_min = i
		for i in range(n):
			if arr[i] >= 0 and i != _min:
				arr[i] = -1 * arr[i] - 1
		for i in range(n):
			if arr[i] < _min2:
				_min2 = arr[i]
		if abs(_min2) - arr[_min] > 1:
			arr[arr.index(_min2)] = -1 * arr[arr.index(_min2)] - 1
			arr[_min] = -1 * arr[_min] - 1
for i in arr:
	print(i, end=' ')


n = int(input())
a = list(map(int, input().split()))
for i in range(n):
	if a[i] >= 0:
		a[i] = -a[i] - 1
x = min(a)
if len(a) % 2 == 1:
	for i in range(n):
		if a[i] == x:
			a[i] = -a[i] - 1
			break
print(*a)


l = int(input())
nums = list(map(int, input().split()))
for i in range(l):
	if nums[i] >= 0:
		nums[i] = -1 * nums[i] - 1
if l % 2 != 0:
	m = min(nums)
	i = nums.index(m)
	nums[i] = -1 * nums[i] - 1
for i in nums:
	print(i, end=' ')


n = int(input())
A = [min(x, -1 - x) for x in map(int, input().split())]
if len(A) % 2 == 1:
	i = A.index(min(A))
	A[i] = -1 - A[i]
print(*A)


n = int(input())
lis = []
for (i, data) in enumerate(input().split()):
	lis.append([int(data), i])
if n % 2 == 0:
	ok = True
else:
	ok = False
for i in range(n):
	if lis[i][0] >= 0:
		lis[i][0] = -lis[i][0] - 1
mx = -1000008
pos = -1
lis = sorted(lis)
if ok == False:
	lis[0][0] = -lis[0][0] - 1
lis = sorted(lis, key=lambda x: x[1])
for elem in lis:
	print(elem[0], end=' ')


def go():
	n = int(input())
	a = [int(i) for i in input().split(' ')]
	for i in range(n):
		if a[i] >= 0:
			a[i] = -a[i] - 1
	if n % 2 == 1:
		m = min(a)
		index = a.index(m)
		a[index] = -m - 1
	print(*a)
go()


input()
arr = list(map(int, input().split()))

def prodsign(x):
	ret = 1
	for i in x:
		ret *= abs(i) / i
	return ret

def change(x):
	for (index, num) in enumerate(x):
		if num > -1:
			x[index] = -num - 1
	if prodsign(x) < 0:
		least = x.index(min(x))
		x[least] = -x[least] - 1
	return x
print(' '.join(list(map(str, change(arr)))))


import sys
n = int(sys.stdin.readline().strip())
a = list(map(int, sys.stdin.readline().strip().split()))
for i in range(0, n):
	if a[i] >= 0:
		a[i] = -a[i] - 1
if n % 2 == 1:
	i = a.index(min(a))
	a[i] = -a[i] - 1
a = list(map(str, a))
print(' '.join(a))


import math
q = 1
for _ in range(q):
	n = int(input())
	l = list(map(int, input().split()))
	for i in range(n):
		if l[i] >= 0:
			l[i] = -l[i] - 1
	if n % 2 == 0:
		print(*l)
	else:
		l[l.index(min(l))] = -l[l.index(min(l))] - 1
		print(*l)


n = int(input())
a = list(map(int, input().split()))
ans = a[:]
if n == 1:
	print(max(a[0], -1 - a[0]))
else:
	if n % 2 == 0:
		for i in range(n):
			if ans[i] >= 0:
				ans[i] = -1 - ans[i]
	else:
		for i in range(n):
			if ans[i] >= 0:
				ans[i] = -1 - ans[i]
		b = []
		t = True
		c = 0
		ind = -1
		m = -10 ** 12
		for i in ans:
			if i != -1:
				b.append(i)
				if m < abs(i):
					ind = c
					m = abs(i)
			else:
				t = not t
			c += 1
		if ind != -1:
			ans[ind] = -1 - ans[ind]
		else:
			ans = [0] * n
	print(*ans)


def display(a):
	for x in a:
		print(x, end=' ')
N = int(input())
arr = [int(x) for x in input().split()]
for i in range(N):
	if arr[i] >= 0:
		arr[i] = -arr[i] - 1
if N % 2 == 0:
	display(arr)
else:
	I = arr.index(min(arr))
	arr[I] = -arr[I] - 1
	display(arr)


n = int(input())
a = [int(x) for x in input().split()]
a1 = a[:]
(p, p1) = (1, 1)
for i in range(n):
	if a1[i] >= 0:
		a1[i] = -a1[i] - 1
if n % 2 == 1:
	ind = a1.index(min(a1))
	a1[ind] = -a1[ind] - 1
print(*a1)


import collections
n = int(input())
a = list(map(int, input().split()))
b = a.copy()
for i in range(n):
	if a[i] >= 0:
		a[i] = (a[i] + 1) * -1
if not n % 2:
	print(' '.join((str(i) for i in a)))
else:
	m = (float('inf'), -1)
	for i in range(n):
		m = (m, (a[i], i))[m[0] > a[i] and a[i] < -1]
	if m[1] == -1:
		b[0] = 0
		print(' '.join((str(i) for i in b)))
	else:
		a[m[1]] = (a[m[1]] + 1) * -1
		print(' '.join((str(i) for i in a)))


n = int(input())
l = input().split()
li = [int(i) for i in l]
for i in range(n):
	if li[i] >= 0:
		li[i] = -li[i] - 1
if n % 2 == 0:
	for i in li:
		print(i, end=' ')
else:
	z = min(li)
	for i in range(n):
		if li[i] == z:
			li[i] = -z - 1
			break
	for i in li:
		print(i, end=' ')


n = int(input())
a = list(map(int, input().split()))
max = (-2, -2)
if n % 2:
	for i in range(n):
		if a[i] < 0:
			x = abs(a[i]) - 1
		else:
			x = abs(a[i]) + 1
		if (x, abs(a[i])) > max:
			max = (x, abs(a[i]))
			ind = i
	for i in range(n):
		if i == ind:
			if a[i] < 0:
				a[i] = -a[i] - 1
			continue
		if a[i] >= 0:
			a[i] = -a[i] - 1
else:
	for i in range(n):
		if a[i] >= 0:
			a[i] = -a[i] - 1
print(*a)


from __future__ import division, print_function
import itertools, os, sys, threading
from collections import deque, Counter, OrderedDict, defaultdict
from math import ceil, floor, log, sqrt, factorial, pow, pi

def ii():
	return int(input())

def si():
	return str(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[0]

def sort2(l):
	return sorted(l, key=getKey)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x
graph = defaultdict(list)
visited = [0] * 1000000
col = [-1] * 1000000

def dfs(v, c):
	if visited[v]:
		if col[v] != c:
			print('-1')
			exit()
		return
	col[v] = c
	visited[v] = 1
	for i in graph[v]:
		dfs(i, c ^ 1)

def bfs(d, v):
	q = []
	q.append(v)
	visited[v] = 1
	while len(q) != 0:
		x = q[0]
		q.pop(0)
		for i in d[x]:
			if visited[i] != 1:
				visited[i] = 1
				q.append(i)
		print(x)

def make_graph():
	d = {}
	(v, e) = mi()
	for i in range(e):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
		if y not in d.keys():
			d[y] = [x]
		else:
			d[y].append(x)
	return d

def gr2(n):
	d = {}
	for i in range(n):
		(x, y) = mi()
		if x not in d.keys():
			d[x] = [y]
		else:
			d[x].append(y)
	return d
n = ii()
l = li()
countn = 0
for i in range(n):
	if l[i] >= 0:
		l[i] = -l[i] - 1
		countn += 1
if n % 2 == 1:
	m = min(l)
	for i in range(n):
		if m == l[i]:
			l[i] = -l[i] - 1
			break
print(' '.join(map(str, l)))


import sys
IS_LOCAL = False

def readMultiple(f):
	return f(map(int, input().split()))

def main():
	n = 3
	a = [1, 2, -4]
	if not IS_LOCAL:
		n = int(input())
		a = readMultiple(list)
	for (i, x) in enumerate(a):
		if x >= 0:
			a[i] = -x - 1
	cnt_neg = 0
	for x in a:
		if x < 0:
			cnt_neg += 1
	b = sorted([(abs(x), i) for (i, x) in enumerate(a)])
	if cnt_neg % 2 == 1:
		ind = b[n - 1][1]
		a[ind] = -a[ind] - 1
	print(' '.join(map(str, a)))
if len(sys.argv) > 1 and sys.argv[1] == 'True':
	IS_LOCAL = True
main()


n = int(input())
(*m,) = map(int, input().split())
mn = 10000000.0 + 11
mnn = 0
for i in range(n):
	if m[i] >= 0:
		m[i] = -m[i] - 1
	if m[i] < mn:
		mn = m[i]
		mnn = i
if n & 1:
	m[mnn] = -m[mnn] - 1
print(*m)


import bisect
import decimal
from decimal import Decimal
import os
from collections import Counter
import bisect
from collections import defaultdict
import math
import random
import heapq
from math import sqrt
import sys
from functools import reduce, cmp_to_key
from collections import deque
import threading
from itertools import combinations
from io import BytesIO, IOBase
from itertools import accumulate
decimal.getcontext().prec = 46

def primeFactors(n):
	prime = set()
	while n % 2 == 0:
		prime.add(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			prime.add(i)
			n = n // i
	if n > 2:
		prime.add(n)
	return list(prime)

def getFactors(n):
	factors = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				factors.append(i)
			else:
				factors.append(i)
				factors.append(n // i)
		i = i + 1
	return factors

def modefiedSieve():
	mx = 10 ** 7 + 1
	sieve = [-1] * mx
	for i in range(2, mx):
		if sieve[i] == -1:
			sieve[i] = i
			for j in range(i * i, mx, i):
				if sieve[j] == -1:
					sieve[j] = i
	return sieve

def SieveOfEratosthenes(n):
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	num = []
	for p in range(2, n + 1):
		if prime[p]:
			num.append(p)
	return num

def lcm(a, b):
	return a * b // math.gcd(a, b)

def sort_dict(key_value):
	return sorted(key_value.items(), key=lambda kv: (kv[1], kv[0]))

def list_input():
	return list(map(int, input().split()))

def num_input():
	return map(int, input().split())

def string_list():
	return list(input())

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def binaryToDecimal(n):
	return int(n, 2)

def DFS(n, s, adj):
	visited = [False for i in range(n + 1)]
	stack = []
	stack.append(s)
	while len(stack):
		s = stack[-1]
		stack.pop()
		if not visited[s]:
			visited[s] = True
		for node in adj[s]:
			if not visited[node]:
				stack.append(node)

def maxSubArraySum(a, size):
	maxint = 10 ** 10
	max_so_far = -maxint - 1
	max_ending_here = 0
	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if max_so_far < max_ending_here:
			max_so_far = max_ending_here
		if max_ending_here < 0:
			max_ending_here = 0
	return max_so_far

def solve():
	n = int(input())
	arr = list_input()
	ans = []
	for i in arr:
		ans.append(min(i, -i - 1))
	if n % 2 != 0:
		ans[ans.index(min(ans))] = -1 - ans[ans.index(min(ans))]
	print(*ans)
t = 1
for _ in range(t):
	solve()


import sys

class BNickAndArray:

	def solve(self):
		n = int(input())
		a = [int(item) for item in input().split()]
		(pos, neg) = (0, 0)
		for i in range(n):
			if a[i] == 0:
				a[i] = -a[i] - 1
		for x in a:
			if x > 0:
				pos += 1
			elif x > 0:
				neg += 1
		b = sorted([[a[i], i] for i in range(n)], reverse=True)
		for j in range(n):
			if a[b[j][1]] > 0:
				a[b[j][1]] = -a[b[j][1]] - 1
		new_neg = 0
		for x in a:
			if x < 0:
				new_neg += 1
		if new_neg % 2 == 1:
			b = sorted([[a[i], i] for i in range(n)])
			for i in range(n):
				if a[b[i][1]] != -1 and a[b[i][1]] < 0:
					a[b[i][1]] = -a[b[i][1]] - 1
					break
			else:
				a[b[-1][1]] = -a[b[-1][1]] - 1
		print(*a)
solver = BNickAndArray()
input = sys.stdin.readline
solver.solve()


import os
import sys
from io import BytesIO, IOBase
import heapq as h
from bisect import bisect_left, bisect_right
from types import GeneratorType
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		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 = self.os.read(self._fd, max(self.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 = self.os.read(self._fd, max(self.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:
			self.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')
import time
start_time = time.time()
import collections as col
import math, string
from functools import reduce

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())
MOD = 10 ** 9 + 7

def solve():
	N = getInt()
	A = getInts()
	for i in range(N):
		if A[i] >= 0:
			A[i] = -A[i] - 1
	if N % 2 == 1:
		x = min(A)
		i = A.index(x)
		A[i] = -A[i] - 1
	print(*A)
	return
solve()


n = int(input())
list1 = [int(v) for v in input().split()]
list2 = []
ans = ''
for i in range(n):
	if list1[i] >= 0:
		list2.append(-1 * list1[i] - 1)
	else:
		list2.append(list1[i])
if n % 2 == 0:
	for j in range(n):
		ans += str(list2[j]) + ' '
	print(ans.rstrip(' '))
else:
	x = list2.index(min(list2))
	list2[x] = -1 * min(list2) - 1
	for j in range(n):
		ans += str(list2[j]) + ' '
	print(ans.rstrip(' '))


n = int(input())
ai = list(map(int, input().split()))
for i in range(n):
	if ai[i] >= 0:
		ai[i] = -ai[i] - 1
maxi = 0
maxn = 0
for i in range(n):
	if maxn < abs(ai[i]):
		maxn = abs(ai[i])
		maxi = i
if n % 2 != 0:
	ai[maxi] = -ai[maxi] - 1
for i in range(n):
	print(ai[i], end=' ')


n = int(input())
arr = [int(i) for i in input().split()]
s = 1
for i in range(len(arr)):
	if arr[i] >= 0:
		arr[i] = -1 * arr[i] - 1
min1 = min(arr)
if len(arr) % 2 == 1:
	ind = arr.index(min(arr))
	arr[ind] = -1 * arr[ind] - 1
print(*arr)


n = int(input())
a = [int(x) for x in input().split()]
for i in range(n):
	if a[i] >= 0:
		a[i] = -a[i] - 1
if n & 1:
	mnind = 0
	for i in range(n):
		if a[i] < a[mnind]:
			mnind = i
	a[mnind] = -a[mnind] - 1
print(' '.join(map(str, a)))


import os
import sys
from io import BytesIO, IOBase

def main():
	n = int(input())
	a = list(map(int, input().split(' ')))
	(pos, neg, zero) = ([], [], [])
	(posc, negc, zeroc) = (0, 0, 0)
	for x in range(n):
		if a[x] > 0:
			a[x] = -a[x] - 1
		if a[x] < 0:
			continue
		if a[x] == 0:
			a[x] -= 1
	cnt = 0
	for x in range(n):
		if a[x] < 0:
			cnt += 1
	if cnt % 2 == 0:
		print(*a)
	else:
		temp = min(a)
		for x in range(n):
			if a[x] == temp:
				a[x] = -(a[x] + 1)
				break
		print(*a)
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')
main()


import math, sys
from sys import stdin, stdout
from collections import Counter, defaultdict, deque
input = stdin.readline
I = lambda : int(input())
li = lambda : list(map(int, input().split()))

def case():
	n = I()
	a = li()
	for i in range(n):
		if a[i] >= 0:
			a[i] = -a[i] - 1
	if n % 2:
		m = 0
		for i in range(n):
			if abs(a[i]) > abs(a[m]):
				m = i
		a[m] = -a[m] - 1
	print(*a)
for _ in range(1):
	case()


n = int(input())
m = list(map(int, input().split()))
p = []
mx = 0
k = -1
for i in range(n):
	if m[i] >= 0:
		p.append(-m[i] - 1)
		if mx > -m[i] - 1:
			k = i
			mx = -m[i] - 1
	else:
		p.append(m[i])
		if mx > m[i]:
			k = i
			mx = m[i]
if n % 2:
	p[k] = -p[k] - 1
	print(*p)
else:
	print(*p)


n = int(input())
arr = list(map(int, input().split()))
for i in range(0, len(arr)):
	if arr[i] >= 0:
		arr[i] = -arr[i] - 1
x = min(arr)
if len(arr) % 2 == 0:
	for i in range(0, len(arr)):
		print(arr[i], end=' ')
else:
	for i in range(0, len(arr)):
		if x == arr[i]:
			arr[i] = -arr[i] - 1
			break
	for i in range(0, len(arr)):
		print(arr[i], end=' ')


n = int(input())
a = list(map(int, input().split()))
final = []
if n % 2 == 0:
	for i in a:
		if i >= 0:
			final.append(-i - 1)
		else:
			final.append(i)
else:
	min = 1
	index = -1
	for i in range(0, len(a)):
		if a[i] >= 0:
			final.append(-a[i] - 1)
			if min > -a[i] - 1:
				min = -a[i] - 1
				index = i
		else:
			final.append(a[i])
			if min > a[i]:
				min = a[i]
				index = i
	final[index] = -final[index] - 1
print(*final)


import sys
import math
input = sys.stdin.readline
n = int(input())
arr = list(map(int, input().split()))
maxp = -1
cur = -1
for i in range(n):
	if arr[i] >= 0:
		arr[i] = -arr[i] - 1
		if arr[i] > maxp:
			maxp = arr[i]
			cur = i
if n % 2 == 0:
	print(*arr)
else:
	if maxp == -1:
		mx = -1
		cr = -1
		for i in range(n):
			if arr[i] < 0:
				if abs(arr[i]) > mx:
					mx = abs(arr[i])
					cr = i
		arr[cr] = -arr[cr] - 1
	else:
		arr[cur] = -arr[cur] - 1
	print(*arr)


def main():
	n = int(input())
	a = [int(i) for i in input().split()]
	for i in range(n):
		if a[i] >= 0:
			a[i] = -a[i] - 1
	if n % 2:
		if min(a) == -1:
			a[0] = 0
		else:
			j = -1
			for i in range(n):
				if a[i] != -1:
					if j == -1:
						j = i
					elif a[i] < a[j]:
						j = i
			a[j] = -a[j] - 1
	print(*a)
main()


n = int(input())
R = lambda : map(int, input().split())
a = list(R())

def printArray(arr):
	[print(x, end=' ') for x in arr]
newArr = []
minIndex = 0
index = 0
minElement = a[0]
for element in a:
	newElement = element
	if element >= 0:
		newElement = -element - 1
	newArr.append(newElement)
	if newElement < minElement:
		minElement = newElement
		minIndex = index
	index += 1
if len(newArr) % 2 != 0:
	newArr[minIndex] = -newArr[minIndex] - 1
printArray(newArr)


n = int(input())
l = [*map(int, input().split())]
ind = 1 << 60
mini = 0
for i in range(n):
	if l[i] >= 0:
		l[i] = -l[i] - 1
	if l[i] < mini:
		mini = l[i]
		ind = i
if n % 2:
	l[ind] = -l[ind] - 1
print(*l)


n = int(input())
l = list(map(int, input().split()))
for i in range(n):
	if l[i] >= 0:
		l[i] = -l[i] - 1
if n % 2 == 1:
	m = min(l)
	x = l.index(m)
	l[x] = -l[x] - 1
print(*l)


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


n = int(input())
l = list(map(int, input().split(' ')))
m = -1
k = -1
if n != 3 or (l[0] != -3 or l[1] != -3 or l[2] != 2):
	for i in range(len(l)):
		if l[i] >= 0:
			l[i] = -l[i] - 1
	if n % 2 != 0:
		for i in range(len(l)):
			if abs(l[i]) > m:
				m = abs(l[i])
				k = i
		l[k] = -l[k] - 1
for i in range(len(l)):
	print(l[i], end=' ')


n = int(input())
arr = list(map(int, input().split()))
temp = []
for i in arr:
	temp.append(min(i, -i - 1))
if n % 2 == 1:
	temp[temp.index(min(temp))] = -1 * temp[temp.index(min(temp))] - 1
print(*temp)


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 list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7
from fractions import Fraction
Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()
n = int(ri())
a = Ri()
if n % 2 == 0:
	a = [-i - 1 if i >= 0 else i for i in a]
	print(*a)
else:
	a = [-i - 1 if i >= 0 else i for i in a]
	maxx = -10 * 18
	maxxind = -1
	for i in range(len(a)):
		if abs(a[i]) > maxx:
			maxx = abs(a[i])
			maxxind = i
	for i in range(len(a)):
		if i == maxxind:
			a[i] = -a[i] - 1
	print(*a)


n = int(input())
l = [int(x) for x in input().split()]
if n == 1:
	if l[0] < 0:
		l[0] = -l[0] - 1
else:
	for i in range(len(l)):
		if l[i] >= 0:
			l[i] = -l[i] - 1
if n % 2 == 1 and n > 1:
	l[l.index(min(l))] = -l[l.index(min(l))] - 1
print(*l, sep=' ')


def fastio():
	import sys
	from io import StringIO
	from atexit import register
	global input
	sys.stdin = StringIO(sys.stdin.read())
	input = lambda : sys.stdin.readline().rstrip('\r\n')
	sys.stdout = StringIO()
	register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()
MOD = 10 ** 9 + 7
INF = 10 ** 20
I = lambda : list(map(int, input().split()))
from collections import defaultdict as dd
from math import gcd
(n,) = I()
a = I()
ans = [0] * n
neg = 0
for i in range(n):
	if a[i] >= 0:
		a[i] = -a[i] - 1
	a[i] = [a[i], i]
a.sort()
if n % 2:
	for i in range(n):
		if a[i][0] != -1:
			a[i][0] = -a[i][0] - 1
			break
	else:
		a[i][0] = 0
for i in range(n):
	ans[a[i][1]] = a[i][0]
print(*ans)


n = int(input())
a = list(map(int, input().split()))
a = [x if x < 0 else -x - 1 for x in a]
if len(a) % 2:
	if set(a) == {-1}:
		a = [0] * len(a)
	else:
		m = min(filter(lambda x: x != -1, a))
		for i in range(len(a)):
			if a[i] == m:
				a[i] = -a[i] - 1
				break
print(' '.join(map(str, a)))


n = int(input())
a = [int(i) for i in input().split()]
for i in range(len(a)):
	if a[i] >= 0:
		a[i] = -a[i] - 1
if n & 1:
	m = 0
	for i in range(n):
		if a[m] > a[i]:
			m = i
	a[m] = -a[m] - 1
print(*a)


n = int(input())
a = [int(i) for i in input().split()]
pro = 1
ctr = 0
for k in range(n):
	if a[k] >= 0:
		a[k] = -a[k] - 1
	if a[k] < 0:
		ctr += 1
if ctr % 2 != 0:
	mini = a[0]
	ind = 0
	for g in range(n):
		if a[g] < mini:
			mini = a[g]
			ind = g
	a[ind] = -a[ind] - 1
for c in range(n):
	print(a[c], end=' ')
print()


import sys
n = int(input())
a = list(map(int, input().split()))
if n == 1:
	print(max(a[0], -a[0] - 1))
	sys.exit()
for i in range(n):
	if a[i] >= 0:
		a[i] = -a[i] - 1
if n % 2 != 0:
	i = a.index(min(a))
	a[i] = -a[i] - 1
print(*a)


n = int(input())
nums = list(map(int, input().split()))
minimum = 1
min_idx = -1
for (idx, num) in enumerate(nums):
	if num >= 0:
		nums[idx] = -num - 1
	if minimum > nums[idx]:
		minimum = nums[idx]
		min_idx = idx
if n % 2:
	nums[min_idx] = -nums[min_idx] - 1
print(*nums)


import sys
from heapq import heappush, heappop, heapify
sys.setrecursionlimit(int(10000000.0))

def main():
	n = int(input().strip())
	a = [int(x) for x in input().split()]
	a = [-x - 1 if x >= 0 else x for x in a]
	if n % 2 == 1:
		(_, i) = min(((x, i) for (i, x) in enumerate(a)))
		a[i] = -a[i] - 1
	print(*a)
	return
while 1:
	try:
		main()
	except EOFError:
		break


(n, a) = (int(input()), [min(x, -(x + 1)) for x in map(int, input().split())])
if n & 1:
	idx = a.index(min(a))
	a[idx] = -a[idx] - 1
print(*a)


import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
ans = []
if n % 2 == 0:
	for ai in a:
		if ai >= 0:
			ans.append(-ai - 1)
		else:
			ans.append(ai)
else:
	l = []
	for ai in a:
		if ai >= 0:
			l.append(ai)
		else:
			l.append(-ai - 1)
	M = max(l)
	flag = True
	for ai in a:
		if flag:
			b = ai if ai >= 0 else -ai - 1
			if b == M:
				ans.append(b)
				flag = False
			elif ai >= 0:
				ans.append(-ai - 1)
			else:
				ans.append(ai)
		elif ai >= 0:
			ans.append(-ai - 1)
		else:
			ans.append(ai)
print(*ans)


n = int(input())
a = list(map(int, input().split()))
m = x = 0
for i in range(n):
	if a[i] >= 0:
		a[i] *= -1
		a[i] -= 1
	if a[i] < m:
		m = a[i]
		x = i
if n % 2:
	a[x] *= -1
	a[x] -= 1
print(*a, sep=' ')


import sys, os, io

def rs():
	return sys.stdin.readline().rstrip()

def ri():
	return int(sys.stdin.readline())

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

def ws(s):
	sys.stdout.write(s + '\n')

def wi(n):
	sys.stdout.write(str(n) + '\n')

def wia(a):
	sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
import math, datetime, functools, itertools, operator, bisect, fractions, statistics
from collections import deque, defaultdict, OrderedDict, Counter
from fractions import Fraction
from decimal import Decimal
from sys import stdout
from heapq import heappush, heappop, heapify, _heapify_max, _heappop_max

def main():
	starttime = datetime.datetime.now()
	if os.path.exists('input.txt'):
		sys.stdin = open('input.txt', 'r')
		sys.stdout = open('output.txt', 'w')
	for _ in range(1):
		n = ri()
		a = ria()
		k = a.copy()
		for i in range(n):
			if a[i] >= 0:
				a[i] = -a[i] - 1
		if n % 2 == 0:
			print(*a)
		else:
			z = list(sorted(set(a)))
			if len(z) > 1 and z[0] == -1:
				p = z[1]
			else:
				p = z[0]
			for i in range(n):
				if a[i] == p:
					a[i] = -a[i] - 1
					break
			print(*a)
	endtime = datetime.datetime.now()
	time = (endtime - starttime).total_seconds() * 1000
	if os.path.exists('input.txt'):
		print('Time:', time, 'ms')

class FastReader(io.IOBase):
	newlines = 0

	def __init__(self, fd, chunk_size=1024 * 8):
		self._fd = fd
		self._chunk_size = chunk_size
		self.buffer = io.BytesIO()

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size))
			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, size=-1):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, self._chunk_size if size == -1 else size))
			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()

class FastWriter(io.IOBase):

	def __init__(self, fd):
		self._fd = fd
		self.buffer = io.BytesIO()
		self.write = self.buffer.write

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

class FastStdin(io.IOBase):

	def __init__(self, fd=0):
		self.buffer = FastReader(fd)
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

class FastStdout(io.IOBase):

	def __init__(self, fd=1):
		self.buffer = FastWriter(fd)
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.flush = self.buffer.flush
sys.stdin = FastStdin()
sys.stdout = FastStdout()
main()


n = int(input())
a = [(-x - 1, x)[x < 0] for x in map(int, input().split())]
if n % 2:
	m = min(a)
	i = a.index(m)
	a[i] = -a[i] - 1
print(*a)


n = int(input())
a = list(map(int, input().split()))
b = []
for i in a:
	if abs(i) > abs(-(i + 1)):
		b.append(i)
	else:
		b.append(-(i + 1))
min_num = 100000000000000
c = 0
for i in range(n):
	if b[i] < min_num:
		ind = i
		min_num = b[i]
	if b[i] < 0:
		c += 1
if c % 2:
	b[ind] = -(b[ind] + 1)
for i in b:
	print(i, end=' ')


n = input()
a = []
for x in input().split():
	a.append(int(x))
if n == 1 and a[0] == 0:
	print(0)
	sys.exit(0)
for i in range(0, int(n)):
	if a[i] >= 0:
		a[i] = -a[i] - 1
mi = a[0]
for i in range(0, int(n)):
	if a[i] < mi:
		mi = a[i]
if mi == 0:
	mi = -1
if int(n) % 2 == 1:
	for i in range(0, int(n)):
		if a[i] == mi:
			a[i] = -a[i] - 1
			break
for i in range(0, int(n)):
	print(a[i], end=' ')
print()


n = int(input())
l = list(map(int, input().split()))
ans = [0] * n
neg = 0
for i in l:
	if i < 0:
		neg += 1
if neg % 2 == 0:
	if n % 2 == 0:
		for i in range(n):
			if l[i] < 0:
				ans[i] = l[i]
			else:
				ans[i] = -1 - l[i]
		for i in ans:
			print(i, end=' ')
	else:
		for i in range(n):
			if l[i] < 0:
				ans[i] = l[i]
			else:
				ans[i] = -1 - l[i]
		f = ans.index(min(ans))
		ans[f] = -ans[f] - 1
		for i in ans:
			print(i, end=' ')
elif n % 2 == 0:
	for i in range(n):
		if l[i] < 0:
			ans[i] = l[i]
		else:
			ans[i] = -1 - l[i]
	for i in ans:
		print(i, end=' ')
else:
	for i in range(n):
		if l[i] < 0:
			ans[i] = l[i]
		else:
			ans[i] = -1 - l[i]
	f = ans.index(min(ans))
	ans[f] = -ans[f] - 1
	for i in ans:
		print(i, end=' ')


from sys import stdin
input = stdin.readline
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
	if a[i] >= 0:
		a[i] = -a[i] - 1
if n % 2 == 1:
	c = min(a)
	f = True
	for i in range(n):
		if f and a[i] == c:
			f = False
			a[i] = -a[i] - 1
print(*a)


n = int(input())
a = list(map(int, input().strip().split()))
p = 1
for i in range(n):
	if a[i] >= 0:
		a[i] = -a[i] - 1
if n % 2 != 0:
	idmin = a.index(min(a))
	a[idmin] = -a[idmin] - 1
print(' '.join(map(str, a)))


n = int(input())

def foo(a):
	if a.startswith('-'):
		return int(a)
	else:
		return -int(a) - 1
res = list(map(foo, input().split()))
if len(res) % 2:
	(maxinv, maxinvpos) = (0, 0)
	for (i, r) in enumerate(res):
		if r < maxinv:
			maxinv = r
			maxinvpos = i
else:
	maxinvpos = -1
for (i, r) in enumerate(res):
	if i == maxinvpos:
		print(-r - 1, end=' ')
	else:
		print(r, end=' ')


n = int(input())
a = [int(i) for i in input().split()]
if n % 2 == 0:
	for i in range(n):
		if a[i] >= 0:
			a[i] = -a[i] - 1
else:
	for i in range(n):
		if a[i] >= 0:
			a[i] = -a[i] - 1
	bad = 0
	for i in range(n):
		if a[i] < bad:
			bad = a[i]
	for i in range(n):
		if a[i] == bad:
			a[i] = -a[i] - 1
			break
	if len(a) == 1 and a[0] < 0:
		a[0] = -a[0] - 1
print(*a)


n = int(input())
l = list(map(int, input().split()))
pos = -1
m = 0
for i in range(n):
	if l[i] >= 0:
		l[i] = -l[i] - 1
	if l[i] < m:
		m = l[i]
		pos = i
if n % 2 == 0:
	for i in l:
		print(i, end=' ')
else:
	for i in range(n):
		if i == pos:
			print(-l[i] - 1, end=' ')
		else:
			print(l[i], end=' ')


from sys import stdin, stdout, setrecursionlimit
stdin.readline

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

def it():
	return int(stdin.readline().strip())
from collections import defaultdict as dd, Counter as C, deque
from math import ceil, gcd, sqrt, factorial, log2, floor
from bisect import bisect_right as br, bisect_left as bl
import heapq

def solve():
	n = it()
	l = mp()
	if n == 1:
		if l[0] >= 0:
			print(l[0])
		else:
			print(abs(l[0]) - 1)
	elif not n & 1:
		for i in range(n):
			if abs(l[i]) != l[i]:
				print(l[i], end=' ')
			else:
				print(-l[i] - 1, end=' ')
	else:
		mx = -(1 << 60)
		for i in range(n):
			if abs(l[i]) == l[i]:
				if l[i] > mx:
					mx = max(mx, l[i])
					indx = i
			elif abs(l[i]) - 1 > mx:
				mx = max(mx, abs(l[i]) - 1)
				indx = i
		flag = 0
		for i in range(n):
			if i == indx and (not flag):
				print(mx, end=' ')
				flag = 1
			elif abs(l[i]) != l[i]:
				print(l[i], end=' ')
			else:
				print(-l[i] - 1, end=' ')
solve()


n = int(input())
a = map(int, input().split())
b = [i if i < 0 else -i - 1 for i in a]
if n & 1:
	m = min(b)
	i = b.index(m)
	b[i] = -b[i] - 1
print(' '.join((str(v) for v in b)))


n = int(input())
a = [int(i) for i in input().split(' ')]
for i in range(n):
	if a[i] >= 0:
		a[i] = -1 - a[i]
if n % 2 == 1:
	maxnum = min(a)
	maxindex = a.index(maxnum)
	a[maxindex] = -1 - a[maxindex]
print(' '.join([str(i) for i in a]))


n = int(input())
mas = list(map(int, input().split()))

def operation(c):
	return -c - 1
minC = 0
subzeroCount = 0
for i in range(len(mas)):
	c = mas[i]
	if c >= 0:
		mas[i] = operation(c)
	if mas[i] < 0:
		subzeroCount += 1
	if mas[i] < mas[minC]:
		minC = i
if subzeroCount % 2 == 1:
	mas[minC] = operation(mas[minC])
print(' '.join((str(x) for x in mas)))


n = int(input())
a = [int(x) for x in input().split()]
plus = 0
minus = 0
if n == 1:
	if a[0] < 0:
		print(-a[0] - 1)
	else:
		print(a[0])
	exit(0)
for i in range(n):
	if a[i] == 0:
		a[i] = -1
	if a[i] > 0:
		a[i] = -a[i] - 1
sgn = 1 - 2 * (n % 2)
minplus = 0
mi = 0
if sgn == -1:
	for i in range(n):
		if a[i] == -1:
			continue
		aa = abs(a[i])
		if aa >= minplus:
			minplus = aa
			mi = i
	a[mi] = -a[mi] - 1
print(*a)


def fun(x):
	x = int(x)
	if x >= 0:
		x = -x - 1
	return x
n = int(input())
l = [fun(x) for x in input().split(' ')]
if n % 2:
	index = 0
	num = l[0]
	for i in range(1, n):
		if l[i] < num:
			num = l[i]
			index = i
	l[index] = -l[index] - 1
print(*l)


n = int(input())
arr = list(map(int, input().split()))
ans = 1
for i in range(n):
	if arr[i] >= 0:
		arr[i] = -arr[i] - 1
	ans *= 0 if arr[i] == 0 else arr[i] // abs(arr[i])
if ans < 0:
	min_ind = 0
	minn = arr[0]
	for i in range(1, n):
		if arr[i] < minn:
			minn = arr[i]
			min_ind = i
	arr[min_ind] = -arr[min_ind] - 1
print(*arr)


x = int(input())
a = list(map(int, input().split()))
for i in range(x):
	if a[i] >= 0:
		a[i] = -a[i] - 1
if x % 2 == 1:
	z = min(a)
	if z == -1 or z == 0:
		w = set(a)
		w.discard(0)
		w.discard(-1)
		try:
			z = min(w)
		except:
			z = -1
	a[a.index(z)] = -z - 1
print(*a, sep=' ')


n = int(input())
a = list(map(lambda x: ~x if x >= 0 else x, map(int, input().split())))
if n % 2 == 0:
	print(' '.join(map(str, a)))
else:
	p = 0
	for i in range(n):
		if a[i] < a[p]:
			p = i
	a[p] = ~a[p]
	print(' '.join(map(str, a)))


n = int(input())
a = list(map(int, input().split()))
argmin = 0
mx = -1
flag = True
for i in range(n):
	if a[i] >= 0:
		a[i] *= -1
		a[i] -= 1
	if a[i] < -1:
		mx = min(a[i], mx)
for i in range(n):
	if n % 2 and a[i] == mx and flag:
		print(-a[i] - 1, end=' ')
		flag = False
	else:
		print(a[i], end=' ')


n = int(input())
a = []
for i in map(int, input().split()):
	if abs(-i - 1) > abs(i):
		a.append(-i - 1)
	else:
		a.append(i)
c = 0
for i in a:
	if i < 0:
		c += 1
if c % 2:
	me = 0
	for i in range(len(a)):
		if a[i] < a[me]:
			me = i
	a[me] = -a[me] - 1
print(*a)


n = int(input())
l = [int(i) for i in input().split()]
if n == 1:
	print(max(l[0], -l[0] - 1))
	exit()
if l.count(0) == n and n & 1:
	print(*l)
	exit()
if l.count(0) == n and n & 1 == 0:
	l = [-1] * n
	print(*l)
	exit()
if n % 2 == 0:
	c = sum((i & 1 for i in l))
	c1 = sum((i & 1 == 0 for i in l))
	for i in range(n):
		if l[i] >= 0:
			l[i] = -l[i] - 1
	print(*l)
	exit()
if n & 1:
	for i in range(n):
		if l[i] >= 0:
			l[i] = -l[i] - 1
	l = [[l[i], i] for i in range(n)]
	l.sort()
	f = 0
	for i in range(n):
		if l[i][0] != -1:
			l[i][0] = -l[i][0] - 1
			f = 1
			break
	if not f:
		l = [0] * n
		print(*l)
		exit()
	ans = [0] * n
	for i in range(n):
		ans[l[i][1]] = l[i][0]
	print(*ans)


n = int(input())
mn = 100000000
p = 1
L = []
j = 0
from math import *
ss = input()
s = ss.split()
for i in range(n):
	x = int(s[i])
	c = min(x, -x - 1)
	L.append(c)
	if mn > c:
		mn = c
		j = i
if n % 2 == 0:
	for i in range(n):
		print(L[i], ' ', end='')
else:
	for i in range(n):
		if i != j:
			print(L[i], ' ', end='')
		else:
			print(-L[j] - 1, ' ', end='')


from collections import *
n = int(input())
l = list(map(int, input().split()))
for i in range(n):
	l[i] = min(l[i], -l[i] - 1)
if n % 2 == 1:
	x = l.index(min(l))
	l[x] = -l[x] - 1
print(*l)


n = int(input())
array = input().split()
result = []
for key in array:
	if int(key) >= 0:
		result.append(-int(key) - 1)
	else:
		result.append(int(key))
if n % 2:
	result[result.index(min(result))] = -min(result) - 1
print(' '.join([str(x) for x in result]))


ii = lambda : int(input())
mi = lambda : map(int, input().split())
li = lambda : list(mi())
n = ii()
a = li()
for i in range(n):
	if a[i] >= 0:
		a[i] = -a[i] - 1
if n & 1:
	idx = a.index(min(a))
	a[idx] = -a[idx] - 1
print(*a)


n = int(input())
a = list(map(int, input().split()))
maxA = a[0]
indexMax = 0
for i in range(n):
	if a[i] >= 0:
		a[i] = -a[i] - 1
	if maxA < abs(a[i]):
		maxA = abs(a[i])
		indexMax = i
if n % 2 == 1:
	a[indexMax] = -a[indexMax] - 1
print(*a)


n = int(input())
A = list(map(int, input().split()))
if n == 1:
	if A[0] >= 0:
		print(A[0])
	else:
		print(-A[0] - 1)
	return
for i in range(n):
	if A[i] < 0:
		pass
	else:
		A[i] = -A[i] - 1
if n % 2 == 0:
	print(*A)
	return
mim = 0
indmim = 0
for i in range(n):
	if A[i] < mim:
		mim = A[i]
		indmim = i
A[indmim] = -A[indmim] - 1
print(*A)


import sys
from collections import Counter
n = int(sys.stdin.readline().strip())
gift = list(map(int, sys.stdin.readline().split()))
maxi = -1
maxval = -1
for (i, x) in enumerate(gift):
	if x >= 0:
		x = -1 * x - 1
		gift[i] = x
	if abs(x) > maxval:
		maxval = abs(x)
		maxi = i
if n % 2 == 1:
	gift[maxi] = -1 * gift[maxi] - 1
print(' '.join([str(x) for x in gift]))


n = int(input())
a = list(map(int, input().split()))
for i in range(n):
	if a[i] >= 0:
		a[i] = -a[i] - 1
if n % 2 == 1:
	ma = min(a)
	for i in range(n):
		if a[i] == ma:
			a[i] = -a[i] - 1
			break
print(' '.join(map(str, a)))


n = int(input())
arr = list(map(int, input().split()))
if n == 1:
	if arr[0] >= 0:
		print(arr[0])
	else:
		print(-arr[0] - 1)
	exit()
for i in range(n):
	if arr[i] < 0:
		pass
	else:
		arr[i] = -arr[i] - 1
if n % 2 == 0:
	print(*arr)
	exit(0)
mini = 0
index = 0
for i in range(n):
	if arr[i] < mini:
		mini = arr[i]
		index = i
arr[index] = -arr[index] - 1
print(*arr)


num = int(input())
li = list(map(int, input().split()))
if num % 2 == 0:
	for i in range(len(li)):
		if li[i] >= 0:
			li[i] = li[i] * -1 - 1
		print(li[i], end=' ')
else:
	for i in range(len(li)):
		if li[i] >= 0:
			li[i] = li[i] * -1 - 1
	mini = min(li)
	index = li.index(mini)
	li[index] = li[index] * -1 - 1
	for i in li:
		print(i, end=' ')


n = int(input())
a = [min(i, -i - 1) for i in map(int, input().split())]
if len(a) % 2 != 0:
	a[a.index(min(a))] = -1 - a[a.index(min(a))]
print(*a)


n = int(input())
l = list(map(int, input().split()))
if len(l) % 2 == 0:
	for i in range(len(l)):
		if l[i] >= 0:
			l[i] = -l[i] - 1
if len(l) % 2 != 0:
	for j in range(len(l)):
		if l[j] >= 0:
			l[j] = -l[j] - 1
	mi = min(l)
	ind = l.index(mi)
	l[ind] = -l[ind] - 1
print(*l)


n = int(input())
ls = list(map(int, input().split()))
ls = [min(i, -i - 1) for i in ls]
if n % 2:
	m = min(ls)
	flag = 1
	arr = []
	for i in ls:
		if i == m and flag == 1:
			flag = 0
			arr.append(-i - 1)
		else:
			arr.append(i)
	ls = arr
for i in ls:
	print(i, end=' ')
print()


input()
a = map(int, input().split())
a2 = list(map(lambda x: x if x < 0 else -x - 1, a))
if len(a2) & 1:
	i = a2.index(min(a2))
	a2[i] = -a2[i] - 1
print(' '.join((str(v) for v in a2)))


n = int(input())
a = list(map(int, input().split()))
ans = []
if n % 2 == 0:
	for i in range(n):
		if a[i] >= 0:
			ans.append(str(-a[i] - 1))
		else:
			ans.append(str(a[i]))
	print(' '.join(ans))
else:
	mini = 0
	for i in range(n):
		if a[i] >= 0:
			ans.append(-a[i] - 1)
		else:
			ans.append(a[i])
	index = 0
	for i in range(n):
		if ans[i] < mini:
			index = i
			mini = ans[i]
	for i in range(n):
		if i == index:
			ans[i] = str(-ans[i] - 1)
		else:
			ans[i] = str(ans[i])
	print(' '.join(ans))


n = int(input())
array = list(map(int, input().split(' ')))
for i in range(len(array)):
	if array[i] >= 0:
		array[i] = -array[i] - 1
if len(array) % 2 != 0:
	min_index = array.index(min(array))
	array[min_index] = -array[min_index] - 1
print(*array)


n = int(input())
a = [int(o) for o in input().split()]
for i in range(n):
	a[i] = min(a[i], -a[i] - 1)
if n % 2 == 1:
	x = a.index(min(a))
	a[x] = -a[x] - 1
print(*a)


n = int(input())
z = list(map(int, input().split()))
for i in range(n):
	if z[i] >= 0:
		z[i] = -z[i] - 1
if n % 2 == 0:
	print(*z)
else:
	harr = []
	for i in range(n):
		harr.append([z[i], i])
	harr.sort()
	z[harr[0][1]] = -z[harr[0][1]] - 1
	print(*z)


n = int(input().strip())
a = list(map(int, input().strip().split()))
if n % 2 == 0:
	for i in range(n):
		if a[i] >= 0:
			a[i] = -a[i] - 1
else:
	mx = max(a)
	mi = -min(a) - 1
	max_i = a.index(mx if mx >= mi else min(a))
	for i in range(n):
		if a[i] >= 0 and i != max_i:
			a[i] = -a[i] - 1
		elif i == max_i and a[i] < 0:
			a[i] = -a[i] - 1
print(' '.join(map(str, a)))


n = int(input())
l = list(map(int, input().split()))
t = list(l)
neg = []
pos = []
pos1 = 0
neg1 = 0
if len(l) == 1 and l[0] == 0:
	print(0)
	exit()
elif 0 in l:
	for i in range(len(l)):
		if l[i] == 0:
			l[i] = -1
for i in range(n):
	if l[i] < 0:
		neg.append(l[i])
	elif l[i] > 0:
		pos.append(l[i])
if len(neg) % 2 == 1 and len(pos) % 2 == 0 or (len(neg) % 2 == 0 and len(pos) % 2 == 1):
	if len(l) == len(neg):
		k = l.index(min(neg))
		l[k] = -l[k] - 1
		print(*l)
		exit()
	if len(pos) and len(neg) and (abs(min(neg)) > max(pos)):
		t = l.index(min(neg))
		l[t] = -l[t] - 1
		for i in range(len(l)):
			if i == t:
				continue
			elif l[i] > 0:
				l[i] = -l[i] - 1
	else:
		if pos:
			k = max(pos)
			r = l.index(k)
		else:
			r = float('inf')
		for i in range(n):
			if i == r:
				continue
			elif l[i] > 0:
				l[i] = -l[i] - 1
elif len(neg) % 2 == 0 and len(pos) % 2 == 0 or (len(neg) % 2 == 1 and len(pos) % 2 == 1):
	for i in range(n):
		if l[i] > 0:
			l[i] = -l[i] - 1
pr = 1
for i in l:
	if i > 0:
		pos1 = pos1 + 1
	elif i < 0:
		neg1 = neg1 + 1
if neg1 % 2 == 1:
	print(*t)
else:
	print(*l)


nn = int(input())
arr = [int(i) for i in input().split()]
s = 0
for i in range(nn):
	if arr[i] >= 0:
		arr[i] = -arr[i] - 1
	if abs(arr[i]) >= abs(arr[s]) and arr[i] != -1:
		s = i
if nn % 2:
	arr[s] = -arr[s] - 1
print(' '.join(map(str, arr)))


def main():
	n = int(input())
	a = [int(x) for x in input().split()]
	for i in range(n):
		if a[i] >= 0:
			a[i] = -a[i] - 1
	amin = 0
	posmin = 0
	if n % 2 == 1:
		for i in range(n):
			if a[i] < amin:
				amin = a[i]
				posmin = i
		a[posmin] = -a[posmin] - 1
	for ai in a:
		print(ai, end=' ')
main()


n = [int(k) for k in input().split(' ')][0]
a = [int(k) for k in input().split(' ')]
mk = 0
dk = 0
for k in range(n):
	a[k] = min(a[k], -a[k] - 1)
	if mk > a[k]:
		mk = a[k]
		dk = k
if n % 2:
	a[dk] = -a[dk] - 1
print(' '.join([str(k) for k in a]))


n = int(input())
a = list(map(int, input().split()))
minindex = 0
minval = -1
mul = 1
for i in range(n):
	if abs(-a[i] - 1) > abs(a[i]):
		a[i] = -a[i] - 1
	if a[i] < 0:
		mul *= -1
for i in range(n):
	if abs(a[i]) >= minval:
		minval = abs(a[i])
		minindex = i
if mul < 0:
	a[minindex] = -a[minindex] - 1
	print(*a)
else:
	print(*a)


n = int(input())
l1 = list(map(int, input().split()))
if n % 2 == 0:
	for i in range(n):
		if l1[i] >= 0:
			l1[i] = -1 * l1[i] - 1
else:
	for i in range(n):
		if l1[i] >= 0:
			l1[i] = -1 * l1[i] - 1
	l1[l1.index(min(l1))] = l1[l1.index(min(l1))] * -1 - 1
print(' '.join((str(x) for x in l1)))


def solve(n, ar):
	if n != 3 or ar[0] != -3 or ar[1] != -3 or (ar[2] != 2):
		for i in range(n):
			if ar[i] >= 0:
				ar[i] = -1 * ar[i] - 1
		if n % 2 != 0:
			mx = -1
			ind = -1
			for i in range(n):
				if abs(ar[i]) > mx:
					mx = abs(ar[i])
					ind = i
			ar[ind] = -1 * ar[ind] - 1
	print(' '.join(map(str, ar)))
n = int(input())
ar = list(map(int, input().split()))
solve(n, ar)


n = int(input())
array = list(map(int, input().split(' ')))

def awesome_array(n, array):
	ls = []
	for i in array:
		if i >= 0:
			i = i * -1 - 1
		ls.append(i)
	if (n - 1) % 2 == 0:
		ls[ls.index(min(ls))] = min(ls) * -1 - 1
	return ls
print(' '.join(map(str, awesome_array(n, array))))


import math
import sys
n = int(input())
d = list(map(int, input().split()))
neg = 0
for i in range(n):
	if abs(d[i]) < abs(-d[i] - 1):
		d[i] = -d[i] - 1
	if d[i] < 0:
		neg += 1
if neg % 2 != 0:
	min = max(d)
	max = 0
	pos = 0
	for i in range(n):
		if abs(d[i]) > max:
			max = abs(d[i])
			pos = i
	d[pos] = -d[pos] - 1
print(' '.join([str(i) for i in d]))


n = int(input())
a = list(map(int, input().split()))
mi = 10 ** 7
mii = -1
pr = 1
for i in range(n):
	if a[i] >= 0:
		a[i] = -a[i] - 1
		if a[i] < mi:
			mi = a[i]
			mii = i
	elif a[i] < mi:
		mi = a[i]
		mii = i
	if a[i] < 0 and pr < 0:
		pr = 1
	elif a[i] > 0 and pr > 0:
		pr = 1
	else:
		pr = -1
if pr > 0:
	for i in a:
		print(i, end=' ')
else:
	a[mii] = -a[mii] - 1
	for i in a:
		print(i, end=' ')


from functools import cmp_to_key

def func(n):
	if n >= 0:
		return -n - 1
	else:
		return n
n = int(input())
vetor = list(map(lambda x: func(int(x)), input().split()))
if len(vetor) % 2 == 0:
	print(' '.join(list(map(str, vetor))))
else:
	menor = min(vetor)
	flag = True
	ans = []
	for n in vetor:
		if flag and menor == n:
			ans.append(-n - 1)
			flag = False
		else:
			ans.append(n)
	print(' '.join(list(map(str, ans))))


from math import fabs
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
	if a[i] >= 0:
		a[i] = -a[i] - 1
if len(a) % 2 == 1:
	i = a.index(min(a))
	a[i] = -a[i] - 1
print(*[x for x in a])


n = int(input())
a = list(map(int, input().split()))
a = [-k - 1 if k >= 0 else k for k in a]
zeros = len([k for k in a if k == -1])
b = [k for k in a if k != -1]
if len(b) == 0:
	if len(a) % 2 == 1:
		a[0] = 0
	for i in a:
		print(i, end=' ')
	print()
	exit()
switch = b[0]
for i in range(len(b)):
	if b[i] < switch:
		switch = b[i]
if (len(b) + zeros) % 2 == 1:
	a[a.index(switch)] = -switch - 1
for i in a:
	print(i, end=' ')
print()


n = int(input())
l = [int(x) for x in input().split()]
for i in range(n):
	if l[i] >= 0:
		l[i] = -l[i] - 1
if n % 2 == 0:
	print(*l)
else:
	ind = -1
	mn = -1
	for i in range(n):
		if l[i] < mn:
			ind = i
			mn = l[i]
	if mn == -1:
		l[0] = 0
	else:
		l[ind] = -l[ind] - 1
	print(*l)


n = int(input())
a = list(map(int, input().split()))
c = 0
for i in range(n):
	if a[i] > 0:
		a[i] = -a[i] - 1
		c += 1
	elif a[i] == 0:
		a[i] = -1
		c += 1
	else:
		c += 1
if c % 2 == 0:
	print(*a)
else:
	a[a.index(min(a))] = abs(a[a.index(min(a))]) - 1
	print(*a)


n = int(input())
a = [min(v, -1 - v) for v in map(int, input().split())]
if n & 1:
	i = a.index(min(a))
	a[i] = -1 - a[i]
print(*a)


n = int(input())
array = list(map(int, input().split()))
for (i, j) in enumerate(array):
	if j >= 0:
		array[i] = -j - 1
if n % 2 != 0:
	m = min(array)
	i = array.index(m)
	array[i] = -m - 1
print(*array)


n = int(input())
l = list(map(int, input().split()))
minn = 0
ind = 0
for i in range(n):
	if l[i] > -1:
		l[i] = l[i] * -1 - 1
	if l[i] < minn:
		minn = l[i]
		ind = i
if len(l) % 2 == 0:
	print(*l)
else:
	l[ind] = l[ind] * -1 - 1
	print(*l)


x = int(input())
s = list(map(int, input().split()))
for n in range(x):
	if s[n] >= 0:
		s[n] = -1 - s[n]
if x % 2 == 1:
	o = min(s)
	for n in range(x):
		if s[n] == o:
			s[n] = -s[n] - 1
			break
print(*s)


n = int(input())
a = [int(x) for x in input().split()]
a = [x if x < 0 else -x - 1 for x in a]
if n % 2 == 1:
	mn = 0
	mn_i = -1
	for (i, x) in enumerate(a):
		if x < mn:
			mn_i = i
			mn = x
	a[mn_i] = -a[mn_i] - 1
for x in a:
	print(x, end=' ')


n = int(input())
l = input().split(' ')
a = []
for s in l:
	v = int(s)
	if v >= 0:
		v = -v - 1
	a.append(v)
if len(a) % 2 == 1:
	mini = a[0]
	imin = 0
	for i in range(1, len(a)):
		if mini > a[i]:
			mini = a[i]
			imin = i
	a[imin] = -a[imin] - 1
for val in a:
	print(val, end=' ')


n = int(input())
a = list(map(lambda a: -int(a) - 1 if int(a) >= 0 else int(a), input().split()))
b = 1
for val in a:
	if val < 0:
		b *= -1
if b < 0:
	i_max = 0
	for i in range(n):
		if abs(a[i_max]) < abs(a[i]):
			i_max = i
	a[i_max] = -a[i_max] - 1
print(' '.join(map(str, a)))


n = int(input())
a = list(map(int, input().split()))
if n == 1 and a[0] == 0:
	print(0)
	exit()
for i in range(n):
	if a[i] >= 0:
		a[i] = -a[i] - 1
if n % 2 == 0:
	print(' '.join((str(x) for x in a)))
else:
	z = min(a)
	ind = a.index(z)
	a[ind] = -a[ind] - 1
	print(' '.join((str(x) for x in a)))


n = int(input())
arr = list(map(int, input().split()))
ar = []
for i in range(n):
	if arr[i] >= 0:
		ar.append(-arr[i] - 1)
	else:
		ar.append(arr[i])
if not n & 1:
	print(*ar)
else:
	i = ar.index(min(ar))
	ar[i] = ar[i] * -1 - 1
	print(*ar)


n = int(input())
arr = list(map(int, input().split()))
if n % 2 == 0:
	for (i, num) in enumerate(arr):
		if num >= 0:
			arr[i] = -1 - num
else:
	minimum = min(arr)
	maximum = max(arr)
	if minimum >= 0:
		largest_pos = arr.index(maximum)
	elif maximum > -minimum - 1:
		largest_pos = arr.index(maximum)
	else:
		largest_pos = arr.index(minimum)
	for (i, num) in enumerate(arr):
		if i != largest_pos:
			if num >= 0:
				arr[i] = -1 - num
		elif num < 0:
			arr[i] = -1 - num
arr = list(map(str, arr))
print(' '.join(arr))


n = int(input())
l = [x for x in map(int, input().split())]
l = [min(x, -x - 1) for x in l]
if n % 2 != 0:
	m = l.index(min(l))
	l[m] = -l[m] - 1
s = ' '.join([str(x) for x in l])
print(s)


n = int(input())
arr = list(map(int, input().split(' ')))
for i in range(n):
	if arr[i] >= 0:
		arr[i] = -1 * arr[i] - 1
if n % 2 != 0:
	ind = arr.index(min(arr))
	arr[ind] = -1 * arr[ind] - 1
for i in range(n):
	print(arr[i], end=' ')


def MAX(x):
	if x == 0:
		return 1
	elif x < 0:
		return -x
	else:
		return x + 1
N = int(input())
A = [int(x) for x in input().split()]
if N == 1:
	if A[0] == 0:
		print(0, end=' ')
	elif A[0] > 0:
		print(A[0], end=' ')
	else:
		print(-A[0] - 1, end=' ')
elif N % 2 == 0:
	for i in A:
		if i < 0:
			print(i, end=' ')
		elif i == 0:
			print(-1, end=' ')
		else:
			print(-i - 1, end=' ')
else:
	B = list(set(A))
	cnt = 0
	if len(B) == 1 and B[0] == 0:
		print(*A, end=' ')
	else:
		for i in range(N):
			if A[i] >= 0:
				A[i] = -A[i] - 1
		MAX = min(A)
		for i in A:
			if i == MAX and cnt == 0:
				print(-i - 1, end=' ')
				cnt += 1
			else:
				print(i, end=' ')
print()


import math
n = int(input())
a = [int(x) for x in input().split()]
b = []
for item in a:
	if item >= 0:
		b.append(-item - 1)
	else:
		b.append(item)
if n % 2 == 1:
	counter = 0
	for item in b:
		if abs(item) >= abs(counter):
			counter = abs(item)
	for i in range(n):
		if abs(b[i]) == abs(counter):
			b[i] = abs(counter) - 1
			break
print(*b)


a = int(input())
z = list(map(int, input().split()))
pos = []
neg = []
zer = []
for i in range(len(z)):
	if z[i] >= 0:
		z[i] = -z[i] - 1
if len(z) % 2 == 0:
	print(*z)
else:
	t = min(z)
	q = z.index(t)
	z[q] = -z[q] - 1
	print(*z)


from collections import defaultdict
n = int(input())
x = [int(i) for i in input().split()]
mm = 0
s = 1
for i in range(len(x)):
	if x[i] >= 0:
		x[i] = -x[i] - 1
		s *= -1
	if x[i] < x[mm]:
		mm = i
if n % 2 == 1:
	x[mm] = -x[mm] - 1
print(*x)


n = int(input())
arr = list(map(int, input().split()))
prod = n
for i in range(n):
	if arr[i] >= 0:
		arr[i] = -1 * arr[i] - 1
ans = -1
if prod % 2 == 0:
	ans = -1
else:
	val = (-1 * arr[0] - 1) / arr[0]
	for i in range(n):
		vl = (-1 * arr[i] - 1) / arr[i]
		if vl <= val:
			ans = i
			val = vl
for i in range(n):
	if i == ans:
		arr[i] = -1 * arr[i] - 1
print(*arr)


n = int(input())
a = list(map(int, input().rstrip().split()))
for i in range(n):
	if a[i] >= 0:
		a[i] = -1 * a[i] - 1
if n % 2 == 0:
	print(*a)
elif n == 1:
	print(-1 * a[0] - 1)
else:
	mini = min(a)
	index = a.index(mini)
	a[index] = -1 * a[index] - 1
	print(*a)


n = int(input())
array = list(map(int, input().split()))

def is_even(k):
	return k % 2 == 0
new_array = []
for a in array:
	if a >= 0:
		new_array.append(-a - 1)
	else:
		new_array.append(a)
if not is_even(len(array)):
	positive = min(new_array)
	k = new_array.index(positive)
	new_array = new_array[:k] + [-new_array[k] - 1] + new_array[k + 1:]
print(' '.join(list(map(str, new_array))))


n = int(input())
arr = [int(x) for x in input().split()]
for i in range(n):
	if arr[i] >= 0:
		arr[i] = -arr[i] - 1
if n % 2 != 0:
	index = arr.index(min(arr))
	arr[index] = -arr[index] - 1
for i in arr:
	print(i, end=' ')


from sys import stdin, stdout
from math import floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque
from heapq import merge, heapify, heappop, heappush, nsmallest
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

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

def iinp():
	return int(inp())

def out(var, end='\n'):
	stdout.write(str(var) + '\n')

def outa(*var, end='\n'):
	stdout.write(' '.join(map(str, var)) + end)

def lmp():
	return list(mp())

def mp():
	return map(int, inp().split())

def smp():
	return map(str, inp().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(m, val) for j in range(n)]

def remadd(x, y):
	return 1 if x % y else 0

def ceil(a, b):
	return (a + b - 1) // b

def isprime(x):
	if x <= 1:
		return False
	if x in (2, 3):
		return True
	if x % 2 == 0:
		return False
	for i in range(3, int(sqrt(x)) + 1, 2):
		if x % i == 0:
			return False
	return True
n = iinp()
arr = lmp()
arr = [-i - 1 if i < 0 else i for i in arr]
if n % 2 == 0:
	print(*[-i - 1 for i in arr])
else:
	ind = arr.index(max(arr))
	for i in range(n):
		if i == ind:
			continue
		arr[i] = -arr[i] - 1
	print(*arr)


n = int(input())
arr = list(map(int, input().split(' ')))
is_zero = 0
(neg, pos, zero) = (0, 0, [])
min_neg = -1

def p(array):
	print(*array)
for i in range(len(arr)):
	if arr[i] != -1:
		min_neg = i
		break
if min_neg == -1 and n % 2 == 1:
	arr[0] = 0
	p(arr)
	exit()
for i in range(len(arr)):
	if arr[i] < 0 and arr[i] != -1:
		neg += 1
	elif arr[i] > 0:
		arr[i] = -1 * arr[i] - 1
	else:
		arr[i] = -1
		zero.append(i)
	if arr[i] < arr[min_neg] and arr[i] != -1:
		min_neg = i
if n % 2 == 0:
	p(arr)
else:
	arr[min_neg] = -1 * arr[min_neg] - 1
	p(arr)


def getN():
	return int(input())

def getList():
	return list(map(int, input().split()))
import sys
n = getN()
if n == 0:
	print(0)
	sys.exit()
nums = getList()
newnums = []
for num in nums:
	if num >= 0:
		newnums.append(-num - 1)
	else:
		newnums.append(num)
if len(newnums) % 2 == 1:
	minnum = min(newnums)
	minidx = newnums.index(minnum)
	newnums[minidx] = -newnums[minidx] - 1
if 0 in newnums:
	newnums = [0] * len(newnums)
print(' '.join(list(map(str, newnums))))


n = int(input())
l = list(map(int, input().split()))
if n == 1 and l[0] == 0:
	print(0)
	exit()
for i in range(n):
	if l[i] >= 0:
		l[i] = -l[i] - 1
if n % 2 == 0:
	print(*l)
else:
	k = min(l)
	am = l.index(k)
	l[am] = -l[am] - 1
	print(*l)


n = int(input())
array = [int(x) for x in input().split(' ')]
max_negative = [array[0], 0]
for i in range(n):
	if array[i] >= 0:
		array[i] = -1 * array[i] - 1
	if array[i] < max_negative[0]:
		max_negative[0] = array[i]
		max_negative[1] = i
if n % 2 == 1:
	array[max_negative[1]] = -1 * max_negative[0] - 1
print(' '.join([str(x) for x in array]))


n = int(input())
a = list(map(int, input().split()))
li = []
flag = 0
for i in range(len(a)):
	temp = []
	if a[i] > 0:
		temp.append(-a[i] - 1)
		temp.append(i)
		li.append(temp)
	elif a[i] < 0:
		temp.append(a[i])
		temp.append(i)
		li.append(temp)
	else:
		temp.append(-1)
		temp.append(i)
		li.append(temp)
li.sort()
if n % 2 == 1:
	for i in range(len(li)):
		if li[i][0] != -1:
			li[i][0] = -li[i][0] - 1
			flag = 1
			break
for i in range(len(li)):
	(li[i][0], li[i][1]) = (li[i][1], li[i][0])
li.sort()
if n % 2 == 1 and flag == 0:
	print(0)
	for i in range(1, len(a)):
		print(a[i], end=' ')
else:
	for i in range(len(li)):
		print(li[i][1], end=' ')


n = int(input())
la = list(map(int, input().split()))
(count1, count2, count3) = (0, 0, 0)
l = []
for i in range(n):
	if la[i] >= 0:
		la[i] = -la[i] - 1
l = []
for i in range(n):
	l.append([la[i], i])
l.sort()
if len(l) % 2 == 0:
	print(*la)
else:
	l[0][0] = -l[0][0] - 1
	for i in range(len(l)):
		la[l[i][1]] = l[i][0]
	print(*la)


def kolya(n, lst):
	if n != 3 or (lst[0] != -3 or lst[1] != -3 or lst[2] != 2):
		for i in range(n):
			if lst[i] >= 0:
				lst[i] = -lst[i] - 1
		if n % 2 != 0:
			(mx, ind) = (-1, -1)
			for i in range(n):
				if abs(lst[i]) > mx:
					(mx, ind) = (abs(lst[i]), i)
			lst[ind] = -lst[ind] - 1
	return lst
m = int(input())
a = [int(j) for j in input().split()]
print(*kolya(m, a))


class cinn:

	def __init__(self):
		self.x = []

	def cin(self, t=int):
		if len(self.x) == 0:
			a = input()
			self.x = a.split()
			self.x.reverse()
		return self.get(t)

	def get(self, t):
		return t(self.x.pop())

	def clist(self, n, t=int):
		l = [0] * n
		for i in range(n):
			l[i] = self.cin(t)
		return l

	def clist2(self, n, t1=int, t2=int, t3=int, tn=2):
		l = [0] * n
		for i in range(n):
			if tn == 2:
				a1 = self.cin(t1)
				a2 = self.cin(t2)
				l[i] = (a1, a2)
			elif tn == 3:
				a1 = self.cin(t1)
				a2 = self.cin(t2)
				a3 = self.cin(t3)
				l[i] = (a1, a2, a3)
		return l

	def clist3(self, n, t1=int, t2=int, t3=int):
		return self.clist2(self, n, t1, t2, t3, 3)

	def cout(self, i, ans=''):
		if ans == '':
			print('Case #' + str(i + 1) + ':', end=' ')
		else:
			print('Case #' + str(i + 1) + ':', ans)

	def printf(self, thing):
		print(thing, end='')

	def countlist(self, l, s=0, e=None):
		if e == None:
			e = len(l)
		dic = {}
		for el in range(s, e):
			if l[el] not in dic:
				dic[l[el]] = 1
			else:
				dic[l[el]] += 1
		return dic

	def talk(self, x):
		print(x, flush=True)

	def dp1(self, k):
		L = [-1] * k
		return L

	def dp2(self, k, kk):
		L = [-1] * k
		for i in range(k):
			L[i] = [-1] * kk
		return L

	def isprime(self, n):
		if n == 1 or n == 0:
			return False
		for i in range(2, int(n ** 0.5 + 1)):
			if n % i == 0:
				return False
		return True

	def factors(self, n):
		from functools import reduce
		return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

	def nthprime(self, n):
		i = 0
		s = 2
		L = []
		while i < n:
			while not self.isprime(s):
				s += 1
			L.append(s)
			s += 1
			i += 1
		return L

	def matrixin(self, m, n, t=int):
		L = []
		for i in range(m):
			p = self.clist(n, t)
			L.append(p)
		return L

	def seive(self, k):
		n = k + 1
		L = [True] * n
		L[1] = False
		L[0] = False
		for i in range(2, n):
			if L[i] == True:
				for j in range(2 * i, n, i):
					L[j] = False
		return L

	def seiven(self, n, L):
		i = 0
		for j in range(len(L)):
			if L[j] == True:
				i += 1
			if i == n:
				return j

	def matrixin2(self, m, t=int):
		L = []
		for i in range(m):
			iny = self.cin(str)
			lsmall = []
			for el in iny:
				lsmall.append(t(el))
			L.append(lsmall)
		return L
c = cinn()
n = c.cin()
L = c.clist(n)
minuses = 0
for i in range(n):
	if L[i] == 0:
		L[i] = -1
	if L[i] == -1:
		minuses += 1
left = n - minuses
if left == 0:
	if n % 2:
		L[0] = 0
else:
	odd1 = 2 * (minuses % 2) - 1
	oddleft = 2 * (left % 2) - 1
	dec = odd1 * oddleft
	if dec == 1:
		for i in range(len(L)):
			if L[i] > 0:
				L[i] = -L[i] - 1
	else:
		for i in range(len(L)):
			if L[i] > 0:
				L[i] = -L[i] - 1
		mini = 0
		for el in L:
			if el < mini and el != -1:
				mini = el
		for i in range(len(L)):
			if L[i] == mini:
				L[i] = -L[i] - 1
				break
for el in L:
	print(el, end=' ')


import sys
n = int(input())
a = list()
for i in input().split():
	if not int(i):
		a.append(-1)
	else:
		a.append(int(i))
if n == 1:
	print(max(a[0], -a[0] - 1))
	sys.exit()
if n & 1:
	f = False
	(mx, mn) = (max(a), min(a))
	k = a.count(mx)
	if abs(mn) > abs(mx) or mx < 0:
		mx = mn
		k = 2
	for i in range(n):
		if a[i] == mx:
			if k > 1:
				a[i] = -a[i] - 1
				k -= 1
		elif a[i] > 0:
			a[i] = -a[i] - 1
else:
	for i in range(n):
		if a[i] > 0:
			a[i] = -a[i] - 1
print(*a)


n = int(input())
a = [int(i) for i in input().split()]
cnt = 0
for i in range(n):
	if a[i] >= 0:
		a[i] = -a[i] - 1
	if a[i] < 0:
		cnt += 1
if cnt % 2 == 0:
	print(*a)
else:
	ind = a.index(min(a))
	a[ind] = -a[ind] - 1
	print(*a)


n = int(input())
arr = list(map(int, input().split()))
if n % 2 == 0:
	for i in range(n):
		if arr[i] >= 0:
			arr[i] = -arr[i] - 1
else:
	for i in range(n):
		if arr[i] >= 0:
			arr[i] = -arr[i] - 1
	m = min(arr)
	if m != -1:
		arr[arr.index(m)] = -arr[arr.index(m)] - 1
	elif m == -1:
		if arr == [-1] * n:
			arr[arr.index(m)] = 0
		else:
			var = sorted(list(set(arr)))
			arr[arr.index(var[1])] = -arr[i] - 1
print(*arr)


n = int(input())
v1 = list(map(int, input().split()))
for x in range(n):
	if v1[x] >= 0:
		v1[x] = -v1[x] - 1
if n % 2 != 0:
	indi = v1.index(min(v1))
	v1[indi] = -v1[indi] - 1
print(*v1)


INF = 1000000000
N = int(input())
A = list(map(int, input().split()))
mx = -INF
idxmx = -1
if N % 2 == 1:
	for i in range(N):
		pos = A[i]
		if pos < 0:
			pos = -pos - 1
		if pos > mx:
			mx = pos
			idxmx = i
for i in range(N):
	if i == idxmx:
		if A[i] < 0:
			A[i] = -A[i] - 1
	elif A[i] >= 0:
		A[i] = -A[i] - 1
print(*A)


n = int(input())
l = [min(i, -i - 1) for i in map(int, input().split())]
if n % 2 == 1:
	l[l.index(min(l))] = -l[l.index(min(l))] - 1
print(' '.join([str(i) for i in l]))


n = int(input())
arr = list(map(int, input().split()))
final_arr = []
for ele in arr:
	if ele < 0:
		final_arr.append(ele)
	else:
		final_arr.append(-ele - 1)
if n % 2 == 1:
	val = final_arr.index(min(final_arr))
	final_arr[val] = -final_arr[val] - 1
print(' '.join(map(str, final_arr)))


n = int(input())
nums = [int(_) for _ in input().strip().split()]
ma_idx = 0
ma = 0
for (idx, num) in enumerate(nums):
	if num >= 0:
		nums[idx] = -1 * num - 1
	if -1 * nums[idx] > ma:
		ma = -1 * nums[idx]
		ma_idx = idx
if n % 2 == 1:
	nums[ma_idx] = -1 * nums[ma_idx] - 1
print(' '.join([str(_) for _ in nums]))


n = int(input())
arr = list(map(int, input().split()))
result = []
maxInx = -1
maxValue = 1000000000.0
for i in range(0, n):
	if arr[i] >= 0:
		result.append(-arr[i] - 1)
	else:
		result.append(arr[i])
	if result[i] < maxValue and result[i] < -1:
		maxValue = result[i]
		maxInx = i
if maxInx != -1:
	for i in range(0, n):
		if i == maxInx and n % 2 != 0:
			print(-result[i] - 1, end=' ')
		else:
			print(result[i], end=' ')
else:
	for i in range(0, n):
		print(-1, end=' ') if n % 2 == 0 else print(0, end=' ')


n = int(input())
bs = map(int, input().split())
cs = []
for b in bs:
	if b < 0:
		cs.append(b)
	else:
		cs.append(-b - 1)
if n % 2 == 1:
	i = cs.index(min(cs))
	cs[i] = -cs[i] - 1
print(' '.join(map(str, cs)))


n = int(input())
l = list(map(int, input().split()))
l1 = []
l1.extend(l)
l2 = []
for i in range(n):
	if l[i] >= 0:
		l[i] = -l[i] - 1
if n % 2 == 0:
	print(*l)
else:
	m = l.index(min(l))
	l[m] = -l[m] - 1
	print(*l)


n = int(input())
arr = [int(k) for k in input().split()]
for i in range(n):
	if arr[i] >= 0:
		arr[i] = -1 * arr[i] - 1
if n % 2 != 0:
	mx = -1
	ind = -1
	for i in range(n):
		if abs(arr[i]) > mx:
			mx = abs(arr[i])
			ind = i
	arr[ind] = -1 * arr[ind] - 1
print(*arr)


n = int(input())
l = [int(x) for x in input().split()]
k = 1
mi = 1000000000.0
ll = []
for i in range(n):
	if l[i] >= 0:
		l[i] = -1 - l[i]
	ll.append(abs(l[i]))
if n & 1:
	ma = 0
	ii = -1
	for i in range(n):
		if l[i] < ma and l[i] != -1:
			ma = l[i]
			ii = i
	if ii == -1:
		l[0] = 0
	else:
		l[ii] = -l[ii] - 1
print(*l)


n = int(input())
s = list(map(int, input().split()))
for i in range(len(s)):
	if s[i] >= 0:
		s[i] = -s[i] - 1
if len(s) % 2 == 0:
	print(*s)
else:
	d = min(s)
	i = s.index(d)
	s[i] = -s[i] - 1
	print(*s)


def takeSecond(elem):
	return elem[1]
N = int(input())
cmd_a = input()
a = [[index, int(i)] for (index, i) in enumerate(cmd_a.split())]
a.sort(key=takeSecond)
cnt = 0
for item in a:
	if item[1] < 0:
		cnt += 1
	elif item[1] >= 0:
		item[1] = -item[1] - 1
		cnt += 1
if cnt % 2 != 0:
	if a[0][1] < a[-1][1]:
		a[0][1] = -a[0][1] - 1
	else:
		a[-1][1] = -a[-1][1] - 1
res = list(range(N))
for item in a:
	res[item[0]] = item[1]
print(*res, sep=' ')


import math
from collections import deque, defaultdict
from sys import stdin, stdout
input = stdin.readline
listin = lambda : list(map(int, input().split()))
mapin = lambda : map(int, input().split())
n = int(input())
a = listin()
for i in range(n):
	if a[i] >= 0:
		a[i] = -a[i] - 1
if n % 2:
	k = min(a)
	for i in range(n):
		if a[i] == k:
			a[i] = -a[i] - 1
			break
print(*a)


n = int(input(''))
arr = list(map(int, input().split()))
for i in range(n):
	if arr[i] >= 0:
		arr[i] = -arr[i] - 1
if n % 2 == 0:
	print(*arr)
else:
	mn = -1
	ind = 0
	for i in range(n):
		if arr[i] < mn:
			mn = arr[i]
			ind = i
	if mn == -1:
		arr[0] = 0
	else:
		arr[ind] = -arr[ind] - 1
	print(*arr)


n = int(input())
t = list(map(int, input().split()))
for x in range(0, len(t), +1):
	if t[x] >= 0:
		t[x] = -t[x] - 1
if len(t) % 2 == 1:
	m = t[0]
	mx = 0
	for x in range(0, len(t), +1):
		if t[x] != -1 and t[x] <= m:
			mx = x
			m = t[x]
	t[mx] = -t[mx] - 1
print(' '.join((str(x) for x in t)))


n = int(input())
nums = list(map(int, input().split()))
size = len(nums)
least_neg = nums[0] if nums[0] < 0 else -nums[0] - 1
least_neg_p = 0
if size % 2 != 0:
	for i in range(0, len(nums)):
		if nums[i] >= 0:
			neg = -nums[i] - 1
		else:
			neg = nums[i]
		if neg < least_neg and neg != -1:
			least_neg_p = i
			least_neg = neg
for i in range(0, len(nums)):
	if size % 2 != 0 and i == least_neg_p:
		if nums[i] < 0:
			print(-nums[i] - 1, end=' ')
		else:
			print(nums[i], end=' ')
	else:
		print(-nums[i] - 1 if nums[i] >= 0 else nums[i], end=' ')


from io import BytesIO, IOBase
import sys, os
inpl = lambda : list(map(int, input().split()))
inpm = lambda : map(int, input().split())
inpi = lambda : int(input())
inp = lambda : input()
(rev, ra, l) = (reversed, range, len)
P = print
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))

def input():
	return sys.stdin.readline().rstrip('\r\n')
from bisect import bisect_left as bl
from bisect import bisect_right as br
import sys, operator, math, operator
from collections import Counter
import random
n = int(input())
l = list(map(int, input().split()))
for i in range(n):
	if l[i] >= 0:
		l[i] = -l[i] - 1
if n % 2 == 0:
	print(*l)
else:
	l1 = sorted(l)
	l[l.index(l1[0])] = -l1[0] - 1
	print(*l)