#include using namespace std; using namespace chrono; #if __has_include() #include using namespace atcoder; #endif int main() { int64_t n; cin >> n; vector as(n), bs(n); for (int64_t i = 0; i < n; i++) { cin >> as[i] >> bs[i]; } int64_t c = 500000000000000000LL; vector us, vs; for (int64_t t = 0; t < 50; t++) { for (int64_t i = 0; i < n; i++) { for (int64_t j = i + 1; j < n; j++) { if ((as[i] < c) != (as[j] < c) && (bs[i] < c) != (bs[j] < c)) { int64_t x = (as[i] + as[j]) / 2; int64_t y = (bs[i] + bs[j]) / 2; as[i] = as[j] = x; bs[i] = bs[j] = y; us.push_back(i + 1); vs.push_back(j + 1); goto next; } } } next:; } cout << us.size() << endl; for (int64_t i = 0; i < us.size(); i++) { cout << us[i] << ' ' << vs[i] << endl; } return 0; }