// https://szkopul.edu.pl/problemset/problem/E0BY-XMtZxZOgcAcQL1_eIab/site/?key=statement
#include <algorithm>
#include <iostream>
#include <vector>
constexpr int MILION = 1000 * 1000;
struct Object {
double a, b;
int i;
Object(double a, double b, int i) {
this->a = a;
this->b = b;
this->i = i;
}
};
int main() {
std::ios_base::sync_with_stdio(0);
std::cin.tie(0);
std::cout.tie(0);
int n;
std::cin >> n;
std::vector<Object> v;
for (int i = 0; i < n; i++) {
double a, b;
std::cin >> a >> b;
// Object o(a, b, i + 1);
v.push_back({a * 10 * MILION, b * 10 * MILION, i + 1});
}
std::sort(v.begin(), v.end(), [](Object o1, Object o2) { return o1.a / o1.b <= o2.a / o2.b; });
for (int i = v.size() - 1; i >= 0; i--) {
std::cout << v[i].i << '\n';
}
return 0;
}