def min2(a,b)
    return a>b ? b : a
end
def max2(a,b)
    return a<b ? b : a
end

def get_anotherside(xlist,x1)
    x = x1

    for i in xlist
        x= i - x

    end

    return x


end

def print_list(xlist,x1)
    x = x1
    ans = Array.new
    for i in xlist
        ans.push(x*2)
        x = i-x
      

    end

    puts ans.join(' ')

end


N = gets.to_i
A = gets.split.map{|i| i.to_i}

left = 0
right = A[0]

if left == get_anotherside(A,left)
    print_list(A,left)
    exit
end
if right == get_anotherside(A,right)
    print_list(A,right)
    exit
end




while true
    center = (left+right)/2
    if center = get_anotherside(A,center)
        print_list(A,center)
        exit
    end


end