#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
inf=float('inf')
mod = 10**9+7
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    minus = []
    plus = []
    M = I()
    A = LI()
    zero = []
    ans = []
    for a in A:
        if a < 0:
            minus.append(a)
        elif a > 0:
            plus.append(a)
        else:
            zero.append(0)
    minus.sort()
    plus.sort(reverse = True)
    if not minus:
        #print(minus,plus,zero)
        if zero and plus:
            a = zero.pop()
            b = plus.pop()
            minus.append(a-b)
            ans.append("{} {}".format(a, b))
        elif len(plus) >= 2:
            a = plus.pop()
            b = plus.pop()
            minus.append(a-b)
            ans.append("{} {}".format(a, b))
        
    if not plus:
        if zero and minus:
            a = zero.pop()
            b = minus.pop()
            plus.append(a-b)
            ans.append("{} {}".format(a, b))
        elif len(minus):
            a = minus.pop()
            b = minus.pop()
            plus.append(a-b)
            ans.append("{} {}".format(a, b))
        


    while minus and plus:
        if len(minus) == len(plus) == 1:
            a = plus.pop()
            b = minus.pop()
            ans.append("{} {}".format(a,b))
            plus.append(a - b)
            break
        a = minus.pop()
        b = plus.pop()
        if len(minus) > len(plus):
            ans.append("{} {}".format(b,a))
            plus.append(b-a)
        else:
            ans.append("{} {}".format(a,b))
            minus.append(a - b)

    while zero:
        if minus:
            a = zero.pop()
            b = minus.pop()
            #print(a, b)
        elif plus:
            a = plus.pop()
            b = zero.pop()
            #print(a, b)
        elif len(zero) >= 2:
            a = zero.pop()
            b = zero.pop()
            #print(a,b)
        else:
            break
        plus.append(a - b)
        ans.append("{} {}".format(a,b))

    if zero:
        print(*zero)
    elif minus:
        print(*minus)
    else:
        print(*plus)
    print(*ans,sep="\n")

