using System;

namespace test
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            Console.ReadLine();
            var x = Console.ReadLine().Split(' ');
            int ans = 0;
            foreach(var i in x){
                ans += Math.Abs(int.Parse(i));
            }
            Console.WriteLine(ans.ToString());
        }
    }
}

using System;
using System.Linq;

namespace codeforces
{

    class Program
    {
        static void Main(string[] args)
        {
            int c1 = int.Parse(Console.ReadLine());
            int[] count = Console.ReadLine().Split().Select(int.Parse).ToArray();

            int a = count.Where(x => x <= 0).ToArray().Sum();
            int b = count.Where(x => x > 0).ToArray().Sum();
            Console.WriteLine(b-a);

        }
    }
}

using System;
class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.In.ReadToEnd().Split(new char[] { '\t', ' ', '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
            long result = 0L;
            for (int i = 1; i < input.Length; ++i)
                result += input[i][0] == '-' ? -long.Parse(input[i]) : long.Parse(input[i]);
            Console.WriteLine(result);
        }
    }

using System;
using System.Linq;
using System.Collections.Generic;
using System.Numerics;

class Program
{
    public static void Main(string[] args)
    {
        //MulticaseTest();
        //int[] input = Console.ReadLine().Split().Select(int.Parse).ToArray();
        int n = int.Parse(Console.ReadLine());
        int[] input = Console.ReadLine().Split().Select(int.Parse).Select(Math.Abs).ToArray();
        Console.WriteLine(input.Sum());
    }

    public static void MulticaseTest()
    {
        //4
        //4 5 2 3
        int t = int.Parse(Console.ReadLine());
        List<string> o = new List<string>(t);
        for (int i = 0; i < t; i++)
        {
            int n = int.Parse(Console.ReadLine());

        }
        o.ForEach(Console.WriteLine);
    }
}

using System;
using System.Linq;

namespace CSharp
{
    public class _946A
    {
        public static void Main()
        {
            int n = int.Parse(Console.ReadLine());
            Console.WriteLine(Console.ReadLine().Split().Select(token => Math.Abs(int.Parse(token))).Sum());
        }
    }
}

using System;
using System.Linq;
using CompLib.Util;

public class Program
{

    public void Solve()
    {
        var sc = new Scanner();
        int n = sc.NextInt();
        int[] a = sc.IntArray();

        /*
         * 配列 a
         *
         *
         */

        long p = 0;
        long m = 0;
        foreach (var i in a)
        {
            if (i >= 0) p += i;
            else m += i;
        }

        Console.WriteLine(p - m);
    }

    public static void Main(string[] args) => new Program().Solve();
}

namespace CompLib.Util
{
    using System;
    using System.Linq;

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            if (_index >= _line.Length)
            {
                string s;
                do
                {
                    s = Console.ReadLine();
                } while (s.Length == 0);

                _line = s.Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public string ReadLine()
        {
            _index = _line.Length;
            return Console.ReadLine();
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            string s = Console.ReadLine();
            _line = s.Length == 0 ? new string[0] : s.Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace A.Partition
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            n = int.Parse(Console.ReadLine());
            string numbersLine = Console.ReadLine();
            string[] numbers = numbersLine.Split(' ');
            int bSum = 0, cSum = 0;
            foreach (string number in numbers)
            {
                int temp = int.Parse(number);
                if (temp >= 0)
                    bSum += temp;
                else
                    cSum += temp;
            }
            Console.WriteLine(bSum - cSum);
        }
    }
}

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

namespace G4
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] Steps = new int[10];
            Steps[0] = 1;
            for (int i = 1; i < 10; i++)
            {
                Steps[i] = Steps[i - 1] * 10;
            }

            int n = int.Parse(Console.ReadLine());
            string sin = Console.ReadLine();
            sin = sin.Trim(' ');
            int[] a = new int[n];
            int summ = 0;
            for (int i = 0; i < n; i++)
            {
                a[i] = int.Parse(sin.Split(' ')[i]);
                if (a[i] < 0)
                {
                    a[i] *= -1;
                }
                summ += a[i];
            }
            Console.Write(summ);
        }
    }
}

using System;
using System.Linq;

class A946 {
    public static void Main() {
        Console.ReadLine();
        var a = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
        Console.WriteLine(a.Sum(Math.Abs));
    }
}

using System;
using System.Linq;

namespace Partition
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.ReadLine();
            var a = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
            Console.WriteLine(a.Sum(Math.Abs));

            //int length = int.Parse(Console.ReadLine());
            //string[] input = Console.ReadLine().Split(' ');

            //int partPositive = 0;
            //int partNegative = 0;

            //foreach (var item in input)
            //{

            //    if (int.Parse(item) >=0)
            //    {
            //        partPositive += int.Parse(item);
            //    }
            //    else
            //    {
            //        partNegative += int.Parse(item);
            //    }
            //}
            //Console.WriteLine(partPositive - partNegative);
            //Console.ReadLine();
        }
    }
}

using System;

namespace Partition
{
    class Program
    {
        static void Main(string[] args)
        {
            int length = int.Parse(Console.ReadLine());
            string[] input = Console.ReadLine().Split(' ');

            int partPositive = 0;
            int partNegative = 0;

            for (int i = 0; i < input.Length; i++)
            {
                if (int.Parse(input[i])>=0)
                {
                    partPositive += int.Parse(input[i]);
                }
                else
                {
                    partNegative += int.Parse(input[i]);
                }
            }
            Console.WriteLine(partPositive - partNegative);
            Console.ReadLine();
        }
    }
}

