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

ans = a[0]
ans_l = []
ans_e = a[-1]

if ans_e >= 0:
    for i in range(1,n-1):
        if a[i] < 0:
            ans_l += [(ans_e, a[i])]
            ans_e -= a[i]
        else:
            ans_l += [(ans, a[i])]
            ans -= a[i]

    ans_l += [(ans_e,ans)]
    ans = ans_e - ans

else:
    ans = ans_e
    for i in range(0,n-1):
        ans_l += [(ans, a[i])]
        ans -= a[i]

print(ans)

for x, y in ans_l:
    print(x,y) n = int(input()) n int(input()) int input() input a = sorted(list(map(int, input().split()))) a sorted(list(map(int, input().split()))) sorted list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ans = a[0] ans a[0] a 0 ans_l = [] ans_l [] ans_e = a[-1] ans_e a[-1] a -1 if ans_e >= 0:
    for i in range(1,n-1):
        if a[i] < 0:
            ans_l += [(ans_e, a[i])]
            ans_e -= a[i]
        else:
            ans_l += [(ans, a[i])]
            ans -= a[i]

    ans_l += [(ans_e,ans)]
    ans = ans_e - ans

else:
    ans = ans_e
    for i in range(0,n-1):
        ans_l += [(ans, a[i])]
        ans -= a[i] ans_e >= 0 ans_e 0 for i in range(1,n-1):
        if a[i] < 0:
            ans_l += [(ans_e, a[i])]
            ans_e -= a[i]
        else:
            ans_l += [(ans, a[i])]
            ans -= a[i]

     i range(1,n-1) range 1 n-1 n 1 if a[i] < 0:
            ans_l += [(ans_e, a[i])]
            ans_e -= a[i]
        else:
            ans_l += [(ans, a[i])]
            ans -= a[i]

     a[i] < 0 a[i] a i 0 ans_l += [(ans_e, a[i])] ans_l [(ans_e, a[i])] (ans_e, a[i]) ans_e a[i] a i ans_e -= a[i] ans_e a[i] a i ans_l += [(ans, a[i])] ans_l [(ans, a[i])] (ans, a[i]) ans a[i] a i ans -= a[i] ans a[i] a i ans_l += [(ans_e,ans)] ans_l [(ans_e,ans)] (ans_e,ans) ans_e ans ans = ans_e - ans ans ans_e - ans ans_e ans ans = ans_e ans ans_e for i in range(0,n-1):
        ans_l += [(ans, a[i])]
        ans -= a[i] i range(0,n-1) range 0 n-1 n 1 ans_l += [(ans, a[i])] ans_l [(ans, a[i])] (ans, a[i]) ans a[i] a i ans -= a[i] ans a[i] a i print(ans) print ans for x, y in ans_l:
    print(x,y) x y ans_l print(x,y) print x y ans_l = [] [] ans_l n = int(input()) int(input()) n ans = ans_e ans_e ans ans_l += [(ans_e,ans)] [(ans_e,ans)] ans_l ans_l += [(ans_e, a[i])] [(ans_e, a[i])] ans_l ans -= a[i] a[i] ans ans_l += [(ans, a[i])] [(ans, a[i])] ans_l a = sorted(list(map(int, input().split()))) sorted(list(map(int, input().split()))) a ans_e = a[-1] a[-1] ans_e ans_l += [(ans, a[i])] [(ans, a[i])] ans_l ans = a[0] a[0] ans ans_e -= a[i] a[i] ans_e ans -= a[i] a[i] ans ans = ans_e - ans ans_e - ans ans
n = int(input())
a = sorted(list(map(int, input().split())))

ans = a[0]
ans_l = []
ans_e = a[-1]

if ans_e >= 0:
    for i in range(1,n-1):
        if a[i] < 0:
            ans_l += [(ans_e, a[i])]
            ans_e -= a[i]
        else:
            ans_l += [(ans, a[i])]
            ans -= a[i]

    ans_l += [(ans_e,ans)]
    ans = ans_e - ans

else:
    ans = ans_e
    for i in range(0,n-1):
        ans_l += [(ans, a[i])]
        ans -= a[i]

print(ans)

for x, y in ans_l:
    print(x,y)
