#include #define int long long using namespace std; signed main() { int N; cin>>N; std::vector A(N),B(N); for(int i=0;i>A[i]>>B[i]; map m; std::vector v(N); for(int i=0;i ans(N); int l=0; for(int i=0;i=0;i--)cout<