#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
#define rep(i,n) for(int i = 0;i < n;i++)
#define REP(i,n,k) for(int i = n;i < k;i++)
#define P(p) cout<<(p)<<endl;
#define pi 3.1415926535
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int dx[] = { 0, 1, 0, -1 };
int dy[] = { -1, 0, 1, 0 };

unsigned long long sttoi(std::string str) {
	unsigned long long ret;
	std::stringstream ss; ss << str;
	ss >> ret;
	return ret;
}

ll gcd(ll a, ll b){
	if (b > a)swap(a, b);
	if (b == 0) return a;
	return gcd(b, a%b);
}
int T[100000], D[100000],N[100000];
int srt(int x, int y){
	return (D[y] * T[x] > D[x] * T[y]);
}
void solve() {
	int n;
	cin >> n;
	rep(i, n)cin >> T[i];
	rep(i, n)cin >> D[i];
	rep(i, n)N[i] = i;
	sort(N, N + n, srt);
	for (int i = 0; i < n; i++){
		cout << N[i]+1;
		if (i != n - 1)cout << " ";
	}
	cout << endl;
}

int main() {
	solve();
	return 0;
}