#!/usr/bin/python n = int(raw_input()) a = map(int, raw_input().split()) b = map(int, raw_input().split()) answer = list(range(n)) def comp(x, y): A = a[x] * b[y] + 1 B = a[y] * b[x] - 1 if A < B: return -1 elif A > B: return +1 else: return 0 answer.sort(cmp=comp, reverse=True) print(' '.join(str(x + 1) for x in answer))