#include using namespace std; typedef long long ll; typedef vector vi; typedef vector vl; typedef complex P; typedef pair pii; #define REP(i,n) for(ll i=0;i> n; vl t(n),d(n); REP(i,n) cin>>t[i]; REP(i,n) cin>>d[i]; // maximize sigma_{i=0}^{n-1} sigma_{j=i+1}^{n-1} t[i]*d[j] vector< pair > a(n); REP(i,n){ a[i] = make_pair((double)d[i]/(double)t[i],i+1); } sort(ALL(a)); cout << a[0].second; REPR(i,n){ cout << " " << a[i].second; } cout << endl; return 0; }