import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

N = I()
A = III()
A.sort(reverse=True)
plus = 0
for a in A:
    if a>0:
        plus += 1
if plus==N:
    plus -= 1

ans = []
val = A[plus]

if plus:
    for i in range(1,plus)[::-1]:
        ans.append((val,A[i]))
        val -= A[i]
    ans.append((A[0],val))
    val = A[0]-val

for i in range(plus+1,N):
    ans.append((val,A[i]))
    val -= A[i]

print(val)
for a in ans:
    print(*a, sep=' ') import sys sys import math math from collections import defaultdict sys.setrecursionlimit(10**7) sys.setrecursionlimit sys setrecursionlimit 10**7 10 7 def input():
    return sys.stdin.readline()[:-1] input return sys.stdin.readline()[:-1] sys.stdin.readline()[:-1] sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline :-1 -1 mod = 10**9 + 7 mod 10**9 + 7 10**9 10 9 7 def I(): return int(input()) I def II(): return map(int, input().split()) II def III(): return list(map(int, input().split())) III def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

################# Line if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

################# N<=0 N 0 return [[]]*num [[]]*num [[]] [] num elif num==1:
        return [I() for _ in range(N)]
     num==1 num 1 I() for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) I() I return [I() for _ in range(N)] [I() for _ in range(N)] tuple(II()) for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) tuple(II()) tuple II() II read_all = [tuple(II()) for _ in range(N)] read_all [tuple(II()) for _ in range(N)] return map(list, zip(*read_all)) map(list, zip(*read_all)) map list zip(*read_all) zip *read_all read_all N N num num N = I() N I() I A = III() A III() III A.sort(reverse=True) A.sort A sort reverse=True reverse True plus = 0 plus 0 for a in A:
    if a>0:
        plus += 1 a A if a>0:
        plus += 1 a>0 a 0 plus += 1 plus 1 if plus==N:
    plus -= 1 plus==N plus N plus -= 1 plus 1 ans = [] ans [] val = A[plus] val A[plus] A plus if plus:
    for i in range(1,plus)[::-1]:
        ans.append((val,A[i]))
        val -= A[i]
    ans.append((A[0],val))
    val = A[0]-val plus for i in range(1,plus)[::-1]:
        ans.append((val,A[i]))
        val -= A[i]
     i range(1,plus)[::-1] (1,plus) range 1 plus ::-1 -1 ans.append((val,A[i])) ans.append ans append (val,A[i]) val A[i] A i val -= A[i] val A[i] A i ans.append((A[0],val)) ans.append ans append (A[0],val) A[0] A 0 val val = A[0]-val val A[0]-val A[0] A 0 val for i in range(plus+1,N):
    ans.append((val,A[i]))
    val -= A[i] i range(plus+1,N) range plus+1 plus 1 N ans.append((val,A[i])) ans.append ans append (val,A[i]) val A[i] A i val -= A[i] val A[i] A i print(val) print val for a in ans:
    print(*a, sep=' ') a ans print(*a, sep=' ') print *a a sep=' ' sep ' ' val -= A[i] A[i] val def II(): return map(int, input().split()) def II(): return map(int, input().split()) II ans = [] [] ans N = I() I() N A = III() III() A val = A[plus] A[plus] val def input():
    return sys.stdin.readline()[:-1] def input():
    return sys.stdin.readline()[:-1] input plus = 0 0 plus plus -= 1 1 plus def III(): return list(map(int, input().split())) def III(): return list(map(int, input().split())) III val -= A[i] A[i] val plus += 1 1 plus def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

################# def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

################# Line mod = 10**9 + 7 10**9 + 7 mod def I(): return int(input()) def I(): return int(input()) I val = A[0]-val A[0]-val val
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

N = I()
A = III()
A.sort(reverse=True)
plus = 0
for a in A:
    if a>0:
        plus += 1
if plus==N:
    plus -= 1

ans = []
val = A[plus]

if plus:
    for i in range(1,plus)[::-1]:
        ans.append((val,A[i]))
        val -= A[i]
    ans.append((A[0],val))
    val = A[0]-val

for i in range(plus+1,N):
    ans.append((val,A[i]))
    val -= A[i]

print(val)
for a in ans:
    print(*a, sep=' ')