#include #include using ll = long long; using ull = unsigned long long; #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define REP(i, m, n) for(int i = (int)(m); i < (int)(n); i++) using namespace std; using namespace atcoder; using mint = modint998244353; const int inf = 1000000007; const ll longinf = 1ll << 60; double calculate_score(ll x) { return 2000000 - 100000 * log10(abs(x - (ll)5e17) + 1); } void output(vector> &query) { for(auto [l, r] : query) { cout << l + 1 << " " << r + 1 << endl; } } void do_query(vector &a, vector &b, int i, int j) { ll x = (a[i] + a[j]) / 2; ll y = (b[i] + b[j]) / 2; a[i] = a[j] = x; b[i] = b[j] = y; } int main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n; cin >> n; vector a(n), b(n); rep(i, n) cin >> a[i] >> b[i]; vector> query; rep(_, 50) { double best = 0, idx = -1; REP(j, 1, n) { ll x = (a[0] + a[j]) / 2; ll y = (b[0] + b[j]) / 2; double ret = calculate_score(x) + calculate_score(y); if(ret > best) { best = ret; idx = j; } } query.push_back({0, idx}); do_query(a, b, 0, idx); } output(query); cerr << 50 * min(calculate_score(a[0]), calculate_score(b[0])) << endl; return 0; }