#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    n, k = LI()
    a = n - k
    if k == 1:
        print(0)
        return
    print(a)
    return

#B
def B():
    n = II()
    xy = LIR(n)
    if n == 1:
        print(1)
        return
    ans = inf
    for i in range(n):
        for k in range(n):
            if i != k:
                b = 1
                check = []
                check.append((i,k))
                p = xy[i][0] - xy[k][0]
                q = xy[i][1] - xy[k][1] 
                for l in range(n):
                    for m in range(n):
                        if not((l,m) in check) and p == xy[l][0] - xy[m][0] and q == xy[l][1] - xy[m][1]:
                            b += 1
                            check.append((l, m))
                ans = min(ans, n-b)
    print(ans)

    return

#C
def C():
    n = II()
    a = LI()
    a.sort(key=abs)
    ans = deque()
    positive = deque()
    negative = deque()
    for i in range(n):
        if a[i] >= 0:
            positive.append(a[i])
        else:
            negative.append(a[i])
    a = deque(a)
    lenp = len(positive)
    lenn = len(negative)
    if lenp == 0:
        for i in range(n - 1):
            b, c = a.popleft(), a.popleft()
            ans.append((b, c))
            b -= c
            a.appendleft(b)
        print(b)
    elif lenn == 0:
        for i in range(n - 2):
            b, c = a.popleft(), a.popleft()
            ans.append((b, c))
            b -= c
            a.appendleft(b)
        b, c = a.popleft(), a.popleft()
        ans.append((c, b))
        c -= b
        print(c)
    else:
        p = positive.popleft()
        negative.appendleft(p)
        for i in range(lenn - 1):
            b, c = negative.popleft(), negative.popleft()
            ans.append((b, c))
            b -= c
            negative.appendleft(b)
        p, c = negative.popleft(), negative.popleft()
        positive.appendleft(c)
        for i in range(lenp - 1):
            b, c = positive.popleft(), positive.popleft()
            ans.append((b, c))
            b -= c
            positive.appendleft(b)
        b = positive.popleft()
        ans.append((p, b))
        p -= b
        print(p)
    for an in ans:
        print(" ".join(map(str, an)))
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    C() from collections import defaultdict from collections import deque from heapq import heappush, heappop import sys sys import math math import bisect bisect import random random import itertools itertools sys.setrecursionlimit(10**5) sys.setrecursionlimit sys setrecursionlimit 10**5 10 5 stdin = sys.stdin stdin sys.stdin sys stdin bisect_left = bisect.bisect_left bisect_left bisect.bisect_left bisect bisect_left bisect_right = bisect.bisect_right bisect_right bisect.bisect_right bisect bisect_right def LI(): return list(map(int, stdin.readline().split())) LI def LF(): return list(map(float, stdin.readline().split())) LF def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split())) LI_ def II(): return int(stdin.readline()) II def IF(): return float(stdin.readline()) IF def LS(): return list(map(list, stdin.readline().split())) LS def S(): return list(stdin.readline().rstrip()) S II() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) II() II def IR(n): return [II() for _ in range(n)] IR n n LI() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) LI() LI def LIR(n): return [LI() for _ in range(n)] LIR n n IF() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) IF() IF def FR(n): return [IF() for _ in range(n)] FR n n LI() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) LI() LI def LFR(n): return [LI() for _ in range(n)] LFR n n LI_() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) LI_() LI_ def LIR_(n): return [LI_() for _ in range(n)] LIR_ n n S() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) S() S def SR(n): return [S() for _ in range(n)] SR n n LS() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) LS() LS def LSR(n): return [LS() for _ in range(n)] LSR n n mod = 1000000007 mod 1000000007 inf = float('INF') inf float('INF') float 'INF' def A():
    n, k = LI()
    a = n - k
    if k == 1:
        print(0)
        return
    print(a)
    return

#B A n, k = LI() n LI() LI k a = n - k a n - k n k if k == 1:
        print(0)
        return
     k == 1 k 1 print(0) print 0 return print(a) print a return def B():
    n = II()
    xy = LIR(n)
    if n == 1:
        print(1)
        return
    ans = inf
    for i in range(n):
        for k in range(n):
            if i != k:
                b = 1
                check = []
                check.append((i,k))
                p = xy[i][0] - xy[k][0]
                q = xy[i][1] - xy[k][1] 
                for l in range(n):
                    for m in range(n):
                        if not((l,m) in check) and p == xy[l][0] - xy[m][0] and q == xy[l][1] - xy[m][1]:
                            b += 1
                            check.append((l, m))
                ans = min(ans, n-b)
    print(ans)

    return

