#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <sstream>
#include <string>
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define var auto
#define mod 1000000007
#define inf 2147483647
#define nil -1
#define mp make_pair
typedef long long ll;
using namespace std;

template <typename T>
inline void output(T a, int p) {
    if(p){
        cout << fixed << setprecision(p)  << a << "\n";
    }
    else{
        cout << a << "\n";
    }
}
// end of template

bool Comp(pair<pair<int, int>, int> x, pair<pair<int, int>, int> y){
    return x.first.first * y.first.second > x.first.second * y.first.first;
}

int main() {
    cin.tie(0);
    // source code
    int N;
    cin >> N;
    vector<pair<pair<int, int>, int>> A(N);
    rep(i, N) cin >> A[i].first.first;
    rep(i, N) cin >> A[i].first.second;
    rep(i, N) A[i].second = i + 1;
    sort(A.begin(), A.end(), Comp);
    rep(i, N){
        if (i) cout << " ";
        cout << A[i].second;
    }
    cout << endl;
    
    return 0;
}