#include <iostream>
#include <list>
using namespace std;
int main()
{
int n,i,v1,v2;
cin >> n;
list<int> * A;
A = new list<int> [n];
for(i = 0; i < n; i++)
{
cin >> v1 >> v2;
A[v1].push_back(v2);
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bGlzdD4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpCnsKICBpbnQgbixpLHYxLHYyOwogIGNpbiA+PiBuOwoKICBsaXN0PGludD4gKiBBOwogIEEgPSBuZXcgbGlzdDxpbnQ+IFtuXTsKCiAgZm9yKGkgPSAwOyBpIDwgbjsgaSsrKQogIHsKICAgIGNpbiA+PiB2MSA+PiB2MjsKICAgIEFbdjFdLnB1c2hfYmFjayh2Mik7CiAgfQogIHJldHVybiAwOwp9