#44415: python AC(小心要去掉字串的括號)


suyueh (suyueh)

學校 : 不指定學校
編號 : 272111
來源 : [125.228.45.241]
最後登入時間 :
2025-06-02 18:21:06

t=int(input())
l=input().split()
m=input().split()
lc=[]
lm=[]
for i in range(t):
  if int(l[i])>int(m[i]):
    lc.append(i+1)
  elif int(l[i])<int(m[i]):
    lm.append(i+1)
x=' '.join(str(z) for z in lc)
y=' '.join(str(z) for z in lm)
if len(lc)==0 and len(lm)==0:
  print(-1)
  print(-1)
elif len(lc)==0 and len(lm)!=0:
  print(-1)
  print(y)
elif len(lc)!=0 and len(lm)==0:
  print(x)
  print(-1)
else:
  print(x)
  print(y)