#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
struct v{
double a, b;
int idx;
}a[10005];
int n;
bool cmp(v a, v b){
return a.a * b.b > b.a * a.b;
}
int main(){
cin >> n;
for(int i=1; i<=n; i++){
scanf("%lf %lf",&a[i].a, &a[i].b);
a[i].idx = i;
}
sort(a+1, a+n+1, cmp);
for(int i=1; i<=n; i++) printf("%d\n", a[i].idx);
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CnR5cGVkZWYgbG9uZyBsb25nIGxpbnQ7CgpzdHJ1Y3QgdnsKCWRvdWJsZSBhLCBiOwoJaW50IGlkeDsKfWFbMTAwMDVdOwoKaW50IG47Cgpib29sIGNtcCh2IGEsIHYgYil7CglyZXR1cm4gYS5hICogYi5iID4gYi5hICogYS5iOwp9CgppbnQgbWFpbigpewoJY2luID4+IG47Cglmb3IoaW50IGk9MTsgaTw9bjsgaSsrKXsKCQlzY2FuZigiJWxmICVsZiIsJmFbaV0uYSwgJmFbaV0uYik7CgkJYVtpXS5pZHggPSBpOwoJfQoJc29ydChhKzEsIGErbisxLCBjbXApOwoJZm9yKGludCBpPTE7IGk8PW47IGkrKykgcHJpbnRmKCIlZFxuIiwgYVtpXS5pZHgpOwp9Cg==