#include <bits/stdc++.h>
using namespace std;
int64_t win[51];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int64_t n;
  cin >> n;
  set<pair<int64_t, int64_t> > s;
  for (int64_t i = 0; i < (n * (n - 1)) / 2 - 1; ++i) {
    int64_t x, y;
    cin >> x >> y;
    s.emplace(x, y);
    win[x]++;
  }
  for (int64_t i = 1; i <= n; ++i) {
    for (int64_t j = 1; j <= n; ++j) {
      if (i == j) continue;
      if (s.count(make_pair(i, j)) or s.count(make_pair(j, i))) {
        continue;
      } else {
        if (win[i] >= win[j])
          return cout << i << ' ' << j, 0;
        else
          return cout << j << ' ' << i, 0;
      }
    }
  }
}