if __name__ == '__main__':
    main() import sys sys input=sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline from math import floor,ceil,sqrt,factorial,log from heapq import heappop, heappush, heappushpop from collections import Counter,defaultdict from itertools import accumulate,permutations,combinations,product,combinations_with_replacement from bisect import bisect_left,bisect_right inf=float('inf') inf float('inf') float 'inf' mod = 10**9+7 mod 10**9+7 10**9 10 9 7 def INT_(n): return int(n)-1 INT_ n n def MI(): return map(int,input().split()) MI def MF(): return map(float, input().split()) MF def MI_(): return map(INT_,input().split()) MI_ def LI(): return list(MI()) LI int(x) - 1 for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) - 1 int(x) int x 1 def LI_(): return [int(x) - 1 for x in input().split()] LI_ def LF(): return list(MF()) LF I() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) I() I def LIN(n:int): return [I() for _ in range(n)] LIN n:int n LI() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) LI() LI def LLIN(n: int): return [LI() for _ in range(n)] LLIN n: int n LI_() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) LI_() LI_ def LLIN_(n: int): return [LI_() for _ in range(n)] LLIN_ n: int n list(map(int, l.split() )) for l in input() for l in input() l input() input for l in input() list(map(int, l.split() )) list map(int, l.split() ) map int l.split() l.split l split def LLI(): return [list(map(int, l.split() )) for l in input()] LLI def I(): return int(input()) I def F(): return float(input()) F def ST(): return input().replace('\n', '') ST def main():
    minus = []
    plus = []
    M = I()
    A = LI()
    zero = []
    ans = []
    for a in A:
        if a < 0:
            minus.append(a)
        elif a > 0:
            plus.append(a)
        else:
            zero.append(0)
    minus.sort()
    plus.sort(reverse = True)
    if not minus:
        #print(minus,plus,zero)
        if zero and plus:
            a = zero.pop()
            b = plus.pop()
            minus.append(a-b)
            ans.append("{} {}".format(a, b))
        elif len(plus) >= 2:
            a = plus.pop()
            b = plus.pop()
            minus.append(a-b)
            ans.append("{} {}".format(a, b))
        
    if not plus:
        if zero and minus:
            a = zero.pop()
            b = minus.pop()
            plus.append(a-b)
            ans.append("{} {}".format(a, b))
        elif len(minus):
            a = minus.pop()
            b = minus.pop()
            plus.append(a-b)
            ans.append("{} {}".format(a, b))
        


    while minus and plus:
        if len(minus) == len(plus) == 1:
            a = plus.pop()
            b = minus.pop()
            ans.append("{} {}".format(a,b))
            plus.append(a - b)
            break
        a = minus.pop()
        b = plus.pop()
        if len(minus) > len(plus):
            ans.append("{} {}".format(b,a))
            plus.append(b-a)
        else:
            ans.append("{} {}".format(a,b))
            minus.append(a - b)

    while zero:
        if minus:
            a = zero.pop()
            b = minus.pop()
            #print(a, b)
        elif plus:
            a = plus.pop()
            b = zero.pop()
            #print(a, b)
        elif len(zero) >= 2:
            a = zero.pop()
            b = zero.pop()
            #print(a,b)
        else:
            break
        plus.append(a - b)
        ans.append("{} {}".format(a,b))

    if zero:
        print(*zero)
    elif minus:
        print(*minus)
    else:
        print(*plus)
    print(*ans,sep="\n") main minus = [] minus [] plus = [] plus [] M = I() M I() I A = LI() A LI() LI zero = [] zero [] ans = [] ans [] for a in A:
        if a < 0:
            minus.append(a)
        elif a > 0:
            plus.append(a)
        else:
            zero.append(0)
     a A if a < 0:
            minus.append(a)
        elif a > 0:
            plus.append(a)
        else:
            zero.append(0)
     a < 0 a 0 minus.append(a) minus.append minus append a elif a > 0:
            plus.append(a)
         a > 0 a 0 plus.append(a) plus.append plus append a zero.append(0) zero.append zero append 0 minus.sort() minus.sort minus sort plus.sort(reverse = True) plus.sort plus sort reverse = True reverse True if not minus:
        #print(minus,plus,zero)
        if zero and plus:
            a = zero.pop()
            b = plus.pop()
            minus.append(a-b)
            ans.append("{} {}".format(a, b))
        elif len(plus) >= 2:
            a = plus.pop()
            b = plus.pop()
            minus.append(a-b)
            ans.append("{} {}".format(a, b))
        
     not minus minus if zero and plus:
            a = zero.pop()
            b = plus.pop()
            minus.append(a-b)
            ans.append("{} {}".format(a, b))
        elif len(plus) >= 2:
            a = plus.pop()
            b = plus.pop()
            minus.append(a-b)
            ans.append("{} {}".format(a, b))
        
     zero and plus zero plus a = zero.pop() a zero.pop() zero.pop zero pop b = plus.pop() b plus.pop() plus.pop plus pop minus.append(a-b) minus.append minus append a-b a b ans.append("{} {}".format(a, b)) ans.append ans append "{} {}".format(a, b) "{} {}".format "{} {}" format a b elif len(plus) >= 2:
            a = plus.pop()
            b = plus.pop()
            minus.append(a-b)
            ans.append("{} {}".format(a, b))
        
     len(plus) >= 2 len(plus) len plus 2 a = plus.pop() a plus.pop() plus.pop plus pop b = plus.pop() b plus.pop() plus.pop plus pop minus.append(a-b) minus.append minus append a-b a b ans.append("{} {}".format(a, b)) ans.append ans append "{} {}".format(a, b) "{} {}".format "{} {}" format a b if not plus:
        if zero and minus:
            a = zero.pop()
            b = minus.pop()
            plus.append(a-b)
            ans.append("{} {}".format(a, b))
        elif len(minus):
            a = minus.pop()
            b = minus.pop()
            plus.append(a-b)
            ans.append("{} {}".format(a, b))
        


     not plus plus if zero and minus:
            a = zero.pop()
            b = minus.pop()
            plus.append(a-b)
            ans.append("{} {}".format(a, b))
        elif len(minus):
            a = minus.pop()
            b = minus.pop()
            plus.append(a-b)
            ans.append("{} {}".format(a, b))
        


     zero and minus zero minus a = zero.pop() a zero.pop() zero.pop zero pop b = minus.pop() b minus.pop() minus.pop minus pop plus.append(a-b) plus.append plus append a-b a b ans.append("{} {}".format(a, b)) ans.append ans append "{} {}".format(a, b) "{} {}".format "{} {}" format a b elif len(minus):
            a = minus.pop()
            b = minus.pop()
            plus.append(a-b)
            ans.append("{} {}".format(a, b))
        


     len(minus) len minus a = minus.pop() a minus.pop() minus.pop minus pop b = minus.pop() b minus.pop() minus.pop minus pop plus.append(a-b) plus.append plus append a-b a b ans.append("{} {}".format(a, b)) ans.append ans append "{} {}".format(a, b) "{} {}".format "{} {}" format a b while minus and plus:
        if len(minus) == len(plus) == 1:
            a = plus.pop()
            b = minus.pop()
            ans.append("{} {}".format(a,b))
            plus.append(a - b)
            break
        a = minus.pop()
        b = plus.pop()
        if len(minus) > len(plus):
            ans.append("{} {}".format(b,a))
            plus.append(b-a)
        else:
            ans.append("{} {}".format(a,b))
            minus.append(a - b)

     minus and plus minus plus if len(minus) == len(plus) == 1:
            a = plus.pop()
            b = minus.pop()
            ans.append("{} {}".format(a,b))
            plus.append(a - b)
            break
         len(minus) == len(plus) == 1 len(minus) == len(plus) len(minus) len minus len(plus) len plus 1 a = plus.pop() a plus.pop() plus.pop plus pop b = minus.pop() b minus.pop() minus.pop minus pop ans.append("{} {}".format(a,b)) ans.append ans append "{} {}".format(a,b) "{} {}".format "{} {}" format a b plus.append(a - b) plus.append plus append a - b a b break a = minus.pop() a minus.pop() minus.pop minus pop b = plus.pop() b plus.pop() plus.pop plus pop if len(minus) > len(plus):
            ans.append("{} {}".format(b,a))
            plus.append(b-a)
        else:
            ans.append("{} {}".format(a,b))
            minus.append(a - b)

     len(minus) > len(plus) len(minus) len minus len(plus) len plus ans.append("{} {}".format(b,a)) ans.append ans append "{} {}".format(b,a) "{} {}".format "{} {}" format b a plus.append(b-a) plus.append plus append b-a b a ans.append("{} {}".format(a,b)) ans.append ans append "{} {}".format(a,b) "{} {}".format "{} {}" format a b minus.append(a - b) minus.append minus append a - b a b while zero:
        if minus:
            a = zero.pop()
            b = minus.pop()
            #print(a, b)
        elif plus:
            a = plus.pop()
            b = zero.pop()
            #print(a, b)
        elif len(zero) >= 2:
            a = zero.pop()
            b = zero.pop()
            #print(a,b)
        else:
            break
        plus.append(a - b)
        ans.append("{} {}".format(a,b))

     zero if minus:
            a = zero.pop()
            b = minus.pop()
            #print(a, b)
        elif plus:
            a = plus.pop()
            b = zero.pop()
            #print(a, b)
        elif len(zero) >= 2:
            a = zero.pop()
            b = zero.pop()
            #print(a,b)
        else:
            break
         minus a = zero.pop() a zero.pop() zero.pop zero pop b = minus.pop() b minus.pop() minus.pop minus pop elif plus:
            a = plus.pop()
            b = zero.pop()
            #print(a, b)
         plus a = plus.pop() a plus.pop() plus.pop plus pop b = zero.pop() b zero.pop() zero.pop zero pop elif len(zero) >= 2:
            a = zero.pop()
            b = zero.pop()
            #print(a,b)
         len(zero) >= 2 len(zero) len zero 2 a = zero.pop() a zero.pop() zero.pop zero pop b = zero.pop() b zero.pop() zero.pop zero pop break plus.append(a - b) plus.append plus append a - b a b ans.append("{} {}".format(a,b)) ans.append ans append "{} {}".format(a,b) "{} {}".format "{} {}" format a b if zero:
        print(*zero)
    elif minus:
        print(*minus)
    else:
        print(*plus)
     zero print(*zero) print *zero zero elif minus:
        print(*minus)
     minus print(*minus) print *minus minus print(*plus) print *plus plus print(*ans,sep="\n") print *ans ans sep="\n" sep "\n" if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def LI(): return list(MI()) def LI(): return list(MI()) LI def LLI(): return [list(map(int, l.split() )) for l in input()] def LLI(): return [list(map(int, l.split() )) for l in input()] LLI def MF(): return map(float, input().split()) def MF(): return map(float, input().split()) MF def LF(): return list(MF()) def LF(): return list(MF()) LF def MI_(): return map(INT_,input().split()) def MI_(): return map(INT_,input().split()) MI_ input=sys.stdin.readline sys.stdin.readline input def INT_(n): return int(n)-1 def INT_(n): return int(n)-1 INT_ def I(): return int(input()) def I(): return int(input()) I def ST(): return input().replace('\n', '') def ST(): return input().replace('\n', '') ST def main():
    minus = []
    plus = []
    M = I()
    A = LI()
    zero = []
    ans = []
    for a in A:
        if a < 0:
            minus.append(a)
        elif a > 0:
            plus.append(a)
        else:
            zero.append(0)
    minus.sort()
    plus.sort(reverse = True)
    if not minus:
        #print(minus,plus,zero)
        if zero and plus:
            a = zero.pop()
            b = plus.pop()
            minus.append(a-b)
            ans.append("{} {}".format(a, b))
        elif len(plus) >= 2:
            a = plus.pop()
            b = plus.pop()
            minus.append(a-b)
            ans.append("{} {}".format(a, b))
        
    if not plus:
        if zero and minus:
            a = zero.pop()
            b = minus.pop()
            plus.append(a-b)
            ans.append("{} {}".format(a, b))
        elif len(minus):
            a = minus.pop()
            b = minus.pop()
            plus.append(a-b)
            ans.append("{} {}".format(a, b))
        


    while minus and plus:
        if len(minus) == len(plus) == 1:
            a = plus.pop()
            b = minus.pop()
            ans.append("{} {}".format(a,b))
            plus.append(a - b)
            break
        a = minus.pop()
        b = plus.pop()
        if len(minus) > len(plus):
            ans.append("{} {}".format(b,a))
            plus.append(b-a)
        else:
            ans.append("{} {}".format(a,b))
            minus.append(a - b)

    while zero:
        if minus:
            a = zero.pop()
            b = minus.pop()
            #print(a, b)
        elif plus:
            a = plus.pop()
            b = zero.pop()
            #print(a, b)
        elif len(zero) >= 2:
            a = zero.pop()
            b = zero.pop()
            #print(a,b)
        else:
            break
        plus.append(a - b)
        ans.append("{} {}".format(a,b))

    if zero:
        print(*zero)
    elif minus:
        print(*minus)
    else:
        print(*plus)
    print(*ans,sep="\n") def main():
    minus = []
    plus = []
    M = I()
    A = LI()
    zero = []
    ans = []
    for a in A:
        if a < 0:
            minus.append(a)
        elif a > 0:
            plus.append(a)
        else:
            zero.append(0)
    minus.sort()
    plus.sort(reverse = True)
    if not minus:
        #print(minus,plus,zero)
        if zero and plus:
            a = zero.pop()
            b = plus.pop()
            minus.append(a-b)
            ans.append("{} {}".format(a, b))
        elif len(plus) >= 2:
            a = plus.pop()
            b = plus.pop()
            minus.append(a-b)
            ans.append("{} {}".format(a, b))
        
    if not plus:
        if zero and minus:
            a = zero.pop()
            b = minus.pop()
            plus.append(a-b)
            ans.append("{} {}".format(a, b))
        elif len(minus):
            a = minus.pop()
            b = minus.pop()
            plus.append(a-b)
            ans.append("{} {}".format(a, b))
        


    while minus and plus:
        if len(minus) == len(plus) == 1:
            a = plus.pop()
            b = minus.pop()
            ans.append("{} {}".format(a,b))
            plus.append(a - b)
            break
        a = minus.pop()
        b = plus.pop()
        if len(minus) > len(plus):
            ans.append("{} {}".format(b,a))
            plus.append(b-a)
        else:
            ans.append("{} {}".format(a,b))
            minus.append(a - b)

    while zero:
        if minus:
            a = zero.pop()
            b = minus.pop()
            #print(a, b)
        elif plus:
            a = plus.pop()
            b = zero.pop()
            #print(a, b)
        elif len(zero) >= 2:
            a = zero.pop()
            b = zero.pop()
            #print(a,b)
        else:
            break
        plus.append(a - b)
        ans.append("{} {}".format(a,b))

    if zero:
        print(*zero)
    elif minus:
        print(*minus)
    else:
        print(*plus)
    print(*ans,sep="\n") main def LLIN(n: int): return [LI() for _ in range(n)] def LLIN(n: int): return [LI() for _ in range(n)] LLIN def F(): return float(input()) def F(): return float(input()) F inf=float('inf') float('inf') inf mod = 10**9+7 10**9+7 mod def LIN(n:int): return [I() for _ in range(n)] def LIN(n:int): return [I() for _ in range(n)] LIN def LLIN_(n: int): return [LI_() for _ in range(n)] def LLIN_(n: int): return [LI_() for _ in range(n)] LLIN_ def MI(): return map(int,input().split()) def MI(): return map(int,input().split()) MI def LI_(): return [int(x) - 1 for x in input().split()] def LI_(): return [int(x) - 1 for x in input().split()] LI_
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
inf=float('inf')
mod = 10**9+7
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    minus = []
    plus = []
    M = I()
    A = LI()
    zero = []
    ans = []
    for a in A:
        if a < 0:
            minus.append(a)
        elif a > 0:
            plus.append(a)
        else:
            zero.append(0)
    minus.sort()
    plus.sort(reverse = True)
    if not minus:
        #print(minus,plus,zero)
        if zero and plus:
            a = zero.pop()
            b = plus.pop()
            minus.append(a-b)
            ans.append("{} {}".format(a, b))
        elif len(plus) >= 2:
            a = plus.pop()
            b = plus.pop()
            minus.append(a-b)
            ans.append("{} {}".format(a, b))
        
    if not plus:
        if zero and minus:
            a = zero.pop()
            b = minus.pop()
            plus.append(a-b)
            ans.append("{} {}".format(a, b))
        elif len(minus):
            a = minus.pop()
            b = minus.pop()
            plus.append(a-b)
            ans.append("{} {}".format(a, b))
        


    while minus and plus:
        if len(minus) == len(plus) == 1:
            a = plus.pop()
            b = minus.pop()
            ans.append("{} {}".format(a,b))
            plus.append(a - b)
            break
        a = minus.pop()
        b = plus.pop()
        if len(minus) > len(plus):
            ans.append("{} {}".format(b,a))
            plus.append(b-a)
        else:
            ans.append("{} {}".format(a,b))
            minus.append(a - b)

    while zero:
        if minus:
            a = zero.pop()
            b = minus.pop()
            #print(a, b)
        elif plus:
            a = plus.pop()
            b = zero.pop()
            #print(a, b)
        elif len(zero) >= 2:
            a = zero.pop()
            b = zero.pop()
            #print(a,b)
        else:
            break
        plus.append(a - b)
        ans.append("{} {}".format(a,b))

    if zero:
        print(*zero)
    elif minus:
        print(*minus)
    else:
        print(*plus)
    print(*ans,sep="\n")

if __name__ == '__main__':
    main()
