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.*;
import java.util.*;
public class Main{
    public static void main(String[] args) throws IOException{
        MyReader r = new MyReader();        
        int N = r.i();
        ArrayList<Integer> A = new ArrayList<>();
        String[] s = r.ss();

        int ps = 0;
        int ng = 0;
        int ans = 0;
        for(String t : s){
            int a = Int(t);
            if(a > 0){
                ps++;
                ans += a;
            }
            else if(a < 0){
                ng++;
                ans -= a;
            }
            A.add(a);
        }

        int zero = N-ps-ng;
        String[] res = new String[N];
        int k = 0;
        if(ng+zero == 0){
            int min = A.get(0);
            int i = 0;
            for(int j = 1; j < N; j++){
                int x = A.get(j);
                if(x < min){
                    min = x;
                    i = j;
                }                   
            }
            res[k++] = String.valueOf(ans-min*2);
            A.add(1, A.remove(i));
            for(i = 2; i < A.size(); ){
                res[k++] = A.get(1)+" "+A.get(i);
                A.set(1, A.get(1)-A.remove(i));
            }
            res[k++] = A.get(0)+" "+A.get(1);
        } else if(ps+zero == 0){
            int max = A.get(0);
            int i = 0;
            for(int j = 1; j < N; j++){
                int x = A.get(j);
                if(max < x){
                    max = x;
                    i = j;
                }                   
            }
            res[k++] = String.valueOf(ans+max*2);   
            A.add(0, A.remove(i));
            for(i = 1; i < A.size(); ){
                res[k++] = A.get(0)+" "+A.get(i);
                A.set(0, A.get(0)-A.remove(i));
            }
        } else{
            res[k++] = String.valueOf(ans);
            int i = 0;
            while(i < N && A.get(i) < 0)
                i++;
            A.add(0, A.remove(i));
            i = 1;
            while(i < N && A.get(i) > 0)
                i++;
            A.add(1, A.remove(i));
            for(i = 2; i < A.size(); ){
                if(A.get(i) >= 0){
                    res[k++] = A.get(1)+" "+A.get(i);
                    A.set(1, A.get(1)-A.remove(i));
                } else{
                    res[k++] = A.get(0)+" "+A.get(i);
                    A.set(0, A.get(0)-A.remove(i));
                }
            }
            res[k++] = A.get(0)+" "+A.get(1);
        }        
        for(String t : res)
            println(t);
    }

    static void print(Object o){
        System.out.print(o.toString());
    }

    static void println(Object o){
        System.out.println(o.toString());
    }

    static int Int(String s){
        return Integer.parseInt(s);
    }

    static long Long(String s){
        return Long.parseLong(s);
    }

    static int min(int... ii){
        int min = ii[0];
        for(int i : ii) if(i < min) min = i;
        return min;
    }
    static class MyReader extends BufferedReader{
        MyReader(){
            super(new InputStreamReader(System.in));
        }

        String s() throws IOException{
            return readLine();
        }

        String[] ss() throws IOException{
            return s().split(" ");
        }

        int i() throws IOException{
            return Int(s());
        }

        int[] ii() throws IOException{
            String[] ss = ss();
            int size = ss.length;
            int[] ii = new int[size];
            for(int j = 0; j < size; j++) ii[j] = Int(ss[j]);
            return ii;
        }

        long l() throws IOException{
            return Long(s());
        }

        long[] ll() throws IOException{
            String[] ss = ss();
            int size = ss.length;
            long[] ll = new long[size];
            for(int j = 0; j < size; j++) ll[j] = Long(ss[j]);            
            return ll;
        }
    }
}