N = int(input())
X = list(map(int,input().split()))
A = 10**10
R = sum(X)
K = 0
for i in range (N-1):
	K += X[i]
	R -= X[i]
	A = min(A, abs(K-R))
print(A) N = int(input()) N int(input()) int input() input X = list(map(int,input().split())) X list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split A = 10**10 A 10**10 10 10 R = sum(X) R sum(X) sum X K = 0 K 0 for i in range (N-1):
	K += X[i]
	R -= X[i]
	A = min(A, abs(K-R)) i range (N-1) range N-1 N 1 K += X[i] K X[i] X i R -= X[i] R X[i] X i A = min(A, abs(K-R)) A min(A, abs(K-R)) min A abs(K-R) abs K-R K R print(A) print A X = list(map(int,input().split())) list(map(int,input().split())) X R = sum(X) sum(X) R A = min(A, abs(K-R)) min(A, abs(K-R)) A A = 10**10 10**10 A N = int(input()) int(input()) N K = 0 0 K R -= X[i] X[i] R K += X[i] X[i] K
N = int(input())
X = list(map(int,input().split()))
A = 10**10
R = sum(X)
K = 0
for i in range (N-1):
	K += X[i]
	R -= X[i]
	A = min(A, abs(K-R))
print(A)