#include <bits/stdc++.h>
using namespace std;
int game[51];
int main() {
  int n;
  cin >> n;
  int games = (n * (n - 1) / 2);
  vector<pair<int, int> > v;
  for (int i = 1; i < games; i++) {
    int a, b;
    cin >> a >> b;
    game[a]++;
    game[b]++;
    v.push_back(make_pair(a, b));
  }
  bool first = true, second = false;
  int a, b;
  for (int i = 1; i <= n; i++) {
    if (game[i] != (n - 1) && first) {
      a = i;
      first = false;
      second = true;
      continue;
    }
    if (game[i] != (n - 1) && second) {
      b = i;
      second = false;
    }
  }
  for (int i = 0; i < v.size(); i++) {
    if (v[i].first == a) {
      for (int j = 0; j < v.size(); j++) {
        if (v[i].second == v[j].first && v[j].second == b) {
          cout << a << " " << b;
          return 0;
        }
      }
    }
  }
  cout << b << " " << a;
}
