n = gets.to_i
a = gets.split(' ').map(&:to_i)

a << a[0]

i = 0

flag = 1
tmp = []

while flag == 1 do
    x = 2*i
    start = x
    tmp << start

    (a.length-1).times do |j|
        x = 2 * a[j+1] - x
        tmp << x
    end

    if x == start then
        flag = 0
        tmp.pop
    else
        tmp = []
        i += 1
    end

end

print "#{tmp[-1]}"

(tmp.length-1).times do |i|
    print " #{tmp[i]}"
end