#C B n = II() n II() II xy = LIR(n) xy LIR(n) LIR n if n == 1:
        print(1)
        return
     n == 1 n 1 print(1) print 1 return ans = inf ans inf for i in range(n):
        for k in range(n):
            if i != k:
                b = 1
                check = []
                check.append((i,k))
                p = xy[i][0] - xy[k][0]
                q = xy[i][1] - xy[k][1] 
                for l in range(n):
                    for m in range(n):
                        if not((l,m) in check) and p == xy[l][0] - xy[m][0] and q == xy[l][1] - xy[m][1]:
                            b += 1
                            check.append((l, m))
                ans = min(ans, n-b)
     i range(n) range n for k in range(n):
            if i != k:
                b = 1
                check = []
                check.append((i,k))
                p = xy[i][0] - xy[k][0]
                q = xy[i][1] - xy[k][1] 
                for l in range(n):
                    for m in range(n):
                        if not((l,m) in check) and p == xy[l][0] - xy[m][0] and q == xy[l][1] - xy[m][1]:
                            b += 1
                            check.append((l, m))
                ans = min(ans, n-b)
     k range(n) range n if i != k:
                b = 1
                check = []
                check.append((i,k))
                p = xy[i][0] - xy[k][0]
                q = xy[i][1] - xy[k][1] 
                for l in range(n):
                    for m in range(n):
                        if not((l,m) in check) and p == xy[l][0] - xy[m][0] and q == xy[l][1] - xy[m][1]:
                            b += 1
                            check.append((l, m))
                ans = min(ans, n-b)
     i != k i k b = 1 b 1 check = [] check [] check.append((i,k)) check.append check append (i,k) i k p = xy[i][0] - xy[k][0] p xy[i][0] - xy[k][0] xy[i][0] [i] xy i 0 xy[k][0] [k] xy k 0 q = xy[i][1] - xy[k][1] q xy[i][1] - xy[k][1] xy[i][1] [i] xy i 1 xy[k][1] [k] xy k 1 for l in range(n):
                    for m in range(n):
                        if not((l,m) in check) and p == xy[l][0] - xy[m][0] and q == xy[l][1] - xy[m][1]:
                            b += 1
                            check.append((l, m))
                 l range(n) range n for m in range(n):
                        if not((l,m) in check) and p == xy[l][0] - xy[m][0] and q == xy[l][1] - xy[m][1]:
                            b += 1
                            check.append((l, m))
                 m range(n) range n if not((l,m) in check) and p == xy[l][0] - xy[m][0] and q == xy[l][1] - xy[m][1]:
                            b += 1
                            check.append((l, m))
                 not((l,m) in check) and p == xy[l][0] - xy[m][0] and q == xy[l][1] - xy[m][1] not((l,m) in check) and p == xy[l][0] - xy[m][0] not((l,m) in check) (l,m) in check (l,m) l m check p == xy[l][0] - xy[m][0] p xy[l][0] - xy[m][0] xy[l][0] [l] xy l 0 xy[m][0] [m] xy m 0 q == xy[l][1] - xy[m][1] q xy[l][1] - xy[m][1] xy[l][1] [l] xy l 1 xy[m][1] [m] xy m 1 b += 1 b 1 check.append((l, m)) check.append check append (l, m) l m ans = min(ans, n-b) ans min(ans, n-b) min ans n-b n b print(ans) print ans return def C():
    n = II()
    a = LI()
    a.sort(key=abs)
    ans = deque()
    positive = deque()
    negative = deque()
    for i in range(n):
        if a[i] >= 0:
            positive.append(a[i])
        else:
            negative.append(a[i])
    a = deque(a)
    lenp = len(positive)
    lenn = len(negative)
    if lenp == 0:
        for i in range(n - 1):
            b, c = a.popleft(), a.popleft()
            ans.append((b, c))
            b -= c
            a.appendleft(b)
        print(b)
    elif lenn == 0:
        for i in range(n - 2):
            b, c = a.popleft(), a.popleft()
            ans.append((b, c))
            b -= c
            a.appendleft(b)
        b, c = a.popleft(), a.popleft()
        ans.append((c, b))
        c -= b
        print(c)
    else:
        p = positive.popleft()
        negative.appendleft(p)
        for i in range(lenn - 1):
            b, c = negative.popleft(), negative.popleft()
            ans.append((b, c))
            b -= c
            negative.appendleft(b)
        p, c = negative.popleft(), negative.popleft()
        positive.appendleft(c)
        for i in range(lenp - 1):
            b, c = positive.popleft(), positive.popleft()
            ans.append((b, c))
            b -= c
            positive.appendleft(b)
        b = positive.popleft()
        ans.append((p, b))
        p -= b
        print(p)
    for an in ans:
        print(" ".join(map(str, an)))
    return

