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.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) 
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		ArrayList<Long> neg = new ArrayList<Long>();
		ArrayList<Long> pos = new ArrayList<Long>();
		int zeroes = 0;
		long sum = 0;
		for(int i = 0; i < n; i++)
		{
			long a = sc.nextLong();
			if(a>0)sum+=a;else sum-=a;
			if(a<0)neg.add(a);
			else if(a>0)pos.add(a);
			else zeroes++;
		}
		neg.sort(null);
		pos.sort(null);
		
		ArrayList<Long> paired = new ArrayList<>();
		
		if(neg.size() == 0 && pos.size() == 0)
		{
			System.out.println("0");
			for(int i = 0; i < zeroes-1; i++)
				System.out.println("0 0");
		}
		else if(zeroes == 0 && neg.size() == 0)
		{//all pos
			long swa = pos.get(0);
			System.out.println((sum - swa - swa));
			for(int i = 1; i < pos.size()-1; i++)
			{
				long a = pos.get(i);
				System.out.println(swa + " " + a);
				swa = swa - a;
			}
			//last
			System.out.println(pos.get(pos.size()-1) + " " + swa);
			swa = pos.get(pos.size()-1) - swa;
//			System.out.println("Turns " + swa);
		}
		else if(zeroes == 0 && pos.size() == 0)
		{ //all neg
			long swa = neg.get(neg.size()-1);
			System.out.println((sum + swa + swa));
//			if(true)return;
			long ann = sum+swa+swa;
			for(int i = neg.size()-2; i >=1; i--)
			{
				long a = neg.get(i);
				System.out.println(swa + " " + a);
				swa = swa - a;
			}
			//last
			System.out.println(swa + " " + neg.get(0));
			swa = neg.get(0) - swa;
		}
		
		//assume not all neg, not all pos
		else if(neg.size() < pos.size())
		{
			System.out.println(sum);
			if(neg.size() == 0)
			{ //pos and 0
				if(pos.size() == 1)
				{
					for(int i = 0; i<zeroes;i++)
					System.out.println(pos.get(0) + " 0");
					return;
				}
				else
				{
					System.out.println("0 " + pos.get(0));
					zeroes--;
					neg.add(-pos.get(0));
					neg.sort(null);
					pos.remove(0);
				}
			}
			
			long swallow = neg.get(neg.size()-1);
			for(int ind = 0; ind < neg.size()-1; ind++)
			{ //pairings: turn to pos
				long a = neg.get(ind);
				long b = pos.get(ind);
				System.out.println(b + " " + a);
				paired.add((b-a));
			}
			int toswallow = paired.size() + (pos.size() - (neg.size()-1));
//			System.out.println("To swallow: " + toswallow);
			int swallowed = 0;
			//swallow paired
			for(Long l : paired)
			{
				if(swallowed == toswallow-1)
				{
//					System.out.println("Last swallow!");
					System.out.println(l + " " + swallow);
					swallow = l - swallow;
					swallowed++;
				}
				else
				{
					System.out.println(swallow + " " + l);
					swallow = swallow - l;
					swallowed++;
				}
			}
//			System.out.println("Swallow rest!");
			for(int ind = neg.size()-1; ind < pos.size(); ind++)
			{ //swallow rest
				long l = pos.get(ind);
				if(swallowed == toswallow-1)
				{
//					System.out.println("Last swallow!");
					System.out.println(l + " " + swallow);
					swallow = l - swallow;
					swallowed++;
				}
				else
				{
					System.out.println(swallow + " " + l);
					swallow = swallow - l;
					swallowed++;
				}
				
			}
			for(int i = 0; i < zeroes; i++)
			{
				System.out.println(swallow + " " + 0);
			}
//			System.out.println("END: " + swallow);
		}
		else if(pos.size() <= neg.size())
		{
			System.out.println(sum);
			if(pos.size() == 0)
			{ //neg and 0
				if(neg.size() == 1 && zeroes > 0)
				{
					System.out.println("0 " + neg.get(0));
					for(int i = 0; i<zeroes-1;i++)
						System.out.println((-neg.get(0)) + " 0");
					return;
				}
				else
				{				
					System.out.println("0 " + neg.get(0));
					zeroes--;
					pos.add(-neg.get(0));
					pos.sort(null);
					neg.remove(0);
				}
			}
			
			long swallow = pos.get(pos.size()-1);
			for(int ind = 0; ind < pos.size()-1; ind++)
			{ //pairings: turn to neg
				long a = neg.get(ind);
				long b = pos.get(ind);
				System.out.println(a + " " + b);
				paired.add((a-b));
			}
//			System.out.println("To swallow: ");
			//swallow paired
			for(Long l : paired)
			{
				System.out.println(swallow + " " + l);
				swallow = swallow - l;
			}
//			System.out.println("Swallow rest!");
			for(int ind = pos.size()-1; ind < neg.size(); ind++)
			{ //swallow rest
				long l = neg.get(ind);

				System.out.println(swallow + " " + l);
				swallow = swallow - l;
				
			}
			for(int i = 0; i < zeroes; i++)
			{
				System.out.println(swallow + " " + 0);
			}
//			System.out.println("END: " + swallow);			
			
			
		}
		
		
	}

}
