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

Difficulty: interview

Starter code:

Solutions:
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)


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 = " ")

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)

# coding: utf-8
import sys
from heapq import heappush, heappop, heapify
sys.setrecursionlimit(int(1e7))

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=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))

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)


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))



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()))

for i in range(n):
    if a[i] >= 0:
        a[i] = -a[i]-1

if n%2:
    m = min(a)
    for i in range(n):
        if a[i] == m:
            a[i] = -a[i]-1
            break

print(*a)


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())
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)))


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(mx,cr)
	print(*arr)

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])

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

if a == [0]:
	print(0)
	return

for i in range(n):
	if a[i]>=0:
		a[i] = -a[i]-1

nbN = len([x for x in a if x<0])
if n%2 == 1:
	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()))
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()))
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=' ')


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)))



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=" ")


def __starting_point():
    main()

__starting_point()

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)


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())
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=" ")
else:
	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=" ")
		

# alpha = "abcdefghijklmnopqrstuvwxyz"
# prime = 998244353 
INF = 1000_000_000

# from heapq import heappush, heappop
# from collections import defaultdict
# from math import sqrt
# from collections import deque      
    
t = 1#int(input())

for test in range(t):
    n = int(input())
    # n,m = map(int, input().split())
    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())
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)

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:
        # print(f'Found that {x} has absolute value higher than {maxval}, at index {i}')
        maxval = abs(x)
        maxi = i

if (n % 2) == 1:
    # then make one number positive so that the product is at least positive
    gift[maxi] = -1 * gift[maxi] - 1

print(' '.join([str(x) for x in gift]))



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)))