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: EASY

Solutions:
x = int(input())
ls = [int(i) for i in input().split()]
v = sorted(ls)
arr = []
mx1 = v[len(v) - 1]
mx2 = v[len(v) - 2]
sm = sum(ls)
for i in range(len(ls)):
	if ls[i] == mx1:
		if sm - ls[i] - mx2 == mx2:
			arr.append(i + 1)
	elif sm - ls[i] - mx1 == mx1:
		arr.append(i + 1)
print(len(arr))
for i in range(len(arr)):
	print(arr[i], end=' ')


n = int(input())
res = []
a = input().split()
for i in range(n):
	a[i] = int(a[i])
asor = sorted(a)
run = True
su = sum(a)
m = max(a)
if run:
	for i in range(n):
		if a[i] == m:
			if su - a[i] - asor[-2] == asor[-2]:
				res.append(i + 1)
		elif su - a[i] - asor[-1] == asor[-1]:
			res.append(i + 1)
if len(res) > 0:
	print(len(res))
	for r in res:
		print(r, end=' ')
else:
	print(0)


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 = [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)))


import collections, atexit, math, sys, bisect
sys.setrecursionlimit(1000000)

def getIntList():
	return list(map(int, input().split()))
try:
	import numpy

	def dprint(*args, **kwargs):
		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())
(N,) = getIntList()
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))


from collections import *
n = int(input())
a = [*map(int, input().split())]
s = sum(a)
d = defaultdict(set)
b = [*enumerate(a, 1)]
for (i, x) in b:
	d[x].add(i)
r = set()
for (i, x) in b:
	r |= d[s - 2 * x] - {i}
print(len(r))
print(*r)


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
for i in a:
	temp = addition
	temp -= i
	if temp % 2 == 1:
		index += 1
		continue
	temp //= 2
	if temp in mp and len(mp[temp]) > 1:
		ans.append(index + 1)
	if i in mp and len(mp[temp]) == 1:
		if mp[temp][0] != index:
			ans.append(index + 1)
	index += 1
print(len(ans))
if len(ans) == 0:
	return
ans = list(map(str, ans))
print(' '.join(ans))


n = input()
a = list(map(int, input().split()))
s = sum(a)
b = sorted(a)[-2:]
k = []
c = 0
for d in a:
	c = c + 1
	if s - d == 2 * b[1] and (b[1] != d or b[0] == d) or (s - d == 2 * b[0] and b[0] != d):
		k.append(c)
print(len(k))
print(*k)


from collections import *
input()
a = [*map(int, input().split())]
c = Counter(a)
s = sum(a)
r = []
for (i, x) in enumerate(a, 1):
	if c[(s - x) / 2] > (s == 3 * x):
		r += [str(i)]
print(len(r))
print(' '.join(r))


n = int(input())
(a, ans, b) = ([int(s) for s in input().split()], [], [])
b = sorted(a)
k = 0
(sum, max1, max2) = (0, b[n - 1], -1)
for i in range(n - 1, -1, -1):
	if max1 == b[i]:
		k += 1
	if max2 < b[i] and b[i] != max1:
		max2 = b[i]
	sum += b[i]
sum -= max1
if max2 == -1:
	max2 = max1
for i in range(n):
	if a[i] != max1:
		if sum - a[i] == max1:
			ans.append(i + 1)
	elif max2 != -1:
		if sum - max2 == max2 or (k > 1 and sum - a[i] == max1):
			ans.append(i + 1)
print(len(ans))
print(*ans)


from os import path
import sys, time
from math import ceil, floor, gcd, log, log2, factorial
from collections import defaultdict, Counter, deque
from itertools import permutations
maxx = float('inf')
I = lambda : int(sys.stdin.buffer.readline())
tup = lambda : map(int, sys.stdin.buffer.readline().split())
lint = lambda : [int(x) for x in sys.stdin.buffer.readline().split()]
S = lambda : sys.stdin.readline().replace('\n', '').strip()

def grid(r, c):
	return [lint() for i in range(r)]
stpr = lambda x: sys.stdout.write(f'{x}' + '\n')
star = lambda x: print(' '.join(map(str, x)))
localsys = 0
start_time = time.time()
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
n = I()
ls = lint()
s = sum(ls)
d = defaultdict(int)
for i in ls:
	d[i] += 1
(ans, lis) = ([], sorted(ls))
for i in range(n):
	x = s - ls[i]
	if x % 2 == 0:
		x //= 2
		if x == ls[i] and d[x] > 1:
			ans.append(i + 1)
		elif x != ls[i] and d[x] > 0:
			ans.append(i + 1)
print(len(ans))
print(*ans)
if localsys:
	print('\n\nTime Elased :', time.time() - start_time, 'seconds')


n = int(input())
l = list(map(int, input().split()))
s = sum(l)
res = []
x = s // 2
y = s - x
dic = {}
for i in l:
	if i in dic:
		dic[i] = dic[i] + 1
	else:
		dic[i] = 1
