#!/usr/bin/python from collections import namedtuple n = int(raw_input()) t = map(float, raw_input().split()) d = map(float, raw_input().split()) T = namedtuple('T', 'iD, time, difficulty') arr = [T(i+1, t[i], d[i]) for i in xrange(n)] arr.sort(key=lambda x: x.time/x.difficulty, reverse=1) print ' '.join(map(str, (x.iD for x in arr)))