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