실버5 문제
answer = []
for i in range(8):
num = int(input())
answer.append([num, i+1])
answer.sort()
answer = answer[3:]
answer.sort(key = lambda x:x[1])
ssum = 0
for j in answer:
ssum += j[0]
print(ssum)
for k in answer:
print(k[1], end=" ")
arr = []
result = []
ssum = 0
for _ in range(8):
arr.append(int(input()))
for i in range(5):
ssum = ssum + max(arr)
idx = arr.index(max(arr))
result.append(idx+1)
arr[idx] = 0
print(ssum)
print(*(sorted(result)))