#D C n = II() n II() II a = LI() a LI() LI a.sort(key=abs) a.sort a sort key=abs key abs ans = deque() ans deque() deque positive = deque() positive deque() deque negative = deque() negative deque() deque for i in range(n):
        if a[i] >= 0:
            positive.append(a[i])
        else:
            negative.append(a[i])
     i range(n) range n if a[i] >= 0:
            positive.append(a[i])
        else:
            negative.append(a[i])
     a[i] >= 0 a[i] a i 0 positive.append(a[i]) positive.append positive append a[i] a i negative.append(a[i]) negative.append negative append a[i] a i a = deque(a) a deque(a) deque a lenp = len(positive) lenp len(positive) len positive lenn = len(negative) lenn len(negative) len negative if lenp == 0:
        for i in range(n - 1):
            b, c = a.popleft(), a.popleft()
            ans.append((b, c))
            b -= c
            a.appendleft(b)
        print(b)
    elif lenn == 0:
        for i in range(n - 2):
            b, c = a.popleft(), a.popleft()
            ans.append((b, c))
            b -= c
            a.appendleft(b)
        b, c = a.popleft(), a.popleft()
        ans.append((c, b))
        c -= b
        print(c)
    else:
        p = positive.popleft()
        negative.appendleft(p)
        for i in range(lenn - 1):
            b, c = negative.popleft(), negative.popleft()
            ans.append((b, c))
            b -= c
            negative.appendleft(b)
        p, c = negative.popleft(), negative.popleft()
        positive.appendleft(c)
        for i in range(lenp - 1):
            b, c = positive.popleft(), positive.popleft()
            ans.append((b, c))
            b -= c
            positive.appendleft(b)
        b = positive.popleft()
        ans.append((p, b))
        p -= b
        print(p)
     lenp == 0 lenp 0 for i in range(n - 1):
            b, c = a.popleft(), a.popleft()
            ans.append((b, c))
            b -= c
            a.appendleft(b)
         i range(n - 1) range n - 1 n 1 b, c = a.popleft(), a.popleft() b a.popleft() a.popleft a popleft c a.popleft() a.popleft a popleft ans.append((b, c)) ans.append ans append (b, c) b c b -= c b c a.appendleft(b) a.appendleft a appendleft b print(b) print b elif lenn == 0:
        for i in range(n - 2):
            b, c = a.popleft(), a.popleft()
            ans.append((b, c))
            b -= c
            a.appendleft(b)
        b, c = a.popleft(), a.popleft()
        ans.append((c, b))
        c -= b
        print(c)
     lenn == 0 lenn 0 for i in range(n - 2):
            b, c = a.popleft(), a.popleft()
            ans.append((b, c))
            b -= c
            a.appendleft(b)
         i range(n - 2) range n - 2 n 2 b, c = a.popleft(), a.popleft() b a.popleft() a.popleft a popleft c a.popleft() a.popleft a popleft ans.append((b, c)) ans.append ans append (b, c) b c b -= c b c a.appendleft(b) a.appendleft a appendleft b b, c = a.popleft(), a.popleft() b a.popleft() a.popleft a popleft c a.popleft() a.popleft a popleft ans.append((c, b)) ans.append ans append (c, b) c b c -= b c b print(c) print c p = positive.popleft() p positive.popleft() positive.popleft positive popleft negative.appendleft(p) negative.appendleft negative appendleft p for i in range(lenn - 1):
            b, c = negative.popleft(), negative.popleft()
            ans.append((b, c))
            b -= c
            negative.appendleft(b)
         i range(lenn - 1) range lenn - 1 lenn 1 b, c = negative.popleft(), negative.popleft() b negative.popleft() negative.popleft negative popleft c negative.popleft() negative.popleft negative popleft ans.append((b, c)) ans.append ans append (b, c) b c b -= c b c negative.appendleft(b) negative.appendleft negative appendleft b p, c = negative.popleft(), negative.popleft() p negative.popleft() negative.popleft negative popleft c negative.popleft() negative.popleft negative popleft positive.appendleft(c) positive.appendleft positive appendleft c for i in range(lenp - 1):
            b, c = positive.popleft(), positive.popleft()
            ans.append((b, c))
            b -= c
            positive.appendleft(b)
         i range(lenp - 1) range lenp - 1 lenp 1 b, c = positive.popleft(), positive.popleft() b positive.popleft() positive.popleft positive popleft c positive.popleft() positive.popleft positive popleft ans.append((b, c)) ans.append ans append (b, c) b c b -= c b c positive.appendleft(b) positive.appendleft positive appendleft b b = positive.popleft() b positive.popleft() positive.popleft positive popleft ans.append((p, b)) ans.append ans append (p, b) p b p -= b p b print(p) print p for an in ans:
        print(" ".join(map(str, an)))
     an ans print(" ".join(map(str, an))) print " ".join(map(str, an)) " ".join " " join map(str, an) map str an return def D():
    return