using System;

namespace Partition
{
    class Program
    {
        static void Main(string[] args)
        {
            int length = int.Parse(Console.ReadLine());
            string[] input = Console.ReadLine().Split(' ');

            int partPositive = 0;
            int partNegative = 0;

            foreach (var item in input)
            {

                if (int.Parse(item) >=0)
                {
                    partPositive += int.Parse(item);
                }
                else
                {
                    partNegative += int.Parse(item);
                }
            }
            Console.WriteLine(partPositive - partNegative);
            Console.ReadLine();
        }
    }
}

using System;
using System.Linq;

namespace AlgoTasks
{
    class Program
    {
        static void Main(string[] args)
        {
            //10 5
            //2  | 7  | 3 | 9  | 8 | 7 | 9  | 7 | 1 | 9
            //buy|sell|buy|sell|   |buy|sell|   |buy|sell
            //Таким образом, суммарная прибыль(9 - 2) + (9 - 1) = 15.
            //int[] nk = Console.ReadLine().Split().Select(s => int.Parse(s)).ToArray();
            //int[] nk = new int[] { 10, 5 };

            //long[] p = new long[nk[0]];
            //long[] p = new long[] { 2 , 7 , 3 , 9 , 8 , 7 , 9 , 7 , 1 , 9 };
            /*for (int i = 0; i < nk[0]; i++)
            {
                p[i] = long.Parse(Console.ReadLine());
            }*/

            //long[] arrIdx1 = Array.ConvertAll(Enumerable.Range(0, nk[0]).ToArray(), a => (long)a);
            //long[] arrIdx2 = (long[])arrIdx1.Clone();

            //long[] arrAsc = (long[])p.Clone();
            //long[] arrDesc = (long[])p.Clone();

            //Array.Sort(arrAsc, arrIdx1);
            //Array.Sort(arrDesc, arrIdx2);
            //arrDesc = arrDesc.Reverse().ToArray();
            //arrIdx2 = arrIdx2.Reverse().ToArray();

            /*for (int i = 0; i < nk[0]; i++)
            {
                Console.Write(arrAsc[i] + " ");
            }

            Console.WriteLine();
            for (int i = 0; i < nk[0]; i++)
            {
                Console.Write(arrIdx1[i] + " ");
            }*/

            int n = int.Parse(Console.ReadLine());

            int[] a = Console.ReadLine().Split().Select(s => int.Parse(s)).ToArray();

            Array.Sort(a, (x, y) => y.CompareTo(x));

            Console.WriteLine(a.Where(i => i > 0).Sum() - a.Where(i => i < 0).Sum());
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace trololololol
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.ReadLine();
            string[] y = Console.ReadLine().Split(' ');
            int max = 0, min = 0;
            for (int i = 0; i < y.Length; i++)
            {
                if (int.Parse(y[i]) > 0)
                {
                    max = max + int.Parse(y[i]);
                }
                else if (int.Parse(y[i]) < 0)
                {
                    min = min + int.Parse(y[i]);
                }
            }
            Console.WriteLine(max - min);
                //Console.ReadKey();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Numerics;

namespace CodeForces
{
    class Program
    {

        static void Main(string[] args)
        {
            int number = int.Parse(Console.ReadLine());
            string [] numbers = Console.ReadLine().Split(' ');
            int B_group=0;
            int C_group=0;

            for (int i = 0; i < numbers.Length; i++)
            {
                if (int.Parse(numbers[i]) >= 0)
                    B_group+=int.Parse(numbers[i]);
                else
                    C_group+=int.Parse(numbers[i]);
            }
            int result = B_group - C_group;
            Console.WriteLine(result);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Threading;
using System.Runtime.CompilerServices;
using System.Text;
using System.Diagnostics;
using System.Numerics;
using static System.Console;
using static System.Convert;
using static System.Math;
using static Template;
using Pi = Pair<int, int>;

class Solver
{
    public Scanner sc;
    public void Solve()
    {
        var N = sc.Int;
        var A = sc.ArrInt;
        Array.Sort(A);
        var res = 0;
        for(int k = 0; k <= N; k++)
        {
            chmax(ref res, A.Skip(k).Sum() - A.Take(k).Sum());
        }
        Console.WriteLine(res);
    }
}

#region Template
public static class Template
{
    static void Main(string[] args)
    {
        Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
        var sol = new Solver() { sc = new Scanner() };
        //var th = new Thread(sol.Solve, 1 << 26);th.Start();th.Join();
        sol.Solve();
        Console.Out.Flush();
    }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static bool chmin<T>(ref T a, T b) where T : IComparable<T> { if (a.CompareTo(b) > 0) { a = b; return true; } return false; }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static bool chmax<T>(ref T a, T b) where T : IComparable<T> { if (a.CompareTo(b) < 0) { a = b; return true; } return false; }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static void swap<T>(ref T a, ref T b) { var t = b; b = a; a = t; }
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public static void swap<T>(this IList<T> A, int i, int j) { var t = A[i]; A[i] = A[j]; A[j] = t; }
    public static T[] Create<T>(int n, Func<T> f) { var rt = new T[n]; for (var i = 0; i < rt.Length; ++i) rt[i] = f(); return rt; }
    public static T[] Create<T>(int n, Func<int, T> f) { var rt = new T[n]; for (var i = 0; i < rt.Length; ++i) rt[i] = f(i); return rt; }
    public static IEnumerable<T> Shuffle<T>(this IEnumerable<T> A) => A.OrderBy(v => Guid.NewGuid());
    public static int CompareTo<T>(this T[] A, T[] B, Comparison<T> cmp = null) { cmp = cmp ?? Comparer<T>.Default.Compare; for (var i = 0; i < Min(A.Length, B.Length); i++) { int c = cmp(A[i], B[i]); if (c > 0) return 1; else if (c < 0) return -1; } if (A.Length == B.Length) return 0; if (A.Length > B.Length) return 1; else return -1; }
    public static int MaxElement<T>(this IList<T> A, Comparison<T> cmp = null) { cmp = cmp ?? Comparer<T>.Default.Compare; T max = A[0]; int rt = 0; for (int i = 1; i < A.Count; i++) if (cmp(max, A[i]) < 0) { max = A[i]; rt = i; } return rt; }
    public static T PopBack<T>(this List<T> A) { var v = A[A.Count - 1]; A.RemoveAt(A.Count - 1); return v; }
    public static void Fail<T>(T s) { Console.WriteLine(s); Console.Out.Close(); Environment.Exit(0); }
}
public class Scanner
{
    public string Str => Console.ReadLine().Trim();
    public int Int => int.Parse(Str);
    public long Long => long.Parse(Str);
    public double Double => double.Parse(Str);
    public int[] ArrInt => Str.Split(' ').Select(int.Parse).ToArray();
    public long[] ArrLong => Str.Split(' ').Select(long.Parse).ToArray();
    public char[][] Grid(int n) => Create(n, () => Str.ToCharArray());
    public int[] ArrInt1D(int n) => Create(n, () => Int);
    public long[] ArrLong1D(int n) => Create(n, () => Long);
    public int[][] ArrInt2D(int n) => Create(n, () => ArrInt);
    public long[][] ArrLong2D(int n) => Create(n, () => ArrLong);
    private Queue<string> q = new Queue<string>();
    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public T Next<T>() { if (q.Count == 0) foreach (var item in Str.Split(' ')) q.Enqueue(item); return (T)Convert.ChangeType(q.Dequeue(), typeof(T)); }
    public void Make<T1>(out T1 v1) => v1 = Next<T1>();
    public void Make<T1, T2>(out T1 v1, out T2 v2) { v1 = Next<T1>(); v2 = Next<T2>(); }
    public void Make<T1, T2, T3>(out T1 v1, out T2 v2, out T3 v3) { Make(out v1, out v2); v3 = Next<T3>(); }
    public void Make<T1, T2, T3, T4>(out T1 v1, out T2 v2, out T3 v3, out T4 v4) { Make(out v1, out v2, out v3); v4 = Next<T4>(); }
    public void Make<T1, T2, T3, T4, T5>(out T1 v1, out T2 v2, out T3 v3, out T4 v4, out T5 v5) { Make(out v1, out v2, out v3, out v4); v5 = Next<T5>(); }
    public void Make<T1, T2, T3, T4, T5, T6>(out T1 v1, out T2 v2, out T3 v3, out T4 v4, out T5 v5, out T6 v6) { Make(out v1, out v2, out v3, out v4, out v5); v6 = Next<T6>(); }
    public void Make<T1, T2, T3, T4, T5, T6, T7>(out T1 v1, out T2 v2, out T3 v3, out T4 v4, out T5 v5, out T6 v6, out T7 v7) { Make(out v1, out v2, out v3, out v4, out v5, out v6); v7 = Next<T7>(); }
    //public (T1, T2) Make<T1, T2>() { Make(out T1 v1, out T2 v2); return (v1, v2); }
    //public (T1, T2, T3) Make<T1, T2, T3>() { Make(out T1 v1, out T2 v2, out T3 v3); return (v1, v2, v3); }
    //public (T1, T2, T3, T4) Make<T1, T2, T3, T4>() { Make(out T1 v1, out T2 v2, out T3 v3, out T4 v4); return (v1, v2, v3, v4); }
}
public class Pair<T1, T2> : IComparable<Pair<T1, T2>>
{
    public T1 v1;
    public T2 v2;
    public Pair() { }
    public Pair(T1 v1, T2 v2)
    { this.v1 = v1; this.v2 = v2; }

    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public int CompareTo(Pair<T1, T2> p)
    {
        var c = Comparer<T1>.Default.Compare(v1, p.v1);
        if (c == 0)
            c = Comparer<T2>.Default.Compare(v2, p.v2);
        return c;
    }
    public override string ToString() => $"{v1.ToString()} {v2.ToString()}";
    public void Deconstruct(out T1 a, out T2 b) { a = v1; b = v2; }
}

public class Pair<T1, T2, T3> : Pair<T1, T2>, IComparable<Pair<T1, T2, T3>>
{
    public T3 v3;
    public Pair() : base() { }
    public Pair(T1 v1, T2 v2, T3 v3) : base(v1, v2)
    { this.v3 = v3; }

    [MethodImpl(MethodImplOptions.AggressiveInlining)]
    public int CompareTo(Pair<T1, T2, T3> p)
    {
        var c = base.CompareTo(p);
        if (c == 0)
            c = Comparer<T3>.Default.Compare(v3, p.v3);
        return c;
    }
    public override string ToString() => $"{base.ToString()} {v3.ToString()}";
    public void Deconstruct(out T1 a, out T2 b, out T3 c) { Deconstruct(out a, out b); c = v3; }
}
#endregion

using System;
using System.Collections.Generic;
using System.Linq;

namespace Introduction
{

    class Program
    {
        static Reader reader = new Reader();
        static void Main(string[] args)
        {
            int number1 = reader.NextInt();
            int sum1 = 0, sum2 = 0;
            for (int i = 0; i < number1;i++)
            {
                int a = reader.NextInt();
                if (a > 0)
                    sum1 += a;
                else
                    sum2 += a;
            }
            Console.Write(sum1-sum2);
        }
    }

    #region Reader Class
    internal class Reader
    {
        int s_index = 0;
        List<string> s_tokens;

        public string Next()
        {
            while (s_tokens == null || s_index == s_tokens.Count)
            {
                s_tokens = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).ToList();
                s_index = 0;
            }
            return s_tokens[s_index++];
        }

        public int NextInt()
        {
            String s = Next();

            return int.Parse(s);
        }

        public long NextLong()
        {
            String s = Next();

            return long.Parse(s);
        }

        public bool HasNext()
        {
            while (s_tokens == null || s_index == s_tokens.Count)
            {
                s_tokens = null;
                s_index = 0;
                var nextLine = Console.ReadLine();
                if (nextLine != null)
                {
                    s_tokens = nextLine.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).ToList();
                    if (s_tokens.Count == 0)
                    {
                        continue;
                    }
                }
                return false;
            }
            return false;
        }
    }
    #endregion
}

using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace Code
{
    public class Program
    {

        static string Read()
        {
            var a = Convert.ToChar(Console.Read());
            var t = new StringBuilder();

            while (a != ' ' && a != '\r' && a != '\n')
            {
                t.Append(a);
                a = Convert.ToChar(Console.Read());
            }
            return t.ToString();
        }

        static int ReadNum()
        {
            return int.Parse(Read());
        }

        static ulong ReadUNum()
        {
            return ulong.Parse(Read());
        }

        public static void Main()
        {
            var n = ReadNum(); Console.ReadLine();
            var sum = 0;

            for (int i = 0; i<n; i++)
            {
                sum += Math.Abs(ReadNum());
            }

            Console.WriteLine(sum);
        }
    }
}

using System;
using System.IO;
using System.Linq;
using System.Text;

namespace Partition
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            writer.WriteLine(Solve(args));
            writer.Flush();
        }

        private static int Solve(string[] args)
        {
            int n = Next();

            var nn = new int[n];
            for (int i = 0; i < n; i++)
            {
                nn[i] = Next();
            }

            return nn.Sum();
        }

        private static int Next()
        {
            int c;
            int res = 0;
            do
            {
                c = reader.Read();
                if (c == -1)
                    return res;
            } while (c < '0' || c > '9');
            res = c - '0';
            while (true)
            {
                c = reader.Read();
                if (c < '0' || c > '9')
                    return res;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;

namespace CodeforcesTemplate
{
    public static class Permutation
    {
        private static bool Next(ref int[] arr)
        {
            int k, j, l;
            for (j = arr.Length - 2; (j >= 0) && (arr[j] >= arr[j + 1]); j--) { }
            if (j == -1)
            {
                arr = arr.OrderBy(c => c).ToArray();
                return false;
            }
            for (l = arr.Length - 1; (arr[j] >= arr[l]) && (l >= 0); l--) { }
            var tmp = arr[j];
            arr[j] = arr[l];
            arr[l] = tmp;
            for (k = j + 1, l = arr.Length - 1; k < l; k++, l--)
            {
                tmp = arr[k];
                arr[k] = arr[l];
                arr[l] = tmp;
            }
            return true;
        }
        public static IEnumerable<int[]> AllPermutations(int[] arr)
        {
            do yield return arr;
            while (Next(ref arr));
        }
    }

    class Program
    {
        private const string FILENAME = "distance4";

        private const string INPUT = FILENAME + ".in";

        private const string OUTPUT = FILENAME + ".out";

        private static Stopwatch _stopwatch = new Stopwatch();

        private static StreamReader _reader = null;
        private static StreamWriter _writer = null;

        private static string[] _curLine;
        private static int _curTokenIdx;

        private static char[] _whiteSpaces = new char[] { ' ', '\t', '\r', '\n' };

        public static string Check(string s)
        {
            string letters = "aeiouy";

            while (true)
            {
                bool used = false;

                for (int i = 0; i < s.Length - 1; i++)
                {
                    if (letters.Contains(s[i].ToString()) && letters.Contains(s[i + 1].ToString()))
                    {
                        s = s.Remove(i + 1, 1);

                        used = true;
                    }
                }

                if (!used)
                {
                    return s;
                }
            }
        }

        private static string ReadNextToken()
        {
            if (_curTokenIdx >= _curLine.Length)
            {
                //Read next line
                string line = _reader.ReadLine();
                if (line != null)
                    _curLine = line.Split(_whiteSpaces, StringSplitOptions.RemoveEmptyEntries);
                else
                    _curLine = new string[] { };
                _curTokenIdx = 0;
            }

            if (_curTokenIdx >= _curLine.Length)
                return null;

            return _curLine[_curTokenIdx++];
        }

        private static int ReadNextInt()
        {
            return int.Parse(ReadNextToken());
        }

        private static void RunTimer()
        {
#if (DEBUG)

            _stopwatch.Start();

#endif
        }

        private static void Main(string[] args)
        {

#if (DEBUG)
            double before = GC.GetTotalMemory(false);
#endif

            int n = int.Parse(Console.ReadLine());

            int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();

            int ans = 0;

            for (int i = 0; i < n; i++)
            {
                ans += Math.Abs(a[i]);
            }

            Console.WriteLine(ans);

#if (DEBUG)
            _stopwatch.Stop();

            double after = GC.GetTotalMemory(false);

            double consumedInMegabytes = (after - before) / (1024 * 1024);

            Console.WriteLine($"Time elapsed: {_stopwatch.Elapsed}");

            Console.WriteLine($"Consumed memory (MB): {consumedInMegabytes}");

            Console.ReadKey();
#endif

        }

        private static int CountLeadZeros(string source)
        {
            int countZero = 0;

            for (int i = source.Length - 1; i >= 0; i--)
            {
                if (source[i] == '0')
                {
                    countZero++;
                }

                else
                {
                    break;
                }

            }

            return countZero;
        }

        private static string ReverseString(string source)
        {
            char[] reverseArray = source.ToCharArray();

            Array.Reverse(reverseArray);

            string reversedString = new string(reverseArray);

            return reversedString;
        }

        private static int[] CopyOfRange(int[] src, int start, int end)
        {
            int len = end - start;
            int[] dest = new int[len];
            Array.Copy(src, start, dest, 0, len);
            return dest;
        }

        private static string StreamReader()
        {

            if (_reader == null)
                _reader = new StreamReader(INPUT);
            string response = _reader.ReadLine();
            if (_reader.EndOfStream)
                _reader.Close();
            return response;

        }

        private static void StreamWriter(string text)
        {

            if (_writer == null)
                _writer = new StreamWriter(OUTPUT);
            _writer.WriteLine(text);

        }

        private static int BFS(int start, int end, int[,] arr)
        {
            Queue<KeyValuePair<int, int>> queue = new Queue<KeyValuePair<int, int>>();
            List<bool> visited = new List<bool>();
            for (int i = 0; i < arr.GetLength(0); i++)
            {
                visited.Add(false);
            }

            queue.Enqueue(new KeyValuePair<int, int>(start, 0));
            KeyValuePair<int, int> node;
            int level = 0;
            bool flag = false;

            while (queue.Count != 0)
            {
                node = queue.Dequeue();
                if (node.Key == end)
                {
                    return node.Value;
                }
                flag = false;
                for (int i = 0; i < arr.GetLength(0); i++)
                {

                    if (arr[node.Key, i] == 1)
                    {
                        if (visited[i] == false)
                        {
                            if (!flag)
                            {
                                level = node.Value + 1;
                                flag = true;
                            }
                            queue.Enqueue(new KeyValuePair<int, int>(i, level));
                            visited[i] = true;
                        }
                    }
                }

            }
            return 0;

        }

        private static void Write(string source)
        {
            File.WriteAllText(OUTPUT, source);
        }

        private static string ReadString()
        {
            return File.ReadAllText(INPUT);
        }

        private static void WriteStringArray(string[] source)
        {
            File.WriteAllLines(OUTPUT, source);
        }

        private static string[] ReadStringArray()
        {
            return File.ReadAllLines(INPUT);
        }

        private static int[] GetIntArray()
        {
            return ReadString().Split(' ').Select(int.Parse).ToArray();
        }

        private static double[] GetDoubleArray()
        {
            return ReadString().Split(' ').Select(double.Parse).ToArray();
        }

        private static int[,] ReadINT2XArray(List<string> lines)
        {
            int[,] arr = new int[lines.Count, lines.Count];

            for (int i = 0; i < lines.Count; i++)
            {
                int[] row = lines[i].Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();

                for (int j = 0; j < lines.Count; j++)
                {
                    arr[i, j] = row[j];
                }
            }

            return arr;
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Collections;

namespace ConsoleApplication34
{
    class Program
    {
        static void Main(string[] args)
        {
            int c = 0, h = 1, f = 2, u = 0,k=0;
            int x = int.Parse(Console.ReadLine());

            string[] s = Console.ReadLine().Split();
            int[] a = new int[s.Length];
            for (int i = 0; i < s.Length; i++)
            {
                if (int.Parse(s[i])<0)
                {
                    c += Math.Abs(int.Parse(s[i]) * -1);
                }
                else
                {
                    c += Math.Abs(int.Parse(s[i]) * -1);
                }

            }
            Console.WriteLine(c);

            //string s = Console.ReadLine() ;
            //char[] b = new char [s.Length];

            //for (int i = 0; i < s.Length; i++)
            //{
            //    if (s[i]=='_')
            //    {
            //        b[i] =' ';
            //    }
            //    else
            //    {
            //        b[i] = s[i];
            //    }
            //}
            //string[] a =s.Split();
            //for (int i = 0; i < a.Length; i++)
            //{
            //    if (a[i]=="[Beiju]")
            //    {
            //        a[i] = "*";
            //    }
            //}

            //Stack s = new Stack();
            //while (true)
            //{
            //    int x = int.Parse(Console.ReadLine());
            //    int[] a = new int[100];
            //    int[] b = new int[100];
            //    if (x == 0) break;
            //    while (true)
            //    {
            //        string[] arr = Console.ReadLine().Split();
            //        if (arr[0] == "0") break;
            //        for (int i = 0; i < arr.Length; i++)
            //        {
            //            a[i] = i + 1;
            //            b[i] = Convert.ToInt16(arr[i]);
            //        }
            //        for (int i = 0; i < arr.Length; i++)
            //        {
            //            s.Push(a[i]);
            //            c++;
            //            u = i;
            //            if (b[h] == a[i])
            //            {
            //                while (u != 0)
            //                {
            //                    if (b[h] == a[u])
            //                    {
            //                        s.Pop();
            //                        u--;
            //                        c--;
            //                        h++;
            //                    }
            //                    else
            //                    {
            //                        Console.WriteLine("NO");
            //                        f = 5;
            //                        break;
            //                    }
            //                }
            //            }
            //        }
            //        if (f != 5)
            //        {
            //            Console.WriteLine("YES");
            //        }
            //        c = 0;
            //        h = 0;
            //        u = 0;
            //        f = 0;
            //    }

            //}
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Codeforces
{
   class A
   {
     static void Main(string[] args)
     {
        int n  = int.Parse(Console.ReadLine());

        int[] a = new int[n];

        string[] token = Console.ReadLine().Split();

        for(int i=0;i<n;i++){
          a[i] = int.Parse(token[i]);
        }

        Array.Sort(a);

        int pos = 0;
        int neg = 0;

        for(int i=n-1;i>=0;i--){
          if(a[i]>=0){
            pos += a[i];
          }else{
            neg += a[i];
          }
        }

        Console.WriteLine(pos-neg);
     }

   }
}

using System;
using System.Linq;

namespace PartiotionCF
{
    class Program
    {
        static void Main(string[] args)
        {
            int elementsCountInPartition = GetElementsCountInPartition();
            int[] elementsInPartition = GetElementsInPartition();

            int firstPartitionSum = elementsInPartition.Where(s => s > 0).Sum();
            int secondPartitionSum = elementsInPartition.Where(s => s < 0).Sum();

            Console.WriteLine(firstPartitionSum - secondPartitionSum);
        }

        static int GetElementsCountInPartition()
        {
            var firstLine = Console.ReadLine();
            return int.Parse(firstLine);
        }

        static int[] GetElementsInPartition()
        {
            var secondLine = Console.ReadLine();
            return secondLine?.Split(' ').Select(int.Parse).ToArray();
        }
    }
}

using System;
using System.CodeDom;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.InteropServices;
using System.Xml.Serialization;

class Program
{

    static void Main(string[] args)
    {
        var n = int.Parse(Console.ReadLine());
        var a = Console.ReadLine().Split(' ').Select(long.Parse).ToList();

        var ans = a.Where(x => x > 0).Sum() - a.Where(x => x < 0).Sum();

        Console.WriteLine(ans);
    }
}

using System;
using System.Linq;

namespace A
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int count = 0;
            for (int i = 0; i < n; i++)
            {
                if (input[i] >= 0)
                    count += input[i];
                else
                    count -= input[i];
            }

            Console.WriteLine($"{count}");
            Console.ReadLine();
        }
    }
}

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;

namespace Contest
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Convert.ToInt32(Console.ReadLine());
            var a = Array.ConvertAll(Console.ReadLine().Split(), Convert.ToInt32);
            List<int> b = new List<int>();
            List<int> c = new List<int>();
            for (int i = 0; i < n; i++)
                if (a[i] >= 0) b.Add(a[i]);
                else c.Add(a[i]);
            Console.WriteLine(b.Sum() - c.Sum());
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HelloWorld
{
    class Program
    {

        static void Main(string[] args)
        {
            int s = 0;
            int n = Convert.ToInt32(Console.ReadLine());
            string line1 = Console.ReadLine();
            string[] arr1 = line1.Split(' ');

            int[] f1 = arr1.Select(ch => int.Parse(ch.ToString())).ToArray();

            foreach (int el in f1)
            {
                s += Math.Abs(el);
            }

            Console.WriteLine(s);

        }
    }
}

using System;
class Program
{
    static void Main(string[] args)
    {
        int n = int.Parse(Console.ReadLine());
        int[] arg = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
        int sum = 0;
        foreach (int i in arg)
            sum += Math.Abs(i);
        Console.WriteLine(sum);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _14._03._2018
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int B = 0;
            int C = 0;
            int MaxIntersection = 0;
            string[] temp = Console.ReadLine().Split();
            int tmp = 0;
            for (int i = 0; i<n; i++)
            {
                tmp = short.Parse(temp[i]);
                if (tmp > 0)
                    B += tmp;
                else
                    C += tmp;
            }
            MaxIntersection = B-C;

            Console.WriteLine(MaxIntersection);
        }
    }
}

using System;
using System.Linq;

class Program
{
    static void Main()
    {
        Console.ReadLine();
        var a = Console.ReadLine().Split().Select(s => int.Parse(s));
        int b = 0;
        int c = 0;

        foreach (var i in a)
        {
            if (i > 0)
                b += i;
            else
                c += i;
        }

        Console.WriteLine(b - c);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static int n;
        static int[] a;
        static void Main(string[] args)
        {
            GetData();
            int sum  = 0;
            foreach (var cand in a)
            {
                sum += Math.Abs(cand);
            }
            Console.WriteLine(sum);
        }
        static void GetData()
        {
            var str = Console.ReadLine().Split();
            n = int.Parse(str[0]);
            a = new int[n];
            str = Console.ReadLine().Split();
            for (int i = 0; i < n; i++)
            {
                a[i] = int.Parse(str[i]);
            }
        }
    }
}

//ReSharper disable All
using System;

namespace ConsoleApp1
{
    using System.Collections.Generic;
    using System.Linq;

    class Program
    {
        public static void Main(string[] args)
        {
            int  n= int.Parse(Console.ReadLine());
            int[] a = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

            var l = new List<int>();
            var l1 = new List<int>();
            for (int i = 0; i < a.Length; i++)
            {
                if(a[i] < 0)
                    l.Add(a[i]);
                else
                {
                    l1.Add(a[i]);
                }
            }

            int max = l1.Sum() - l.Sum();
            Console.WriteLine(max);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace A.Partition
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            string[] arr = Console.ReadLine().Split();
            List<int> pos = new List<int>();
            List<int> neg = new List<int>();
            for (int i = 0; i < n; i++)
            {
                if (arr[i][0] == '-')
                {
                    neg.Add(int.Parse(arr[i]));
                }
                else
                {
                    pos.Add(int.Parse(arr[i]));
                }
            }
            Console.WriteLine(pos.Sum() - neg.Sum());
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Partition
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = Int32.Parse(Console.ReadLine());
            string[] s = Console.ReadLine().Split(' ');
            int[] a = new int[n];
            List<int> A = new List<int>();
            List<int> B = new List<int>();
            for (int i = 0; i < n; i++)
            {
                a[i] = Int32.Parse(s[i]);
                if (a[i] >= 0)
                    A.Add(a[i]);
                else
                    B.Add(a[i]);
            }
            A.Add(0);
            B.Add(0);
            Console.WriteLine(A.Sum() - B.Sum());
            Console.ReadLine();
        }
    }
}

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

namespace CF
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            using (var sr = new InputReader(Console.In))
//       using (var sr = new InputReader(new StreamReader("input.txt")))
            using (var sw = Console.Out)
                //using (var sw = new StreamWriter("output.txt"))
            using (var task = new Task(sr, sw)) {
                task.Solve();
//                Console.ReadKey();
            }
        }
    }

    internal class Task : IDisposable
    {
        private readonly InputReader sr;
        private readonly TextWriter sw;
        private bool isDispose;

        public Task(InputReader sr, TextWriter sw)
        {
            this.sr = sr;
            this.sw = sw;
        }

        public void Solve()
        {
            var n = sr.NextInt32();
            var items = sr.ReadArrayOfInt32();
            var minus = items.Where(i => i < 0).ToArray();
            var plus = items.Where(i => i > 0);
            var sumMinus = minus.Sum();
            var sumPlus = plus.Sum();
            sw.WriteLine(sumPlus - sumMinus);
        }

        ~Task()
        {
            Dispose(false);
        }

        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

        private void Dispose(bool disposing)
        {
            if (!isDispose) {
                if (disposing) {
                    if(sr != null)
                        sr.Dispose();

                    if(sw != null)
                        sw.Dispose();
                }

                isDispose = true;
            }
        }
    }
}

internal class InputReader : IDisposable
{
    private bool isDispose;
    private readonly TextReader sr;
    private string[] buffer;
    private int seek;

    public InputReader(TextReader stream)
    {
        sr = stream;
    }

    public void Dispose()
    {
        Dispose(true);
        GC.SuppressFinalize(this);
    }

    public string NextString()
    {
        var result = sr.ReadLine();
        return result;
    }

    public int NextInt32()
    {
        return Int32.Parse(ReadNextToken());
    }

    private string ReadNextToken()
    {
        if (buffer == null || seek == buffer.Length) {
            seek = 0;
            buffer = NextSplitStrings();
        }

        return buffer[seek++];
    }

    public long NextInt64()
    {
        return Int64.Parse(ReadNextToken());
    }

    public int[] ReadArrayOfInt32()
    {
        return ReadArray(Int32.Parse);
    }

    public long[] ReadArrayOfInt64()
    {
        return ReadArray(Int64.Parse);
    }

    public string[] NextSplitStrings()
    {
        return NextString()
            .Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public T[] ReadArray<T>(Func<string, CultureInfo, T> func)
    {
        return NextSplitStrings()
            .Select(s => func(s, CultureInfo.InvariantCulture))
            .ToArray();
    }

    public T[] ReadArrayFromString<T>(Func<string, CultureInfo, T> func, string str)
    {
        return
            str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
                .Select(s => func(s, CultureInfo.InvariantCulture))
                .ToArray();
    }

    protected void Dispose(bool dispose)
    {
        if (!isDispose)
        {
            if (dispose)
                sr.Close();

            isDispose = true;
        }
    }

    ~InputReader()
    {
        Dispose(false);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int sum1, sum2;
            string[] mas=Console.ReadLine().Split(' ');
            sum1 = 0; sum2 = 0;
            int ad=0;
            for(int i=0;i<n;i++)
            {
                ad=int.Parse(mas[i]);
                if(ad<0)
                {
                    sum2 = sum2 + ad;
                }
                else if(ad>0)
                {
                    sum1 = sum1 + ad;
                }
            }
            Console.WriteLine((sum1 - sum2).ToString());

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] a = new int[n];
            var split = Console.ReadLine().Split();
            for (int i = 0; i < n; i++)
            {
                a[i] = int.Parse(split[i]);
            }
            int sum = 0;

            for (int i = 0; i < a.Length; i++)
            {
                if (a[i] >= 0)
                {
                    sum = sum + a[i];
                }
                else
                {
                    sum = sum - a[i];
                }

            }
            Console.WriteLine(sum);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Problem946A
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.ReadLine();
            int[] vals = Console.ReadLine().Split(' ').Select(_ => int.Parse(_)).ToArray();
            int zero = vals.Where(_ => _ == 0).Count();
            int pos = vals.Where(_ => _ > 0).Count();
            int neg = vals.Where(_ => _ < 0).Count();

            Console.WriteLine(vals.Where(_ => _ > 0).Sum() - vals.Where(_ => _ < 0).Sum());
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ProblemA
{
	public class Problem
	{
		int a;
		int[] s;

		public int[] ReadLine()
		{
			return Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
		}

		public Problem()
		{
			a = ReadLine()[0];
			s = ReadLine();
		}

		public void Solve()
		{
			var b = s.Where(x => x >= 0).Sum();
			var c = s.Where(x => x < 0).Sum();
			Console.WriteLine(b - c);
		}
	}

	class ProblemA
	{
		static void Main(string[] args)
		{
			new Problem().Solve();
		}
	}
}

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

namespace Compete.CFE39 {
    public class TaskA  {
        public static void Main(string[] args) {
            new TaskA().Solve(Console.In, Console.Out);
        }

        public void Solve(TextReader input, TextWriter output) {
            // INPUT
            var n = int.Parse(input.ReadLine());
            var a = input.ReadLine().Split(' ').Select(int.Parse).ToList();

            // SOLUTION
            var positive = a.Where(x => x > 0);
            var negative = a.Where(x => x < 0);
            var rv = positive.Sum() - negative.Sum();

            // OUTPUT
            output.WriteLine(rv);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.ReadLine();
            Console.WriteLine(Console.ReadLine().Split().Select(x => Math.Abs(int.Parse(x))).Sum());
        }
    }
}

using System;
class MaxDiffSeq{
    static int findMaxDiff(int[] ar, int n){
        Array.Sort(ar);
        int[] sum = new int[n];
        sum[0] = ar[0];
        for(int i=1;i<n;i++){
            sum[i] = ar[i] + sum[i-1];
        }
        int maxdiff = sum[n-1];
        for(int i=n-1;i>=0;i--){
            maxdiff = Math.Max(sum[n-1] - 2*sum[i], maxdiff);
        }
        return maxdiff;
    }
    static void Main(string[] args){
        int n = Convert.ToInt32(Console.ReadLine().Trim());
        string[] str = Console.ReadLine().Trim().Split(' ');
        int[] ar = Array.ConvertAll(str, Int32.Parse);
        Console.WriteLine(findMaxDiff(ar, n));
    }
}

using System;
using System.Linq;

namespace CodeForce
{
    class Program
    {
        static void Main(string[] args)
        {
            var count = Console.ReadLine();
            var numbers = Console.ReadLine();
            int result = 0;
            numbers.Split(' ').ToList().ForEach(num =>
            {
                var toNum = Convert.ToInt32(num);
                if (toNum < 0) toNum = -toNum;
                result += toNum;
            });
            Console.Write(result);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.ReadLine();
            int sum = Console.ReadLine().Split(' ').Sum(x => Math.Abs(Convert.ToInt32(x)));
            Console.WriteLine(sum);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.ReadLine();
            var a = Console.ReadLine().Split(' ');
            int sum = a.Sum(x => Math.Abs(Convert.ToInt32(x)));
            Console.WriteLine(sum);
            //Console.ReadKey();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.ExceptionServices;
using System.Runtime.InteropServices;
using System.Text;

namespace ConsoleApp8
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(Solve());
        }

        static int Solve()
        {
            int n = int.Parse(Console.ReadLine());
            var nab = Console.ReadLine().Split().Select(int.Parse).ToArray();

            int Bseq = 0, Cseq = 0;
            for (int i = 0; i < n; i++)
            {
                if (nab[i] >= 0) Bseq += nab[i];
                else Cseq += nab[i];
            }

            return Math.Abs(Bseq - Cseq);
        }
    }
}

using System;

namespace CFSharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int p = 0, o = 0;
            int n = int.Parse(Console.ReadLine());
            string[] astr = Console.ReadLine().Split(' ');
            for(int i = 0; i < n; i++)
            {
                int t = int.Parse(astr[i]);
                if (t > 0) p += t; else o += t;
            }
            Console.Write(p - o);
        }
    }
}

using System;
using System.Linq;
using System.Collections.Generic;
using System.Numerics;

class Program
{
    public static void Main(string[] args)
    {
        //MulticaseTest();
        //int[] input = Console.ReadLine().Split().Select(int.Parse).ToArray();
        int n = int.Parse(Console.ReadLine());
        int[] input = Console.ReadLine().Split().Select(int.Parse).ToArray();
        if (input.All(x => x >= 0)) Console.WriteLine(input.Sum());
        else
        {
            int C = input.Min();
            List<int> vals = input.ToList();
            vals.Remove(C);
            int val = vals.Sum() + Math.Abs(C);
            Console.WriteLine(val);
        }
    }

    public static void MulticaseTest()
    {
        //4
        //4 5 2 3
        int t = int.Parse(Console.ReadLine());
        List<string> o = new List<string>(t);
        for (int i = 0; i < t; i++)
        {
            int n = int.Parse(Console.ReadLine());

        }
        o.ForEach(Console.WriteLine);
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace trololololol
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] y = Console.ReadLine().Split(' ');
            int max = 0, min = 0;
            for (int i = 0; i < y.Length; i++)
            {
                if (int.Parse(y[i]) > 0)
                {
                    max = max + int.Parse(y[i]);
                }
                else if (int.Parse(y[i]) < 0)
                {
                    min = min + int.Parse(y[i]);
                }
            }
            Console.WriteLine(max - min);
                //Console.ReadKey();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _14._03._2018
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            short[] mas = new short[n];
            int B = 0;
            int C = 0;
            int MaxIntersection = 0;
            string[] temp = Console.ReadLine().Split();

            for (int i = 0; i<n; i++)
            {
                mas[i] = short.Parse(temp[i]);
                B += mas[i];
            }
            MaxIntersection = B;
            for (int i = n-1; i>=0; i--)
            {
                B -= mas[i];
                C += mas[i];
                if (B - C > MaxIntersection)
                    MaxIntersection = B - C;
            }
            Console.WriteLine(MaxIntersection);
        }
    }
}