Public Class Compiler
  Shared Sub Main()
        Dim n As Integer = Integer.Parse(Console.ReadLine())
        Dim arrayA() As Integer = Array.ConvertAll(Of String, Integer)(Console.ReadLine().Split(" "), AddressOf Integer.Parse)
        Dim s As Integer = 0
        For i As Integer = 0 To n - 1
            s += arrayA(i)
        Next
        Dim output(0 To n - 1) As Integer
        Dim a As Integer = 0
        For i As Integer = 2 To n - 1 Step 2
            a += arrayA(i - 1)
        Next
        output(0) = s - 2 * a
        For i As Integer = 1 To n - 1
            output(i) = 2 * arrayA(i - 1) - output(i - 1)
        Next
        Console.WriteLine(String.Join(" ", Array.ConvertAll(Of Integer, String)(output, AddressOf OutputToString)))
  End Sub
  
  Shared Function OutputToString(o As Integer) As String
      Return o.ToString()
  End Function
End Class