#45478: #2023年4月TOI新手組 第二題


chen971023@gmail.com (ZiaynGZiyaNG)

學校 : 國立臺南第二高級中學
編號 : 291750
來源 : [122.121.172.45]
最後登入時間 :
2025-10-01 23:36:53

#2023年4月TOI新手組 第二題
# AC
n = int(input())
cc = []
mc = []

chinese = list(map(int, input().split()))
math = list(map(int, input().split()))

for j in range (n):
  if (chinese[j] > math[j]):
    cc.append(j + 1)
  else:
    mc.append(j + 1)

if (len(cc) == 0):
  print(-1)
else:
  print(" ".join(map(str, cc)))
if (len(mc) == 0):
  print(-1)
else:
  print(" ".join(map(str, mc)))