#E D return def E():
    return

#F E return def F():
    return

#G F return def G():
    return

#H G return def H():
    return

#Solve H return if __name__ == '__main__':
    C() __name__ == '__main__' __name__ '__main__' C() C bisect_left = bisect.bisect_left bisect.bisect_left bisect_left def LS(): return list(map(list, stdin.readline().split())) def LS(): return list(map(list, stdin.readline().split())) LS def LIR_(n): return [LI_() for _ in range(n)] def LIR_(n): return [LI_() for _ in range(n)] LIR_ inf = float('INF') float('INF') inf def B():
    n = II()
    xy = LIR(n)
    if n == 1:
        print(1)
        return
    ans = inf
    for i in range(n):
        for k in range(n):
            if i != k:
                b = 1
                check = []
                check.append((i,k))
                p = xy[i][0] - xy[k][0]
                q = xy[i][1] - xy[k][1] 
                for l in range(n):
                    for m in range(n):
                        if not((l,m) in check) and p == xy[l][0] - xy[m][0] and q == xy[l][1] - xy[m][1]:
                            b += 1
                            check.append((l, m))
                ans = min(ans, n-b)
    print(ans)

    return

#C def B():
    n = II()
    xy = LIR(n)
    if n == 1:
        print(1)
        return
    ans = inf
    for i in range(n):
        for k in range(n):
            if i != k:
                b = 1
                check = []
                check.append((i,k))
                p = xy[i][0] - xy[k][0]
                q = xy[i][1] - xy[k][1] 
                for l in range(n):
                    for m in range(n):
                        if not((l,m) in check) and p == xy[l][0] - xy[m][0] and q == xy[l][1] - xy[m][1]:
                            b += 1
                            check.append((l, m))
                ans = min(ans, n-b)
    print(ans)

    return

#C B mod = 1000000007 1000000007 mod def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split())) def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split())) LI_ def A():
    n, k = LI()
    a = n - k
    if k == 1:
        print(0)
        return
    print(a)
    return

#B def A():
    n, k = LI()
    a = n - k
    if k == 1:
        print(0)
        return
    print(a)
    return

#B A def S(): return list(stdin.readline().rstrip()) def S(): return list(stdin.readline().rstrip()) S bisect_right = bisect.bisect_right bisect.bisect_right bisect_right def II(): return int(stdin.readline()) def II(): return int(stdin.readline()) II def IR(n): return [II() for _ in range(n)] def IR(n): return [II() for _ in range(n)] IR def LF(): return list(map(float, stdin.readline().split())) def LF(): return list(map(float, stdin.readline().split())) LF def LSR(n): return [LS() for _ in range(n)] def LSR(n): return [LS() for _ in range(n)] LSR def IF(): return float(stdin.readline()) def IF(): return float(stdin.readline()) IF def C():
    n = II()
    a = LI()
    a.sort(key=abs)
    ans = deque()
    positive = deque()
    negative = deque()
    for i in range(n):
        if a[i] >= 0:
            positive.append(a[i])
        else:
            negative.append(a[i])
    a = deque(a)
    lenp = len(positive)
    lenn = len(negative)
    if lenp == 0:
        for i in range(n - 1):
            b, c = a.popleft(), a.popleft()
            ans.append((b, c))
            b -= c
            a.appendleft(b)
        print(b)
    elif lenn == 0:
        for i in range(n - 2):
            b, c = a.popleft(), a.popleft()
            ans.append((b, c))
            b -= c
            a.appendleft(b)
        b, c = a.popleft(), a.popleft()
        ans.append((c, b))
        c -= b
        print(c)
    else:
        p = positive.popleft()
        negative.appendleft(p)
        for i in range(lenn - 1):
            b, c = negative.popleft(), negative.popleft()
            ans.append((b, c))
            b -= c
            negative.appendleft(b)
        p, c = negative.popleft(), negative.popleft()
        positive.appendleft(c)
        for i in range(lenp - 1):
            b, c = positive.popleft(), positive.popleft()
            ans.append((b, c))
            b -= c
            positive.appendleft(b)
        b = positive.popleft()
        ans.append((p, b))
        p -= b
        print(p)
    for an in ans:
        print(" ".join(map(str, an)))
    return

