#include using namespace std; #define all(v) v.begin(),v.end() using ll = long long; using ull = unsigned long long; using vll=vector; using vvll = vector>; using P = pair; using vp=vector>; const ll INF=1ll<<60; ll mod10=1e9+7; ll mod99=998244353; const double PI = acos(-1); #define rep(i,n) for (ll i=0;i=0;--i) #define rep2(i,a,n) for (ll i=a;i=n;--i) int main(){ ll N; cin>>N; cout << N/2 << endl; vector> A(N); rep(i,N){ ll a,b; cin>>a>>b; A[i]={a,b,i}; } sort(all(A)); rep(i,N/2){ ll a,b,c; tie(a,b,c)=A[2*i]; ll d; tie(a,b,d)=A[2*i+1]; cout<