Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int, input().split()))

x=[int(sum([A[i]*pow(-1, i) for i in range(N)])/2)]
for i in range(1, N):
  x.append(int(sum([A[j]*pow(-1, j-i) for j in range(i, N)])-x[0]*pow(-1, i)))
  
ans=[int(x[i]*2) for i in range(N)]
print(' '.join(map(str, ans)))

Fixed submission:
N=int(input())
temp=input().split()
A=[int(temp[i]) for i in range(N)]
As=[]
As.append(sum([A[i]*pow(-1, i) for i in range(N)]))
for i in range(1, N):
  As.append(A[i-1]-As[i-1])

x1=As[0]/2
print(int(2*x1), end=' ')

for i in range(1, N):
  print(2*int(As[i]-x1*pow(-1, i)), end=' ')

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int, input().split()))

x=[int(sum([A[i]*pow(-1, i) for i in range(N)])/2)]
for i in range(1, N):
  x.append(int(sum([A[j]*pow(-1, j-i) for j in range(i, N)])-x[0]*pow(-1, i)))
  
ans=[int(x[i]*2) for i in range(N)]
print(' '.join(map(str, ans)))

Fixed submission:
N=int(input())
temp=input().split()
A=[int(temp[i]) for i in range(N)]
As=[]
As.append(sum([A[i]*pow(-1, i) for i in range(N)]))
for i in range(1, N):
  As.append(A[i-1]-As[i-1])

x1=As[0]/2
print(int(2*x1), end=' ')

for i in range(1, N):
  print(2*int(As[i]-x1*pow(-1, i)), end=' ')

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
temp=input().split()
A=[int(temp[i]) for i in range(N)]

x1=sum([pow(-1, i)*A[i] for i in range(N)])/2
print(int(2*x1), end=' ')

for i in range(1, N):
  print(int(2*(sum([pow(-1, k-i)*A[k] for k in range(i, N)])-pow(-1, i)*x1)), end=' ')

Fixed submission:
N=int(input())
temp=input().split()
A=[int(temp[i]) for i in range(N)]
As=[]
As.append(sum([A[i]*pow(-1, i) for i in range(N)]))
for i in range(1, N):
  As.append(A[i-1]-As[i-1])

x1=As[0]/2
print(int(2*x1), end=' ')

for i in range(1, N):
  print(2*int(As[i]-x1*pow(-1, i)), end=' ')

Buggy python submission (verdict: Runtime Error):
N=int(input())
temp=input().split()
A=[int(temp[i]) for i in range(N)]

result=[]
for i in range(N):
  result.append(mean(A[i:i+2]))
  
print(result)

Fixed submission:
N=int(input())
temp=input().split()
A=[int(temp[i]) for i in range(N)]
As=[]
As.append(sum([A[i]*pow(-1, i) for i in range(N)]))
for i in range(1, N):
  As.append(A[i-1]-As[i-1])

x1=As[0]/2
print(int(2*x1), end=' ')

for i in range(1, N):
  print(2*int(As[i]-x1*pow(-1, i)), end=' ')

Buggy python submission (verdict: Runtime Error):
N=int(input())
temp=input().split()
A=[int(temp[i]) for i in range(N)]

A=[A[-1]]+A[:-1]
result=[]
for i in range(N):
  result.append(mean(A[i:i+2]))
  
print(result)

Fixed submission:
N=int(input())
temp=input().split()
A=[int(temp[i]) for i in range(N)]
As=[]
As.append(sum([A[i]*pow(-1, i) for i in range(N)]))
for i in range(1, N):
  As.append(A[i-1]-As[i-1])

x1=As[0]/2
print(int(2*x1), end=' ')

for i in range(1, N):
  print(2*int(As[i]-x1*pow(-1, i)), end=' ')

Buggy python submission (verdict: Runtime Error):
N=int(input())
temp=input().split()
A=[int(temp[i]) for i in range(N)]

A=[A[-1]]+A[:-1]

for i in range(N):
  print(mean(A[i:i+2]))

Fixed submission:
N=int(input())
temp=input().split()
A=[int(temp[i]) for i in range(N)]
As=[]
As.append(sum([A[i]*pow(-1, i) for i in range(N)]))
for i in range(1, N):
  As.append(A[i-1]-As[i-1])

x1=As[0]/2
print(int(2*x1), end=' ')

for i in range(1, N):
  print(2*int(As[i]-x1*pow(-1, i)), end=' ')

Buggy python submission (verdict: Runtime Error):
N=int(input())
temp=input().split()
A=[int(temp[i]) for i in range(N)]

A=[A[-1]]+A

for i in range(N):
  print(mean(A[i:i+2]))

Fixed submission:
N=int(input())
temp=input().split()
A=[int(temp[i]) for i in range(N)]
As=[]
As.append(sum([A[i]*pow(-1, i) for i in range(N)]))
for i in range(1, N):
  As.append(A[i-1]-As[i-1])

x1=As[0]/2
print(int(2*x1), end=' ')

for i in range(1, N):
  print(2*int(As[i]-x1*pow(-1, i)), end=' ')

Buggy python submission (verdict: Runtime Error):
N=int(input())
temp=input().split()
A=[int(temp[i]) for i in range(N)]

A=[A[-1]]+A

for i in range(N):
  print(mean(A[i:1+2]))

Fixed submission:
N=int(input())
temp=input().split()
A=[int(temp[i]) for i in range(N)]
As=[]
As.append(sum([A[i]*pow(-1, i) for i in range(N)]))
for i in range(1, N):
  As.append(A[i-1]-As[i-1])

x1=As[0]/2
print(int(2*x1), end=' ')

for i in range(1, N):
  print(2*int(As[i]-x1*pow(-1, i)), end=' ')

Buggy python submission (verdict: Runtime Error):
N=int(input())
temp=input().split()
A=[int(temp[i]) for i in range(N)]

A=A[-1]+A

for i in range(N):
  print((A[i]+A[i+1])/2)

Fixed submission:
N=int(input())
temp=input().split()
A=[int(temp[i]) for i in range(N)]
As=[]
As.append(sum([A[i]*pow(-1, i) for i in range(N)]))
for i in range(1, N):
  As.append(A[i-1]-As[i-1])

x1=As[0]/2
print(int(2*x1), end=' ')

for i in range(1, N):
  print(2*int(As[i]-x1*pow(-1, i)), end=' ')

Buggy python submission (verdict: Runtime Error):
N=int(input())
temp=[input().split() for i in range(N)]
A=[int(temp[i]) for i in range(N)]

A=A[-1]+A

for i in range(N):
  print((A[i]+A[i+1])/2)

Fixed submission:
N=int(input())
temp=input().split()
A=[int(temp[i]) for i in range(N)]
As=[]
As.append(sum([A[i]*pow(-1, i) for i in range(N)]))
for i in range(1, N):
  As.append(A[i-1]-As[i-1])

x1=As[0]/2
print(int(2*x1), end=' ')

for i in range(1, N):
  print(2*int(As[i]-x1*pow(-1, i)), end=' ')