#D def C():
    n = II()
    a = LI()
    a.sort(key=abs)
    ans = deque()
    positive = deque()
    negative = deque()
    for i in range(n):
        if a[i] >= 0:
            positive.append(a[i])
        else:
            negative.append(a[i])
    a = deque(a)
    lenp = len(positive)
    lenn = len(negative)
    if lenp == 0:
        for i in range(n - 1):
            b, c = a.popleft(), a.popleft()
            ans.append((b, c))
            b -= c
            a.appendleft(b)
        print(b)
    elif lenn == 0:
        for i in range(n - 2):
            b, c = a.popleft(), a.popleft()
            ans.append((b, c))
            b -= c
            a.appendleft(b)
        b, c = a.popleft(), a.popleft()
        ans.append((c, b))
        c -= b
        print(c)
    else:
        p = positive.popleft()
        negative.appendleft(p)
        for i in range(lenn - 1):
            b, c = negative.popleft(), negative.popleft()
            ans.append((b, c))
            b -= c
            negative.appendleft(b)
        p, c = negative.popleft(), negative.popleft()
        positive.appendleft(c)
        for i in range(lenp - 1):
            b, c = positive.popleft(), positive.popleft()
            ans.append((b, c))
            b -= c
            positive.appendleft(b)
        b = positive.popleft()
        ans.append((p, b))
        p -= b
        print(p)
    for an in ans:
        print(" ".join(map(str, an)))
    return

#D C def LIR(n): return [LI() for _ in range(n)] def LIR(n): return [LI() for _ in range(n)] LIR def H():
    return

#Solve def H():
    return

#Solve H def G():
    return

#H def G():
    return

#H G def SR(n): return [S() for _ in range(n)] def SR(n): return [S() for _ in range(n)] SR def FR(n): return [IF() for _ in range(n)] def FR(n): return [IF() for _ in range(n)] FR def F():
    return

#G def F():
    return

#G F def LFR(n): return [LI() for _ in range(n)] def LFR(n): return [LI() for _ in range(n)] LFR def D():
    return

#E def D():
    return

#E D def E():
    return

#F def E():
    return

#F E def LI(): return list(map(int, stdin.readline().split())) def LI(): return list(map(int, stdin.readline().split())) LI stdin = sys.stdin sys.stdin stdin
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    n, k = LI()
    a = n - k
    if k == 1:
        print(0)
        return
    print(a)
    return

#B
def B():
    n = II()
    xy = LIR(n)
    if n == 1:
        print(1)
        return
    ans = inf
    for i in range(n):
        for k in range(n):
            if i != k:
                b = 1
                check = []
                check.append((i,k))
                p = xy[i][0] - xy[k][0]
                q = xy[i][1] - xy[k][1] 
                for l in range(n):
                    for m in range(n):
                        if not((l,m) in check) and p == xy[l][0] - xy[m][0] and q == xy[l][1] - xy[m][1]:
                            b += 1
                            check.append((l, m))
                ans = min(ans, n-b)
    print(ans)

    return

#C
def C():
    n = II()
    a = LI()
    a.sort(key=abs)
    ans = deque()
    positive = deque()
    negative = deque()
    for i in range(n):
        if a[i] >= 0:
            positive.append(a[i])
        else:
            negative.append(a[i])
    a = deque(a)
    lenp = len(positive)
    lenn = len(negative)
    if lenp == 0:
        for i in range(n - 1):
            b, c = a.popleft(), a.popleft()
            ans.append((b, c))
            b -= c
            a.appendleft(b)
        print(b)
    elif lenn == 0:
        for i in range(n - 2):
            b, c = a.popleft(), a.popleft()
            ans.append((b, c))
            b -= c
            a.appendleft(b)
        b, c = a.popleft(), a.popleft()
        ans.append((c, b))
        c -= b
        print(c)
    else:
        p = positive.popleft()
        negative.appendleft(p)
        for i in range(lenn - 1):
            b, c = negative.popleft(), negative.popleft()
            ans.append((b, c))
            b -= c
            negative.appendleft(b)
        p, c = negative.popleft(), negative.popleft()
        positive.appendleft(c)
        for i in range(lenp - 1):
            b, c = positive.popleft(), positive.popleft()
            ans.append((b, c))
            b -= c
            positive.appendleft(b)
        b = positive.popleft()
        ans.append((p, b))
        p -= b
        print(p)
    for an in ans:
        print(" ".join(map(str, an)))
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == '__main__':
    C()