c = 0
for i in range(len(l)):
	z = s - l[i]
	dic[l[i]] = dic[l[i]] - 1
	if z % 2 == 0 and z // 2 in dic and (dic[z // 2] >= 1):
		c = c + 1
		res.append(i + 1)
	dic[l[i]] = dic[l[i]] + 1
if len(res) == 0:
	print(0)
else:
	print(c)
	for i in res:
		print(i, end=' ')


import sys
import collections
inp = sys.stdin
n = int(inp.readline())
a = list(map(int, inp.readline().split()))
o = []
s = collections.Counter()
for aa in a:
	s[aa] += 1
sm = sum(a)
for i in range(0, n):
	sm = sm - a[i]
	s[a[i]] -= 1
	if sm % 2 == 0 and sm / 2 in s and (s[sm / 2] > 0):
		o.append(i + 1)
	s[a[i]] += 1
	sm += a[i]
print(len(o))
print(' '.join(map(str, o)))


def is_nice(numbers, banned, max_sum):
	num_sum = max_sum - banned
	if num_sum % 2 != 0:
		return False
	nice_num = num_sum // 2
	if nice_num not in numbers:
		return False
	if nice_num == banned and numbers[nice_num] == 1:
		return False
	return True

def solve(lst):
	memo = {}
	numbers = {}
	max_sum = 0
	for n in lst:
		if n not in numbers:
			numbers[n] = 1
		else:
			numbers[n] += 1
		max_sum += n
	indices = []
	for i in range(len(lst)):
		if lst[i] not in memo:
			memo[lst[i]] = is_nice(numbers, lst[i], max_sum)
		if memo[lst[i]]:
			indices.append(i)
	return (len(indices), indices)
n = int(input())
lst = [int(x) for x in input().split()]
(size, indices) = solve(lst)
print(size)
for i in indices:
	print(i + 1, end=' ')


def main():
	n = int(input())
	a = list(map(int, input().split(' ')))
	arr = a[:]
	max1 = max(arr)
	arr.remove(max1)
	max2 = max(arr)
	sums = sum(a)
	ans = 0
	val = []
	for i in range(n):
		if a[i] == max1:
			if sums - max1 - max2 == max2:
				ans = ans + 1
				val.append(i + 1)
		elif sums - a[i] - max1 == max1:
			ans = ans + 1
			val.append(i + 1)
	print(ans)
	for i in range(len(val)):
		print(val[i], end=' ')
main()


n = int(input())
a = [int(x) for x in input().split()]
s = sum(a)
q = sorted(a)
h1 = q[-1]
h2 = q[-2]
ans = []
for i in range(n):
	d = a[i]
	if a[i] == h1:
		h = h2
	else:
		h = h1
	if s - a[i] - h == h:
		ans.append(i + 1)
print(len(ans))
print(*ans)


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)
	elif 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())
a = list(map(int, input().strip().split()))
summa = sum(a)
p = [0] * 2000006
for x in a:
	p[x] += 1
res = []
n = len(a)
for i in range(0, n):
	n_summa = summa - a[i]
	if n_summa % 2 == 1:
		continue
	r = n_summa // 2
	if r > 2000000 or r < 0:
		continue
	p[a[i]] -= 1
	if p[r] > 0:
		res.append(i)
	p[a[i]] += 1
print(len(res))
for x in res:
	print(x + 1, end=' ')


n = int(input())
lis = list(map(int, input().split()))
lis2 = []
for i in range(n):
	lis2.append(lis[i])
lis2.sort()
sum = 0
for i in range(n):
	sum = sum + lis[i]
temp = sum
c = 0
lis1 = []
for i in range(n):
	if lis[i] != lis2[n - 1]:
		temp = temp - lis[i] - lis2[n - 1]
		if temp == lis2[n - 1]:
			c = c + 1
			lis1.append(i + 1)
	else:
		temp = temp - lis[i] - lis2[n - 2]
		if temp == lis2[n - 2]:
			c = c + 1
			lis1.append(i + 1)
	temp = sum
print(c)
for i in range(c):
	print(lis1[i], end=' ')


n = int(input())
a = list(map(int, input().split(' ')))
rev_map = {}
for (i, ai) in enumerate(a):
	if ai in rev_map:
		rev_map[ai].append(i)
	else:
		rev_map[ai] = [i]
indices = set()
total = sum(a)
for ai in rev_map:
	subtotal = total - ai
	if subtotal % 2 == 0 and subtotal // 2 in rev_map and (not ai == subtotal // 2 or len(rev_map[subtotal // 2]) > 1):
		for index in rev_map[ai]:
			indices.add(index + 1)
print(len(indices))
print(*list(indices))


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)
	elif 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

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)
	elif b[i] / 2 == ma:
		count += 1
		c.append(i + 1)
if count == 0:
	print(count)
	return
print(count)
print(*c)


n = int(input())
l = list(map(int, input().split()))
l1 = [0] * 10000000
s = 0
ans = 0
l2 = []
for i in range(n):
	l1[l[i]] += 1
	s += l[i]
