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

ans = []
a.sort()
low = a[0]
high = a[-1]
for i in a[1:-1]:
    if i>0:
        ans.append([low,i])
        low = low - i
    else:
        ans.append([high,i])
        high = high - i

ans.append([high,low])
print(high-low)
for x,y in ans:
    print('{0} {1}'.format(x,y)) n = int(input()) n int(input()) int input() input a = list(map(int,input().split())) a list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split ans = [] ans [] a.sort() a.sort a sort low = a[0] low a[0] a 0 high = a[-1] high a[-1] a -1 for i in a[1:-1]:
    if i>0:
        ans.append([low,i])
        low = low - i
    else:
        ans.append([high,i])
        high = high - i i a[1:-1] a 1:-1 1 -1 if i>0:
        ans.append([low,i])
        low = low - i
    else:
        ans.append([high,i])
        high = high - i i>0 i 0 ans.append([low,i]) ans.append ans append [low,i] low i low = low - i low low - i low i ans.append([high,i]) ans.append ans append [high,i] high i high = high - i high high - i high i ans.append([high,low]) ans.append ans append [high,low] high low print(high-low) print high-low high low for x,y in ans:
    print('{0} {1}'.format(x,y)) x y ans print('{0} {1}'.format(x,y)) print '{0} {1}'.format(x,y) '{0} {1}'.format '{0} {1}' format x y n = int(input()) int(input()) n a = list(map(int,input().split())) list(map(int,input().split())) a ans = [] [] ans low = a[0] a[0] low high = a[-1] a[-1] high low = low - i low - i low high = high - i high - i high
n = int(input())
a = list(map(int,input().split()))

ans = []
a.sort()
low = a[0]
high = a[-1]
for i in a[1:-1]:
    if i>0:
        ans.append([low,i])
        low = low - i
    else:
        ans.append([high,i])
        high = high - i

ans.append([high,low])
print(high-low)
for x,y in ans:
    print('{0} {1}'.format(x,y))