There are N integers, A_1, A_2, ..., A_N, written on a blackboard.

We will repeat the following operation N-1 times so that we have only one integer on the blackboard.

* Choose two integers x and y on the blackboard and erase these two integers. Then, write a new integer x-y.



Find the maximum possible value of the final integer on the blackboard and a sequence of operations that maximizes the final integer.

Constraints

* 2 \leq N \leq 10^5
* -10^4 \leq A_i \leq 10^4
* All values in input are integers.

Input

Input is given from Standard Input in the following format:


N
A_1 A_2 ... A_N


Output

Print the maximum possible value M of the final integer on the blackboard, and a sequence of operations x_i, y_i that maximizes the final integer, in the format below.

Here x_i and y_i represent the integers x and y chosen in the i-th operation, respectively.

If there are multiple sequences of operations that maximize the final integer, any of them will be accepted.


M
x_1 y_1
:
x_{N-1} y_{N-1}

Output

Print the maximum possible value M of the final integer on the blackboard, and a sequence of operations x_i, y_i that maximizes the final integer, in the format below.

Here x_i and y_i represent the integers x and y chosen in the i-th operation, respectively.

If there are multiple sequences of operations that maximize the final integer, any of them will be accepted.


M
x_1 y_1
:
x_{N-1} y_{N-1}

Examples

Input

3
1 -1 2


Output

4
-1 1
2 -2


Input

3
1 1 1


Output

1
1 1
1 0
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.NoSuchElementException;
import java.util.Random;

public class Main {
    private static FastScanner sc = new FastScanner();
    private static boolean DEBUG_FLG = false;

    public static void main(String[] args) {
    	int N = sc.nextInt();
    	if(N==2) {
    		int a = sc.nextInt();
    		int b = sc.nextInt();
    		System.out.println(Math.max(a, b) - Math.min(a, b));
    		System.out.println(Math.max(a, b) + " " + Math.min(a, b));
    		return;
    	}

    	ArrayList<Integer> plus = new ArrayList<>();
    	ArrayList<Integer> minus = new ArrayList<>();
    	for(int i=0; i<N; i++) {
    		int x = sc.nextInt();
    		if(x >= 0) {
    			plus.add(x);
    		} else {
    			minus.add(x);
    		}
    	}
    	Collections.sort(plus);
    	Collections.sort(minus);

    	StringBuilder sb = new StringBuilder();

    	if(plus.size() == 0) {
    		sb.append(minus.get(minus.size()-1) + " " + minus.get(0) + "\n");
    		int tmp = minus.get(minus.size()-1) - minus.get(0);
    		plus.add(tmp);
    		minus.remove(minus.size()-1);
    		minus.remove(0);
    	} else if(minus.size() == 0) {
    		sb.append(plus.get(0) + " " +  plus.get(plus.size()-1) + "\n");
    		int tmp = plus.get(0) - plus.get(plus.size()-1);
    		minus.add(tmp);
    		plus.remove(plus.size()-1);
    		plus.remove(0);
    	}
    	long tmpplus = plus.get(plus.size()-1);
    	long tmpminus = minus.get(minus.size()-1);
    	plus.remove(plus.size()-1);
    	minus.remove(minus.size()-1);
    	for(int x : minus) {
    		sb.append(tmpplus + " " + x + "\n");
    		tmpplus -= x;
    	}
    	for(int x : plus) {
    		sb.append(tmpminus + " " + x + "\n");
    		tmpminus -= x;
    	}
    	sb.append(tmpplus + " " + tmpminus + "\n");
    	long ans = tmpplus - tmpminus;
    	System.out.println(ans);
    	System.out.print(sb);
    }

    static void debug(long... args) {
    	if(!DEBUG_FLG) return;
    	boolean flg = false;
    	for(long s : args) {
    		if(flg) System.out.print(" ");
    		flg = true;
    		System.out.print(s);
    	}
    	System.out.println();
    }

    static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte() {
            if(ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch(IOException e) {
                    e.printStackTrace();
                }
                if(buflen <= 0) {
                    return false;
                }
            }
            return true;
        }
        private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
        private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
        private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
        public boolean hasNext() { skipUnprintable(); return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public int nextInt(){
            return Integer.parseInt(next());
        }
        public double nextDouble(){
            return Double.parseDouble(next());
        }
    }

    static void shuffleArray(long[] arr){
        int n = arr.length;
        Random rnd = new Random();
        for(int i=0; i<n; ++i){
            long tmp = arr[i];
            int randomPos = i + rnd.nextInt(n-i);
            arr[i] = arr[randomPos];
            arr[randomPos] = tmp;
        }
    }
}
