#include "bits/stdc++.h" using namespace std; #define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i)) #define rep(i,j) FOR(i,0,j) #define each(x,y) for(auto &(x):(y)) #define mp make_pair #define all(x) (x).begin(),(x).end() #define debug(x) cout<<#x<<": "<<(x)< pii; typedef vector vi; typedef vector vll; typedef tuple TP; int N, T[100000], D[100000]; bool cmp(int a, int b){ int x = T[a] * D[b]; int y = T[b] * D[a]; return x > y; } int main(){ while(cin >> N){ rep(i, N)scanf("%d", &T[i]); rep(i, N)scanf("%d", &D[i]); vi id(N); iota(all(id), 0); sort(all(id), cmp); rep(i, N)printf("%d%c", id[i] + 1, i == N - 1 ? '\n' : ' '); } }