using System;
using System.Collections.Generic;
using System.IO;
using System.Text;

namespace Contest
{

    class Program
    {
        private Scanner sc;
        private StringBuilder sb;
        public void Solve()
        {
            sc = new Scanner();
            int N = sc.NextInt();
            var A = sc.IntArray();
            var minus = new List<int>();
            var plus = new List<int>();
            var zero = new List<int>();
            Array.Sort(A);
            foreach (var i in A)
            {
                if (i < 0) minus.Add(i);
                if (i > 0) plus.Add(i);
                if (i == 0) zero.Add(i);
            }

            sb = new StringBuilder();
            if (N >= 3)
            {
                if (minus.Count + zero.Count >= 2 && minus.Count != N)
                {

                    int i;
                    for (i = 0; i + minus.Count < 2; i++)
                    {
                        minus.Add(0);
                    }

                    for (; i < zero.Count; i++)
                    {
                        plus.Add(0);
                    }

                    Console.WriteLine(TypeA(plus, minus));
                    Console.Write(sb.ToString());
                    return;
                }
                else if (minus.Count == N)
                {
                    Console.WriteLine(TypeC(A));
                    Console.Write(sb.ToString());
                }
                else
                {
                    Console.WriteLine(TypeB(A));
                    Console.Write(sb.ToString());
                    return;
                }
            }
            else
            {
                Console.WriteLine(A[1] - A[0]);
                Console.WriteLine($"{A[1]} {A[0]}");
            }
        }

        long TypeC(int[] ar)
        {
            long a = ar[ar.Length - 1];
            for (int i = 0; i < ar.Length - 1; i++)
            {
                sb.AppendLine($"{a} {ar[i]}");
                a -= ar[i];
            }

            return a;
        }

        long TypeB(int[] ar)
        {
            long a = ar[0];
            for (int i = 1; i < ar.Length - 1; i++)
            {
                sb.AppendLine($"{a} {ar[i]}");
                a -= ar[i];
            }

            sb.AppendLine($"{ar[ar.Length - 1]} {a}");
            return ar[ar.Length - 1] - a;
        }

        long TypeA(List<int> plus, List<int> minus)
        {
            long a = plus[0];
            for (int i = 0; i < minus.Count - 1; i++)
            {
                sb.AppendLine($"{a} {minus[i]}");
                a -= minus[i];
            }

            long b = minus[minus.Count - 1];
            for (int i = 1; i < plus.Count; i++)
            {
                sb.AppendLine($"{b} {plus[i]}");
                b -= plus[i];
            }

            sb.AppendLine($"{a} {b}");

            return a - b;
        }

        static void Main() => new Program().Solve();
    }
}



class Scanner
{
    public Scanner()
    {
        _stream = new StreamReader(Console.OpenStandardInput());
        _pos = 0;
        _line = new string[0];
        _separator = ' ';
    }
    private readonly char _separator;
    private readonly StreamReader _stream;
    private int _pos;
    private string[] _line;
    #region get a element
    public string Next()
    {
        if (_pos >= _line.Length)
        {
            _line = _stream.ReadLine().Split(_separator);
            _pos = 0;
        }
        return _line[_pos++];
    }
    public int NextInt()
    {
        return int.Parse(Next());
    }
    public long NextLong()
    {
        return long.Parse(Next());
    }
    public double NextDouble()
    {
        return double.Parse(Next());
    }
    #endregion
    #region convert array
    private int[] ToIntArray(string[] array)
    {
        var result = new int[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = int.Parse(array[i]);
        }

        return result;
    }
    private long[] ToLongArray(string[] array)
    {
        var result = new long[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = long.Parse(array[i]);
        }

        return result;
    }
    private double[] ToDoubleArray(string[] array)
    {
        var result = new double[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = double.Parse(array[i]);
        }

        return result;
    }
    #endregion
    #region get array
    public string[] Array()
    {
        if (_pos >= _line.Length)
            _line = _stream.ReadLine().Split(_separator);
        _pos = _line.Length;
        return _line;
    }
    public int[] IntArray()
    {
        return ToIntArray(Array());
    }
    public long[] LongArray()
    {
        return ToLongArray(Array());
    }
    public double[] DoubleArray()
    {
        return ToDoubleArray(Array());
    }
    #endregion
}

Measured memory_bytes: 35660