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

namespace A
{
    class Program
    {
        public IEnumerable<string> Solve()
        {
            var ut = new Util();
            var sc = new Scanner();

            var n = sc.Num;
            var a = sc.Nums(n).Select(x => (long)x).ToArray();

            var s = a.Sum();
            var s2 = 0L;
            for (int i = 1; i < n; i += 2)
            {
                s2 += a[i] * 2;
            }

            var res = new List<long>();

            res.Add(s - s2);
            for (int i = 0; i < n - 1; i++)
            {
                res.Add(a[i] * 2 - res[i]);
            }

            var sb = new StringBuilder();
            foreach (var x in res)
            {
                sb.Append(x);
                sb.Append(" ");
            }

            yield return sb.ToString();
        }
    }

    class StartingPoint
    {
        static void Main(string[] args)
        {
            if (args?.Any() == true)
            {
                var assembly = Assembly.GetEntryAssembly();
                var resourceName = "AtCoderCSharp.In.txt";
                var stream = assembly.GetManifestResourceStream(resourceName);
                var streamReader = new StreamReader(stream, Encoding.UTF8);
                var str = streamReader.ReadToEnd();
                var textReader = new StringReader(str);
                Console.SetIn(textReader);
            }

            try
            {
                foreach (var s in new Program().Solve())
                {
                    Console.WriteLine(s);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                if (args?.Any() != true)
                    throw e;
            }

            if (args?.Any() == true)
                Console.ReadKey();
        }
    }

    class Scanner
    {
        public int[] Nums(int count) => Enumerable.Range(0, count).Select(_ => Num).ToArray();
        public int Num => int.Parse(Str);
        public long NumLong => long.Parse(Str);
        public double NumDouble => (double)NumLong;

        StringBuilder sb = new StringBuilder();

        public string Str => GetStr();
        public string GetStr()
        {
            sb.Clear();

            int r = 0;
            bool? b = null;
            do
            {
                r = Console.Read();
                b = IsBreak(r);
            } while (b == true);

            if (b == null)
                throw new Exception("input error: unexpected end of stream");

            do
            {
                sb.Append((char)r);
                r = Console.Read();
                b = IsBreak(r);
            } while (b == false);

            return sb.ToString();
        }

        bool? IsBreak(int c)
        {
            switch (c)
            {
                case -1:
                    return null;
                case (int)' ':
                case (int)'\n':
                case (int)'\r':
                    return true;
                default:
                    return false;
            }
        }
    }

    class Util
    {
        public IEnumerable<int> Loop(int count) => Enumerable.Range(0, count);
        public IEnumerable<int> Loop(int from, int to) => Enumerable.Range(from, to - from + 1);

        public string YesNo(bool isYes) => isYes ? "Yes" : "No";

        public int Gcm(int a, int b)
        {
            if (a < b)
                return GcmImpl(b, a);
            else
                return GcmImpl(a, b);
        }

        int GcmImpl(int a, int b)
        {
            var remainder = a % b;
            if (remainder == 0)
                return b;
            else
                return GcmImpl(b, remainder);
        }

        public int Lcm(int a, int b)
        {
            return a / Gcm(a, b) * b;
        }
    }
}

Measured memory_bytes: 30936