for i in range(n):
	l1[l[i]] -= 1
	s -= l[i]
	if s % 2 == 0 and s // 2 <= 1000000:
		if l1[s // 2] > 0:
			ans += 1
			l2.append(i + 1)
	l1[l[i]] += 1
	s += l[i]
print(ans)
for i in range(ans):
	print(l2[i], end=' ')
print()


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=' ')


n = int(input())
a = list(map(int, input().split()))
d = {}
for item in a:
	if d.get(item):
		d[item] += 1
	else:
		d[item] = 1
s = sum(a)
res = []
for i in range(n):
	d[a[i]] -= 1
	if d.get((s - a[i]) / 2):
		if d.get((s - a[i]) / 2) >= 1:
			res.append(i + 1)
	d[a[i]] += 1
print(len(res))
print(*res)


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))


n = int(input())
l = list(map(int, input().split()))
maa = max(l)
m = 0
if l.count(maa) > 1:
	m = maa
else:
	for i in l:
		if i > m and i != maa:
			m = i
s = sum(l)
f = 0
ll = []
for i in range(len(l)):
	a = l[i]
	if a == maa:
		b = m
	else:
		b = maa
	if s - a - b == b:
		f = 1
		ll.append(i + 1)
if f == 0:
	print(0)
else:
	print(len(ll))
	print(*ll)


def main():
	N = int(input())
	A = [int(i) for i in input().split()]
	S = sum(A)
	from collections import Counter
	c = Counter(A)
	ans = []
	for i in range(N):
		v = S - A[i]
		if v % 2 == 1:
			continue
		v //= 2
		if v != A[i] and c[v] > 0 or c[v] > 1:
			ans.append(i + 1)
	print(len(ans))
	print(*ans)
main()


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
f = {i: 0 for i in a}
for i in a:
	f[i] += 1
nice = []
for i in range(n):
	rem = s - a[i]
	if rem % 2 == 0:
		need = rem // 2
		if need in f:
			x = f[need]
			if rem // 2 == a[i] and x > 1 or (x > 0 and rem // 2 != a[i]):
				nice.append(i + 1)
print(len(nice))
print(*nice)


from collections import Counter as C
n = int(input())
l = [*map(int, input().split())]
c = C(l)
s = sum(l)
res = []
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())
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))


n = int(input())
l = [int(i) for i in input().split()]
s = sum(l)
res = []
from collections import Counter
c = Counter(l)
for i in range(n):
	curr = s - l[i]
	if c[curr / 2]:
		if l[i] * 3 == s:
			if c[l[i]] > 1:
				res.append(i + 1)
		else:
			res.append(i + 1)
print(len(res))
print(*res)


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)))


from collections import *
n = int(input())
l = list(map(int, input().split()))
s = set(l)
dic = Counter(l)
x = sum(l)
arr = []
for i in range(n):
	if (x - l[i]) % 2 == 0:
		if (x - l[i]) // 2 in s:
			if (x - l[i]) // 2 == l[i] and dic[l[i]] > 1:
				arr.append(i + 1)
			elif (x - l[i]) // 2 != l[i]:
				arr.append(i + 1)
print(len(arr))
print(*arr)


from collections import defaultdict, Counter
n = int(input())
a = list(map(int, input().split()))
C = defaultdict(int, Counter(a))
s = sum(a)
ans = 0
ans_l = list()
for i in range(n):
	el = a[i]
	C[el] -= 1
	if C[(s - el) / 2]:
		ans += 1
		ans_l.append(i + 1)
	C[el] += 1
print(ans)
print(' '.join(map(str, ans_l)))


n = int(input())
x = [int(n) for n in input().split()]
a = {}
s = 0
for i in range(n):
	s += x[i]
	try:
		a[x[i]].append(i + 1)
	except:
		a[x[i]] = []
		a[x[i]].append(i + 1)
c = 0
m1 = max(x)
if x.count(m1) >= 2:
	m2 = m1
else:
	m2 = 0
	for i in x:
		if i != m1:
			m2 = max(m2, i)
ans = []
for i in a:
	if i == m1:
		if s - m1 == 2 * m2:
			for j in a[i]:
				c += 1
				ans.append(j)
	elif s - i == 2 * m1:
		for j in a[i]:
			c += 1
			ans.append(j)
print(c)
print(*ans)


input()
a = [*map(int, input().split())]
s = sum(a)
h = sorted(a)[-2:]
r = [i for (i, x) in enumerate(a, 1) if s - x == 2 * h[x != h[1]]]
print(len(r))
print(*r)


n = int(input())
l = str(input())
l = l.split(' ')
l = [int(g) for g in l if g != '' and g != ' ']
r = []
s = 0
y = l.copy()
y.sort()
a = y[n - 1]
b = y[n - 2]
for j in range(n):
	s = s + y[j]
for i in range(n):
	if l[i] != a:
		if s - l[i] == 2 * a:
			r.append(i + 1)
	elif s - l[i] == 2 * b:
		r.append(i + 1)
print(len(r))
for i in range(len(r)):
	print(r[i], end=' ')


