# -*- coding: utf-8 -*- import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll N = int(raw_input()) T = map(int, raw_input().split()) D = map(int, raw_input().split()) s = sum(D) TD = zip(T, D, range(N)) TD = sorted(sorted(TD, key = lambda x:x[1]), key = lambda x:x[0]*(s - x[1]), reverse = True) print " ".join(map(str, [TD[i][2] + 1 for i in xrange(N)]))