n = int(input())
arr = list(map(int,input().split()))
pref = [0] * (n+1)

for i in range(n):
    pref[i+1] = pref[i]+arr[i]

vr = []

for x in range(1,n+1):
    if pref[x] % (pref[n]//3) == 0:
        vr.append(x)

print(0)
print(*vr)