Let's call an array good if there is an element in the array that equals to the sum of all other elements. For example, the array $a=[1, 3, 3, 7]$ is good because there is the element $a_4=7$ which equals to the sum $1 + 3 + 3$.

You are given an array $a$ consisting of $n$ integers. Your task is to print all indices $j$ of this array such that after removing the $j$-th element from the array it will be good (let's call such indices nice).

For example, if $a=[8, 3, 5, 2]$, the nice indices are $1$ and $4$:   if you remove $a_1$, the array will look like $[3, 5, 2]$ and it is good;  if you remove $a_4$, the array will look like $[8, 3, 5]$ and it is good. 

You have to consider all removals independently, i. e. remove the element, check if the resulting array is good, and return the element into the array.


-----Input-----

The first line of the input contains one integer $n$ ($2 \le n \le 2 \cdot 10^5$) — the number of elements in the array $a$.

The second line of the input contains $n$ integers $a_1, a_2, \dots, a_n$ ($1 \le a_i \le 10^6$) — elements of the array $a$.


-----Output-----

In the first line print one integer $k$ — the number of indices $j$ of the array $a$ such that after removing the $j$-th element from the array it will be good (i.e. print the number of the nice indices).

In the second line print $k$ distinct integers $j_1, j_2, \dots, j_k$ in any order — nice indices of the array $a$.

If there are no such indices in the array $a$, just print $0$ in the first line and leave the second line empty or do not print it at all.


-----Examples-----
Input
5
2 5 1 2 2

Output
3
4 1 5
Input
4
8 3 5 2

Output
2
1 4 

Input
5
2 1 2 4 3

Output
0




-----Note-----

In the first example you can remove any element with the value $2$ so the array will look like $[5, 1, 2, 2]$. The sum of this array is $10$ and there is an element equals to the sum of remaining elements ($5 = 1 + 2 + 2$).

In the second example you can remove $8$ so the array will look like $[3, 5, 2]$. The sum of this array is $10$ and there is an element equals to the sum of remaining elements ($5 = 3 + 2$). You can also remove $2$ so the array will look like $[8, 3, 5]$. The sum of this array is $16$ and there is an element equals to the sum of remaining elements ($8 = 3 + 5$).

In the third example you cannot make the given array good by removing exactly one element.

Difficulty: introductory

Starter code:

Solutions:
n = int(input())
a = list(map(int, input().split()))
c = [ 0 for i in range(1000001) ]
s = sum(a)
ans = []
for i in a: c[i] += 1
for i in range(n):
    s -= a[i]
    c[a[i]] -= 1
    if s % 2 == 0 and s // 2 <= 1000000 and c[s // 2] > 0:
        ans.append(i)
    s += a[i]
    c[a[i]] += 1
print(len(ans))
for i in ans:
    print(i + 1, end=' ')



#      
import collections, atexit, math, sys, bisect 

sys.setrecursionlimit(1000000)
def getIntList():
    return list(map(int, input().split()))    

try :
    #raise ModuleNotFoundError
    import numpy
    def dprint(*args, **kwargs):
        #print(*args, **kwargs, file=sys.stderr)
        # in python 3.4 **kwargs is invalid???
        print(*args,  file=sys.stderr)
    dprint('debug mode')
except Exception:
    def dprint(*args, **kwargs):
        pass



inId = 0
outId = 0
if inId>0:
    dprint('use input', inId)
    sys.stdin = open('input'+ str(inId) + '.txt', 'r') #标准输出重定向至文件
if outId>0:
    dprint('use output', outId)
    sys.stdout = open('stdout'+ str(outId) + '.txt', 'w') #标准输出重定向至文件
    atexit.register(lambda :sys.stdout.close())     #idle 中不会执行 atexit
    
N, = getIntList()
#print(N)

za = getIntList()

ss = sum(za)

cc = collections.Counter(za)

re = []
for i in range(N):
    if (ss- za[i])%2==1: continue
    t = (ss-za[i])//2
    g = 1
    if t== za[i]:
        g+=1
    if cc[t]>=g:
        re.append(str(i+1))
print(len(re))
print(' '.join(re))
    







n = int(input())
a = [int(e) for e in input().split()]
ans = []
sm = 0
st = dict()
for i in a:
    st[i * 2] = st.get(i * 2, 0) + 1
    sm += i
for i, j in enumerate(a):
    t = sm - j
    if t == 2 * j and st.get(t, 0) <= 1:
        continue
    if st.get(t, 0) > 0:
        ans.append(i + 1)
print(len(ans))
print(' '.join(str(e) for e in ans))


# your code goes here
n = int(input())

a = list(map(int,input().split()))

sort_a = sorted(a)

max_fi = sort_a[-1]
max_se = sort_a[-2]

sum_a = sum(a)
ans = 0
ans_a = []
for i in range(0,n):
	if a[i] != max_fi:
		if sum_a - max_fi - a[i] == max_fi:
			ans += 1
			ans_a.append(i+1)
	else:
		if sum_a - max_se - a[i] == max_se:
			ans += 1
			ans_a.append(i+1)

print(ans)
if ans > 0:
	print(' '.join([str(n) for n in ans_a]))

n = int(input())
l = list(map(int,input().split()))
r = []
s = 0
for i in range(n):
	s+=l[i]
m = {}
for i in range(1000001):
    m[i] = 0
for i in range(n):
	m[l[i]] +=1
for i in range(n):
    cur = s-l[i]	
    if cur//2 > 1e6:
        continue
    if cur%2==0:
        if cur//2==l[i]:
            if(m[cur//2]>=2):
                r.append(i)
        else:
            if(m[cur//2]>0):
                r.append(i)
print(len(r))
for i in r:
    print(i+1, end=' ')

from operator import itemgetter
#int(input())
#map(int,input().split())
#[list(map(int,input().split())) for i in range(q)]
#print("YES" * ans + "NO" * (1-ans))
n =  int(input())
ai = list(map(int,input().split()))
ai2 = [[ai[i],i+1] for i in range(n)]
ai2.sort(key = itemgetter(0))
ans = []
index = n-1
index2 = 0
num = sum(ai)
while index2 < n and index > -1:
    temp = (num - ai2[index2][0]) / 2
    while index > -1 and temp < ai2[index][0]:
        index-= 1
    
    if temp == ai2[index][0]:
        if index == index2:
            if temp == ai2[index-1][0]:
                ans += [ai2[index2][1]]
        else:
            ans += [ai2[index2][1]]
    index2 += 1
print(len(ans))
for i in ans:
    print(i,end=" ")


n = int(input())
l = list(map(int, input().split()))
s = sum(l)
max1, max2 = sorted(l, reverse=True)[:2]

pretty_indexes = []
for i, ll in enumerate(l, start=1):
    if (s - ll) == 2 * (max1 if ll != max1 else max2):
        pretty_indexes.append(str(i))
print(len(pretty_indexes))
print(" ".join(pretty_indexes))


gcd = lambda a, b: gcd(b, a % b) if b else a


def main():
    n = int(input())
    arr = list(map(int, input().split()))
    summ = sum(arr)
    ind=[]
    fm, sm = arr[0], -1
    ind_fm = 0
    for i in range(len(arr)):
        if arr[i] > fm:
            fm = arr[i]
            ind_fm = i
    for i in range(len(arr)):
        if arr[i] > sm and i != ind_fm:
            sm = arr[i]
    for i in range(len(arr)):
        if i != ind_fm and summ - arr[i] - fm == fm:
            ind.append(i + 1)
        if i == ind_fm and summ - arr[i] - sm == sm:
            ind.append(i + 1)

    print(len(ind))
    print(*ind)






main()

n = int(input())
a = list(map(int, input().split()))
s = sum(a)
answer = []
maxi = max(a)
posMax = a.index(maxi)
for i in range(n):
    if a[i] == maxi and i == posMax:
        tempMax = max(a[:i]+a[i+1:])
        if s-a[i]-tempMax == tempMax:
            answer.append(i+1)
    else:
        if s-a[i]-maxi == maxi:
            answer.append(i+1)
print(len(answer))
print(*answer)

# -*- coding: utf-8 -*-

import math
import collections
import bisect
import heapq
import time
import itertools
import sys

"""
created by shhuan at 2018/11/16 22:49

"""


N = int(input())

A = [int(x) for x in input().split()]

total = sum(A)
vals = collections.Counter(A)
mxVal = max(A)
ans = []

if vals[mxVal] > 1:
    for i, v in enumerate(A):
        rest = total - v
        if rest-mxVal == mxVal:
            ans.append(i+1)
else:
    for i, v in enumerate(A):
        rest = total - v
        if v == mxVal:
            second = max(max(A[:i] or [0]), max(A[i+1:] or [0]))
            if rest - second == second:
                ans.append(i+1)
        else:
            if rest - mxVal == mxVal:
                ans.append(i+1)

if ans:
    print(len(ans))
    print(' '.join(map(str, ans)))
else:
    print(0)

from collections import Counter as C
n = int(input())
l = [*map(int, input().split())]

c = C(l)
s = sum(l)
res = []

# print(c)

for i, e in enumerate(l):

    if c.get((s - e)/2, 0) > int((s - e)/2 == e):
        res.append(str(i + 1))


print(len(res))
print(' '.join(res))

n = int(input())
a = [int(i) for i in input().split()]
b = sorted(a)
s = sum(b[:-1])
f = s - b[-1]
r = set()
if (f > 0 and not(b.count(f) == 1 and b[-1] == f)):
    for i in range(n):
        if a[i] == f:
            r.add(i+1)
if sum(b[:-2]) == b[-2]:
    for i in range(n):
        if a[i] == b[-1]:
            r.add(i+1)
print(len(r))
r = list(r)
print(" ".join(str(i) for i in r))

from collections import Counter

_ = input()

a = list(map(int, input().split()))

c = Counter(a)

s = sum(a)

r = []
for i, e in enumerate(a, 1):
    if (s - e) % 2 == 0 and (s - e) / 2 in c and ((s - e) / 2 != e or c[e] > 1):
        r.append(i)

print(len(r))

if len(r) != 0:
    print(*r)


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
ans = []
ma, se = 0, 0
for i in range(n):
    if ma < a[i]:
        se = ma
        ma = a[i]
    elif ma == a[i]:
        se = a[i]
    elif se < a[i]:
        se = a[i]

for i in range(n):
    s -= a[i]
    if a[i] == ma:
        if s == se * 2:
            ans.append(i + 1)
        s += a[i]
        continue

    if s == ma * 2:
        ans.append(i + 1)
    s += a[i]

print(len(ans))
print(" ".join(map(str, ans)))

n = int(input())
A = list(map(int, input().split()))
s = sum(A)
s1 = s - max(A)

A = [(A[i], i + 1) for i in range(n)]
A.sort()

res = []
for i in range(n - 1):
    if s1 - A[i][0] == A[-1][0]:
        res.append(A[i][1])
if s1 - A[-2][0] == A[-2][0]:
    res.append(A[-1][1])
print(len(res))
for i in range(len(res)):
    print(res[i], end=' ')


n = int(input())
A = list(map(int, input().split()))

summa = 0
d = dict()
ans = set()

for i in range(len(A)):
    elem = A[i]
    summa += elem
    
    try:
        d[elem].add(i)
    except:
        d[elem] = set()
        d[elem].add(i)

for i in range(len(A)):
    elem = A[i]
    
    if summa - elem <= elem:
        continue
    
    x = summa - (elem * 2)
    if x in d.keys():
        s = d[x]
        
        for j in s:
            if j != i:
                ans.add(j)

print(len(ans))
if len(ans) != 0:
    for i in ans:
        print(i + 1, end=' ')

3.5

n = int(input())
A = [int(s) for s in input().split(" ") if s != ""]
B = [(x, i) for i, x in enumerate(A)]

B.sort()
_sum = sum(A)
L = []

for i, (x, j) in enumerate(B):
    __sum = _sum - x
    if i == len(A)-1:
        _max = B[-2][0]
    else:
        _max = B[-1][0]

    __sum -= _max

    if __sum == _max:
        L.append(j+1)

print(len(L))

if len(L) != 0:
    for i in range(0, len(L)-1):
        print(L[i], end=" ")

    print(L[-1])


import math
n=int(input())
def fun(itm):
    return itm[0]
def sm(l):
    s=0
    for i in l:
        s+=i[0]
    return s
l1=list(map(int,input().split()))
for i in range(n):
    l1[i]=[l1[i],i]
ans=[]
l=sorted(l1,key=fun)
s=sm(l) - l[n-1][0]
for i in range(n-1):
    if(s-l[i][0]==l[n-1][0]):
        ans.append(l[i][1]+1)
if(s-l[n-2][0]==l[n-2][0]):
    ans.append(l[n-1][1]+1)
print(len(ans))
for i in ans:
    print(i,end=" ")

n = int(input())
a = sorted(((value, i) for i, value in enumerate(map(int, input().split()))), reverse=True)

all_sum = sum(value for value, _ in a)

results = []
for i in range(n):
    index = 0 if i > 0 else 1
    if all_sum - a[i][0] == 2 * a[index][0]:
        results.append(a[i][1] + 1)

print(len(results))
if results:
    print(*results, sep=' ')


import sys

input = sys.stdin.readline

n = int(input())
a = list(map(int, input().split()))

count = {}

sum = 0
for i in range(n):
    if a[i] not in count.keys():
        count[a[i]] = 0
    count[a[i]] += 1

    sum += a[i]

ans = []

for i in range(n):
    sub = sum - a[i]
    if sub % 2 == 1:
        continue
    sub = int(sub/2)
    if sub in count.keys() and sub == a[i]:
        if count[sub] > 1:
            ans.append(str(i+1))
    elif sub in count.keys() and count[sub] >= 1:
        ans.append(str(i+1))

print(len(ans))
print(" ".join(ans))


from  collections import defaultdict

n = int(input())
a = list(map(int, input().split()))
mp = defaultdict(list)
addition = sum(a)
ans = []
for i in range(n):
    mp[a[i]].append(i)
index = 0
# print(mp)
for i in a:
    temp = addition
    temp -= i
    # print("add ",temp )
    if temp %2 == 1:
        index += 1
        continue
    temp //= 2
    # print("now temp ",temp)

    if temp in mp and len(mp[temp]) > 1:

        ans.append(index+1)

    if i in mp and len(mp[temp]) == 1:
        # print("here")
        if mp[temp][0] != index:
            ans.append(index+1)
            # print("appended")
    index += 1
print(len(ans))
if len(ans) == 0:
    return
ans = list(map(str, ans))
print(' '.join(ans))







I=lambda:map(int,input().split())
n=int(input())
a=list(I())
c=[]
maxx=0
smax=0
for i in range(n):
    if maxx<a[i]:
        smax=maxx
        maxx=a[i]
    elif smax<a[i]:
        smax=a[i]
s=sum(a)
for i in range(n):
    if maxx!=a[i]:
        if 2*maxx==(s-a[i]):
            c.append(i+1)
    else:
        if s-a[i]==2*smax:
            c.append(i+1)
print(len(c))
print(*c)

import math
import bisect
import itertools
import sys
mod=10**9 +7
'''fact=[1]*1001
ifact=[1]*1001
for i in range(1,1001):
    fact[i]=((fact[i-1])*i)%mod
    ifact[i]=((ifact[i-1])*pow(i,mod-2,mod))%mod
def ncr(n,r):
    return (((fact[n]*ifact[n-r])%mod)*ifact[r])%mod
def npr(n,r):
    return (((fact[n]*ifact[n-r])%mod))
    '''


def mindiff(a):
    b=a[:]
    b.sort()
    m=10000000000
    for i in range(len(b)-1):
        if b[i+1]-b[i]<m:
            m=b[i+1]-b[i]
    return m
    
def lcm(a,b):
    return a*b//math.gcd(a,b)

    
def merge(a,b):
    i=0;j=0
    c=0
    ans=[]
    while i<len(a) and j<len(b):
        if a[i]<b[j]:
            ans.append(a[i])
            i+=1
        else:
            ans.append(b[j])
            c+=len(a)-i
            j+=1
    ans+=a[i:]
    ans+=b[j:]
    return ans,c
def mergesort(a):
    if len(a)==1:
        return a,0
    mid=len(a)//2   
    left,left_inversion=mergesort(a[:mid])
    right,right_inversion=mergesort(a[mid:])
    m,c=merge(left,right)
    c+=(left_inversion+right_inversion)
    return m,c
    
def is_prime(num):
    if num == 2: return True
    if num == 3: return True
    if num%2 == 0: return False
    if num%3 == 0: return False
    t = 5
    a = 2
    while t <= int(math.sqrt(num)):
        if num%t == 0: return False
        t += a
        a = 6 - a
    return True
    
  
def ceil(a,b):
    if a%b==0:
        return a//b
    else:
        return (a//b + 1)

def binsearch(arr,b,low,high):
    if low==high:
        return low
    if arr[math.ceil((low+high)/2)]<b:
        return binsearch(arr,b,low,math.ceil((low+high)/2) -1 )
    else:
        return binsearch(arr,b,math.ceil((low+high)/2),high)
def ncr1(n,r):
    s=1
    for i in range(min(n-r,r)):
        s*=(n-i)
        s%=mod
        s*=pow(i+1,mod-2,mod)
        s%=mod
    return s
    
def calc(n,m,r):
    s=0
    for i in range(0,r+1,2):
        s+=ncr1(n,i)*ncr1(m,i)
        s%=mod
    return s    
        
        

#/////////////////////////////////////////////////////////////////////////////////////////////////
n=int(input())

a=list(map(int,input().split()))
s=sum(a)
b=[];count=0;c=[]
for i in range(n):
    b.append(s-a[i])
ma=min(a);sm=min(a)
for i in range(n):
    if ma<a[i]:
        sm=ma
        ma=a[i]
    elif sm< a[i]:
        sm=a[i]
for i in range(n):
    if a[i]==ma:
        if b[i]/2==sm:
            count+=1
            c.append(i+1)
    else:
        #print(b[i])
        if b[i]/2==ma:
            count+=1
            c.append(i+1)
#print(b)
#print(ma,sm)            
if count==0:
    print(count);return
print(count)    
print(*c)

        
    
    

def main():
    count=int(input())
    arr=input().split(" ")
    store=[]
    tot=0
    biggest=0
    second_biggest=0
    index_biggest=0
    index_second_biggest=0
    for x in range(count):
        test=int(arr[x])
        store.append(test)
        tot+=test
        if test>=biggest:
            biggest,second_biggest=test,biggest
            index_biggest,index_second_biggest=x,index_biggest
        elif test>second_biggest:
            second_biggest=test
            index_second_biggest=x
    number=0
    string=""
    for x in range(count):
        if store[x]==biggest:
            if tot-store[x]==2*second_biggest:
                number+=1
                string+=str(x+1)+" "
        else:
            if tot-store[x]==2*biggest:
                number+=1
                string+=str(x+1)+" "
    print(number)
    print(string)
main()