def isGood(s, d):
	try:
		m = d[s // 2]
		return m > 0
	except:
		return False
n = int(input())
a = list(map(int, input().split()))
d = dict()
niceIndices = []
s = sum(a)
for i in range(n):
	try:
		d[a[i]] += 1
	except:
		d[a[i]] = 1
for i in range(n):
	sumOfRest = s - a[i]
	d[a[i]] -= 1
	if sumOfRest % 2 == 1:
		d[a[i]] += 1
		continue
	if isGood(sumOfRest, d):
		niceIndices.append(i + 1)
	d[a[i]] += 1
print(len(niceIndices))
for i in niceIndices:
	print(i, end=' ')


n = int(input())
seq = list(map(int, input().split()))
mx = max(seq)
sm = sum(seq)
nseq = [seq[i] for i in range(n)]
nseq.remove(mx)
mx2 = max(nseq)
ans = []
for i in range(n):
	s = seq[i]
	if s == mx:
		if sm - s == 2 * mx2:
			ans.append(i + 1)
	elif sm - s == 2 * mx:
		ans.append(i + 1)
print(len(ans))
print(' '.join(list(map(str, ans))))


import sys
input = sys.stdin.readline
out = sys.stdout

def main():
	n = int(input())
	a = list(map(int, input().split()))
	current = a[:]
	q_1 = max(current)
	del current[current.index(q_1)]
	q_2 = max(current)
	d = {}
	qw = sum(a)
	for i in range(n):
		if a[i] != q_1:
			d[i] = qw - a[i] - q_1
		else:
			d[i] = qw - a[i] - q_2
	answer = 0
	ans_mas = []
	for i in range(n):
		if a[i] != q_1:
			if d[i] == q_1:
				answer += 1
				ans_mas.append(i + 1)
		elif d[i] == q_2:
			answer += 1
			ans_mas.append(i + 1)
	out.write(str(answer) + '\n')
	if answer != 0:
		for k in ans_mas:
			out.write(str(k) + ' ')
main()


import math
n = int(input())
a = list(map(int, input().rstrip().split()))
d = dict()
m = []
count = 0
sum1 = sum(a)
for i in a:
	if i in d:
		d[i] += 1
	else:
		d[i] = 1
for i in range(n):
	if math.ceil((sum1 - a[i]) / 2) == math.floor((sum1 - a[i]) / 2) and (sum1 - a[i]) // 2 in d:
		if (sum1 - a[i]) // 2 == a[i] and d[a[i]] == 1:
			pass
		else:
			m.append(i + 1)
			count += 1
print(count)
print(' '.join((str(e) for e in m)))


import math
import collections
import bisect
import heapq
import time
import itertools
import sys
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)
		elif rest - mxVal == mxVal:
			ans.append(i + 1)
if ans:
	print(len(ans))
	print(' '.join(map(str, ans)))
else:
	print(0)


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
d = dict()
for i in range(n):
	if a[i] in d:
		d[a[i]].append(i + 1)
	else:
		d[a[i]] = [i + 1]
ans = []
for k in d.keys():
	if (s - k) % 2 > 0:
		continue
	m = (s - k) // 2
	if m in d and (m != k or len(d[k]) > 1):
		ans += d[k]
print(len(ans))
print(' '.join([str(i) for i in ans]))


from collections import Counter
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def dice():
	dp = [0] * (n + 1)
	dp[1] = 1
	dp[0] = 1
	for i in range(2, n + 1):
		for j in range(1, 7):
			if i - j >= 0:
				dp[i] = (dp[i] + dp[i - j]) % (10 ** 9 + 7)
			else:
				break
