#include <stdio.h>
#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define F0R(i,n) FOR(i,0,n)

int main(void) {
	int n;
	printf("Enter the size of the array: ");
	scanf("%i", &n);
	printf("Enter the elements of the array: ");
	int arr[n];
	F0R(i,n) scanf("%i", &arr[i]);
	FOR(i,1,n) arr[i] += arr[i-1];
	printf("The equilibrium index: ");
	FOR(i,1,n-1) {
		if (arr[i-1] == arr[n-1]-arr[i]) {
			printf("%i\n", i);
			return 0;
		}
	}
	puts("-1");
}