根据题意模拟即可
n = int(input())
l = [int(i) for i in input().split()]
l2 = []
index = 1
for i in l:
l2.append((i,index))
index += 1
l2.sort(key=lambda x:-x[0])
max1 = 0
schoice = None
for i in range(len(l2)):
temp = (i+1)*(i+1)*l2[i][0]
if temp > max1:
max1 = temp
schoice = i
l3 = []
for i in range(schoice+1):
l3.append(l2[i][1])
l3.sort()
print(schoice+1)
print(' '.join(map(str,l3)))