import sys
import math
from collections import Counter
n = int(input())
arr = list(map(int, input().split()))
var = sum(arr)
c = Counter(arr)
cnt = 0
ans = []
for i in range(n):
	cn = var - arr[i]
	if cn % 2 == 0:
		if cn // 2 in c:
			if arr[i] != cn // 2:
				cnt += 1
				ans.append(i + 1)
			elif c[cn // 2] > 1:
				cnt += 1
				ans.append(i + 1)
print(cnt)
if cnt > 0:
	print(*ans)


n = int(input())
a = [int(x) for x in input().split()]
b = [0] * (max(a) + 1)
for i in range(n):
	b[a[i]] += 1
s = sum(a)
d = set(a)
c = []
for i in range(n):
	m = s - a[i]
	if m % 2 == 0 and m // 2 in d:
		if not (m // 2 == a[i] and b[m // 2] == 1):
			c.append(i)
if len(c) == 0:
	print(0)
else:
	print(len(c))
	for i in c:
		print(i + 1, end=' ')


from collections import Counter
n = int(input())
a = list(map(int, input().split()))
b = Counter(a)
s = sum(a)
res = []
for i in range(n):
	if (s - a[i]) % 2 == 0 and (s - a[i]) // 2 in b and ((s - a[i]) // 2 != a[i] or b[a[i]] > 1):
		res.append(i + 1)
print(len(res))
if len(res) != 0:
	print(*res)


n = int(input())
a = list(map(int, input().split()))
max1 = a[0]
q = 0
max2 = a[1]
if max1 < max2:
	(max1, max2) = (max2, max1)
	q = 1
s = 0
for i in range(n):
	s += a[i]
	if a[i] > max1:
		(max1, max2) = (a[i], max1)
		q = i
	elif a[i] > max2 and i != q:
		max2 = a[i]
count = 0
b = []
for i in range(n):
	if a[i] == max1:
		if s - a[i] - max2 == max2:
			count += 1
			b.append(i)
	elif a[i] != max1:
		if s - a[i] - max1 == max1:
			count += 1
			b.append(i)
print(count)
for i in range(len(b)):
	if b[i] != -1:
		print(b[i] + 1, end=' ')


n = int(input())
a = list(map(int, input().split()))
ans = []
su = sum(a)
dic = {}
for item in a:
	dic[item] = dic.get(item, 0) + 1
for i in range(n):
	su -= a[i]
	dic[a[i]] -= 1
	if su % 2 == 0 and dic.get(su // 2, 0) > 0:
		ans.append(i + 1)
	dic[a[i]] += 1
	su += a[i]
print(len(ans))
print(*ans)


N = int(input())
A = list(map(int, input().split()))
B = sorted(A)
S = sum(A)
r = []
for i in range(N):
	m = B[-1] if A[i] != B[-1] else B[-2]
	if S - A[i] - m == m:
		r.append(i + 1)
print(len(r))
if r:
	print(' '.join(map(str, r)))


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)
	elif s - a[i] - maxi == maxi:
		answer.append(i + 1)
print(len(answer))
print(*answer)


n = int(input())
m = list(map(int, input().split()))
p = sorted(m, reverse=True)
l = sum(m)
j = []
for i in range(n):
	if p[0] == m[i]:
		if 2 * p[1] == l - m[i]:
			j.append(i + 1)
	elif 2 * p[0] == l - m[i]:
		j.append(i + 1)
print(len(j))
print(*j)


from collections import defaultdict
d = defaultdict(lambda : 0)
n = int(input())
a = [int(i) for i in input().split()]
k = 0
s = sum(a)
ans = []
for e in a:
	d[e] += 1
for i in range(n):
	t = s - a[i]
	if t % 2 == 0 and (t // 2 == a[i] and d[t // 2] > 1 or (t // 2 != a[i] and d[t // 2] >= 1)):
		k += 1
		ans.append(i + 1)
print(k)
if k:
	for e in ans:
		print(e, end=' ')


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)
m = max(a)
ind = a.index(m)
m1 = 0
for i in range(len(a)):
	if i != ind:
		if a[i] > m1:
			m1 = a[i]
b = []
for i in range(len(a)):
	if a[i] == m:
		s = s - a[i]
		if s == 2 * m1:
			b.append(i + 1)
		s += a[i]
	else:
		s = s - a[i]
		if s == 2 * m:
			b.append(i + 1)
		s += a[i]
if len(b) == 0:
	print(0)
else:
	print(len(b))
	print(*b)


n = int(input())
a = [int(i) for i in input().split()]
if n > 2:
	b = a[:]
	b.sort()
	fi = b[-1]
	se = b[-2]
	su = sum(a)
	tot = 0
	ind = []
	for i in range(len(a)):
		if a[i] != fi and su - a[i] == 2 * fi:
			tot += 1
			ind.append(i + 1)
		elif a[i] == fi:
			if su - a[i] == 2 * se:
				tot += 1
				ind.append(i + 1)
	print(tot)
	print(*ind)
else:
	print(0)
	print()


n = int(input())
a = [int(i) for i in input().split()]
(s, b) = (sum(a), sorted(a)[-2:])
k = [x for (x, y) in enumerate(a, 1) if s - y == 2 * b[y != b[1]]]
print(len(k))
print(*k)


import sys
import collections

def solve(array):

	def verify(i):
		num = array[i]
		csum = tsum - num
		if csum % 2 == 0:
			val = csum // 2
			if val == num and tdict[val] > 1 or (val != num and tdict[val] > 0):
				return True
		return False
	tsum = sum(array)
	tdict = collections.Counter(array)
	return [str(i + 1) for i in range(len(array)) if verify(i)]
n = int(sys.stdin.readline())
for line in sys.stdin:
	array = list(map(int, line.split()))
	out = solve(array)
	print(len(out))
	print(' '.join(out))


n = int(input())
arr = list(map(int, input().strip().split()))
mp = {}
s = 0
for i in range(n):
	if arr[i] not in mp:
		mp[arr[i]] = 1
	else:
		mp[arr[i]] += 1
	s += arr[i]
ans = []
for i in range(n):
	if (s - arr[i]) % 2 == 0:
		if (s - arr[i]) // 2 in mp:
			if mp[arr[i]] >= 2 or arr[i] != (s - arr[i]) // 2:
				ans.append(i + 1)
if ans == []:
	print(0)
else:
	print(len(ans))
	print(*ans)


n = int(input())
arr = list(map(int, input().split(' ')))
s = sum(arr)
maxV = max(arr)
count = [0] * (maxV + 1)
for i in arr:
	count[i] += 1
sol = []
for i in range(n):
	s -= arr[i]
	count[arr[i]] -= 1
	if s % 2 == 0:
		if s <= maxV * 2 and count[s // 2] > 0:
			sol.append(str(i + 1))
	s += arr[i]
	count[arr[i]] += 1
print(len(sol))
print(' '.join(sol))


import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
d = sorted(a)
b = sum(a)
c = []
for i in range(n):
	if a[i] == d[-1]:
		if (b - a[i]) % 2 == 0 and (b - a[i]) // 2 == d[-2]:
			c.append(i + 1)
	elif (b - a[i]) % 2 == 0 and (b - a[i]) // 2 == d[-1]:
		c.append(i + 1)
print(len(c))
print(*c)


n = int(input())
a = list(map(int, input().split()))
m = max(a)
cnt = [0] * (m + 1)
for i in a:
	cnt[i] += 1
summ = sum(a)
ans = []
for i in range(n):
	x = a[i]
	summ -= x
	cnt[x] -= 1
	if summ % 2 == 0:
		hlf = summ // 2
		if hlf <= m and cnt[hlf] > 0:
			ans.append(i + 1)
	summ += x
	cnt[x] += 1
print(len(ans))
print(*ans)


import os
import sys
from io import BytesIO, IOBase
from collections import Counter

def main():
	n = int(input())
	a = list(map(int, input().split()))
	b = Counter(a)
	z = sum(a)
	c = []
	for (i, v) in enumerate(a):
		z -= v
		b[v] -= 1
		if not z % 2:
			if b[z // 2]:
				c.append(i + 1)
		b[v] += 1
		z += v
	print(len(c))
	print(*c)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from math import ceil

def lmii():
	return list(map(int, input().split()))
n = int(input())
nums = lmii()
big = [-1, -1]
for i in nums:
	if i > big[0]:
		big[1] = int(big[0])
		big[0] = i
	elif i > big[1]:
		big[1] = i
tot = 0
for i in nums:
	tot += i
counter = 0
ans = []
for i in range(len(nums)):
	if nums[i] == big[0]:
		target = big[1]
	else:
		target = big[0]
	if tot - nums[i] - target == target:
		ans.append(i + 1)
		counter += 1
print(counter)
print(*ans)


n = int(input())
l = list(map(int, input().split()))
max1 = max(l)
second_max = 0
for i in range(n):
	if second_max < l[i] and l[i] != max1:
		second_max = l[i]
sum1 = sum(l)
ans = []
c = 0
if second_max == 0:
	second_max = max1
flag = 0
if l.count(max1) == 1:
	flag = 1
for i in range(n):
	sum2 = sum1 - l[i]
	if l[i] == max1 and flag == 1:
		max2 = second_max
	else:
		max2 = max1
	if sum2 - max2 == max2:
		c += 1
		ans.append(i + 1)
print(c)
if c != 0:
	for i in ans:
		print(i, end=' ')


from sys import stdin
n = int(input())
l = list(map(int, stdin.readline().rstrip().split(' ')))
s = 0
dic = {}
for i in range(n):
	x = dic.get(l[i], 0)
	if x:
		dic[l[i]] += 1
	else:
		dic[l[i]] = 1
	s = s + l[i]
r = []
c = 0
for i in range(n):
	t = s - l[i]
	if t % 2 == 0:
		check = dic.get(t // 2, 0)
		if t // 2 == l[i] and check > 1:
			c += 1
			r.append(i + 1)
		elif check and t // 2 != l[i]:
			c += 1
			r.append(i + 1)
if c:
	print(c)
	print(*r)
else:
	print(0)


import sys
from itertools import accumulate

def input():
	return sys.stdin.readline().strip()

def list2d(a, b, c):
	return [[c] * b for i in range(a)]

def list3d(a, b, c, d):
	return [[[d] * c for j in range(b)] for i in range(a)]

def list4d(a, b, c, d, e):
	return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]

def ceil(x, y=1):
	return int(-(-x // y))

def INT():
	return int(input())

def MAP():
	return map(int, input().split())

def LIST(N=None):
	return list(MAP()) if N is None else [INT() for i in range(N)]

def Yes():
	print('Yes')

def No():
	print('No')

def YES():
	print('YES')

def NO():
	print('NO')
INF = 10 ** 18
MOD = 10 ** 9 + 7

class SegTree:

	def __init__(self, n, func, intv, A=[]):
		self.n = n
		self.func = func
		self.intv = intv
		n2 = 1
		while n2 < n:
			n2 <<= 1
		self.n2 = n2
		self.tree = [self.intv] * (n2 << 1)
		if A:
			for i in range(n):
				self.tree[n2 + i] = A[i]
			for i in range(n2 - 1, -1, -1):
				self.tree[i] = self.func(self.tree[i * 2], self.tree[i * 2 + 1])

	def update(self, i, x):
		i += self.n2
		self.tree[i] = x
		while i > 0:
			i >>= 1
			self.tree[i] = self.func(self.tree[i * 2], self.tree[i * 2 + 1])

	def add(self, i, x):
		self.update(i, self.get(i) + x)

	def query(self, a, b):
		l = a + self.n2
		r = b + self.n2
		s = self.intv
		while l < r:
			if r & 1:
				r -= 1
				s = self.func(s, self.tree[r])
			if l & 1:
				s = self.func(s, self.tree[l])
				l += 1
			l >>= 1
			r >>= 1
		return s

	def get(self, i):
		return self.tree[i + self.n2]

	def all(self):
		return self.tree[1]

	def print(self):
		for i in range(self.n):
			print(self.get(i), end=' ')
		print()
N = INT()
A = LIST()
st = SegTree(N, max, 0, A)
sm = sum(A)
ans = []
for (i, a) in enumerate(A):
	st.update(i, 0)
	mx = st.all()
	sm -= a
	if sm - mx == mx:
		ans.append(i + 1)
	st.update(i, a)
	sm += a
print(len(ans))
print(*ans)


from sys import stdin
input = stdin.readline
n = int(input())
arr = [int(x) for x in input().split()]
d = {}
for i in range(n):
	if arr[i] in d:
		d[arr[i]].append(i)
	else:
		d[arr[i]] = [i]
ans = []
s = sum(arr)
for i in range(n):
	if arr[i] < s - arr[i]:
		x = s - arr[i] - arr[i]
		if x in d:
			for j in d[x]:
				if j != i:
					ans.append(j + 1)
s = set(ans)
ans = list(s)
print(len(ans))
print(*ans)


from collections import Counter
n = int(input())
a = [*map(int, input().split())]
(ans, s, c) = ([], sum(a), Counter(a))
for i in range(n):
	t = s - a[i]
	if not t & 1 and t // 2 in c:
		if c[t // 2] == 1:
			if t // 2 != a[i]:
				ans.append(i + 1)
		else:
			ans.append(i + 1)
print(len(ans))
print(' '.join(map(str, ans)))


input()
array = list(map(int, input().split(' ')))
sum_of_array = sum(array)
(second_max, first_max) = sorted(array)[-2:]
answer = []
for (index, each) in enumerate(array, 1):
	existing_sum = sum_of_array - each
	existing_max = second_max if each == first_max else first_max
	if existing_sum == existing_max * 2:
		answer.append(index)
print(len(answer))
print(*answer)


n = int(input())
a = [int(x) for x in input().split()]
m = max(a)
s = sum(a)
cnt = len([i for i in a if i == m])
mm = 0
for i in a:
	if i != m and i > mm:
		mm = i
ans = []
for i in range(len(a)):
	if a[i] == m:
		if cnt == 1:
			c = mm
		else:
			c = m
		if s - c - a[i] == c:
			ans.append(i + 1)
	elif s - m - a[i] == m:
		ans.append(i + 1)
print(len(ans))
print(' '.join([str(i) for i in ans]))


n = int(input())
arr = [int(i) for i in input().split()]
ans = 0
total = sum(arr)
sum_w_idx = []
value_appear = {}
for i in range(len(arr)):
	sum_w_idx.append(total - arr[i])
	if arr[i] in value_appear:
		value_appear[arr[i]].append(i)
	else:
		value_appear[arr[i]] = [i]
passs = {}
arr_ans = []
for i in range(len(sum_w_idx)):
	if sum_w_idx[i] in passs:
		ans += 1
		arr_ans.append(i + 1)
	elif sum_w_idx[i] % 2 == 0:
		val = sum_w_idx[i] // 2
		if val in value_appear:
			for v in value_appear[val]:
				if v != i:
					ans += 1
					passs[sum_w_idx[i]] = 1
					arr_ans.append(i + 1)
					break
if ans == 0:
	print(0)
else:
	print(ans)
	print(*arr_ans)


import sys

def fi():
	return sys.stdin.readline()
d = dict()
n = int(fi())
l = list(map(int, fi().split()))
s = sum(l)
for i in range(n):
	d.setdefault(l[i], [])
	d[l[i]].append(i + 1)
c = 0
ans = []
for (q, v) in d.items():
	a = (s - q) / 2
	b = len(v)
	b -= 1
	if d.get(a) and q != a or (q == a and b):
		c += b + 1
		ans.extend(v)
print(c)
print(*ans)


from collections import defaultdict
n = int(input())
l = list(map(int, input().split()))
s = sum(l)
ans = []
hash = defaultdict(int)
bash = defaultdict(list)
seti = set()
for i in range(n):
	hash[l[i]] += 1
	seti.add(l[i])
	bash[l[i]].append(i)
for i in range(n):
	z = s - l[i]
	if z % 2 == 0:
		if z // 2 in seti:
			if z // 2 != l[i]:
				ans.append(i + 1)
			elif hash[l[i]] > 1:
				ans.append(i + 1)
print(len(ans))
print(*ans)


import sys
import math
import collections
import operator as op
from collections import deque
from math import gcd, inf, sqrt, pi, cos, sin, ceil, log2, floor, log
from bisect import bisect_right, bisect_left, bisect
from functools import reduce
from sys import stdin, stdout, setrecursionlimit
setrecursionlimit(2 ** 20)

def ncr(n, r):
	r = min(r, n - r)
	numer = reduce(op.mul, range(n, n - r, -1), 1)
	denom = reduce(op.mul, range(1, r + 1), 1)
	return numer // denom

def prime_factors(n):
	i = 2
	factors = []
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.append(i)
	if n > 1:
		factors.append(n)
	return list(factors)

def isPowerOfTwo(x):
	return x and (not x & x - 1)
MOD = 1000000007
PMOD = 998244353
N = 10 ** 6
LOGN = 30
alp = 'abcdefghijklmnopqrstuvwxyz'
T = 1
for _ in range(T):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().rstrip().split()))
	A = a.copy()
	A.sort()
	b = []
	s = sum(a)
	for i in range(n):
		b.append([a[i], i + 1])
	b.sort()
	ans = []
	for i in range(n):
		if (s - a[i]) % 2 == 0:
			val = (s - a[i]) // 2
			x = bisect_left(A, val)
			if x == n:
				continue
			if A[x] == val and i + 1 != b[x][1]:
				ans.append(i + 1)
			elif x + 1 < n:
				if A[x + 1] == val:
					ans.append(i + 1)
	print(len(ans))
	print(*ans)


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) + ' '
		elif tot - store[x] == 2 * biggest:
			number += 1
			string += str(x + 1) + ' '
	print(number)
	print(string)
main()


n = int(input())
a = list(map(int, input().split()))
k = 0
s = ''
f = sum(a)
b = []
max1 = 0
max2 = 0
x = -1
for i in range(n):
	if a[i] >= max1:
		max2 = max1
		max1 = a[i]
	elif a[i] > max2:
		max2 = a[i]
for i in range(n):
	d = a[i]
	a[i] = 0
	if max1 != d:
		if max1 == f - max1 - d:
			b.append(i + 1)
			k += 1
	elif max2 == f - max2 - d:
		b.append(i + 1)
		k += 1
	a[i] = d
print(k)
print(*b)


N = int(input())
s = list(map(int, input().split()))
ori = s[:]
s.sort()
sm = sum(s)
ans = []
A = []
for i in range(N - 1):
	if sm - s[i] - s[-1] == s[-1]:
		ans.append(s[i])
if sm - s[-1] - s[-2] == s[-2]:
	ans.append(s[-1])
for i in range(N):
	if ori[i] in ans:
		A.append(i + 1)
print(len(A))
print(*A)


n = int(input())
if n == 1:
	print(0)
	exit()
inp = input().split(' ')
for i in range(n):
	inp[i] = int(inp[i])
mx = inp[0]
mxind = 0
mx2 = inp[1]
s = 0
for i in range(n):
	if inp[i] > mx:
		mx2 = mx
		mx = inp[i]
		mxind = i
	elif inp[i] > mx2 and i != mxind:
		mx2 = inp[i]
	s += inp[i]
sum = [0 for i in range(n)]
mxit = [0 for i in range(n)]
for i in range(n):
	sum[i] = s - inp[i]
	if inp[i] == mx:
		mxit[i] = mx2
	else:
		mxit[i] = mx
cnt = 0
ans = []
for i in range(n):
	if sum[i] - mxit[i] == mxit[i]:
		cnt += 1
		ans.append(i + 1)
print(cnt)
joined_string = ' '.join([str(v) for v in ans])
print(joined_string)


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()))
k = []
total = 0
d = {}
for i in range(n):
	total += a[i]
	if not a[i] in d:
		d[a[i]] = 0
	d[a[i]] += 1
for i in range(n):
	if (total - a[i]) % 2 == 0:
		result = (total - a[i]) / 2
		try:
			if d[result]:
				if result == a[i] and d[result] > 1:
					k.append(i + 1)
				elif result != a[i]:
					k.append(i + 1)
		except:
			pass
print(len(k))
if len(k):
	print(*k)


n = int(input())
a = list(map(int, input().split()))
sum = 0
maxx = -1
submax = -1
for i in range(n):
	sum += a[i]
	if maxx == -1 or a[i] > a[maxx]:
		submax = maxx
		maxx = i
	elif submax == -1 or a[i] > a[submax]:
		submax = i
ans = 0
b = []
for i in range(n):
	if i == maxx:
		if sum - a[i] == a[submax] * 2:
			b.append(i + 1)
			ans += 1
	elif sum - a[i] == a[maxx] * 2:
		b.append(i + 1)
		ans += 1
print(ans)
for i in range(ans):
	print(b[i], end=' ')
print()


n = int(input())
a = [int(x) for x in input().split()]
summ = sum(a)
ans = []
q = sorted(a)
maks = q[-1]
maks2 = q[-2]
for i in range(n):
	cout = maks
	if a[i] == maks:
		cout = maks2
	if summ - a[i] == 2 * cout:
		ans.append(i + 1)
print(len(ans))
print(*ans)