#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y;
  scanf("%d", &n);
  set<int> s;
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &x, &y), x--, y--;
    s.emplace(x);
    s.emplace(y);
  }
}
