#include "bits/stdc++.h" using namespace std; int main() { int N; pair P[10]; cin >> N; for (int i = 0; i < N; i++) { double A, B; cin >> A >> B; P[i] = { A, B }; } sort(P, P + N, [&](pair P1, pair P2) {return (P1.first / P1.second) > (P2.first / P2.second); }); for (int i = 0; i < N; i++) { cout << P[i].first << " " << P[i].second << endl; } }