#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<vector<int>> xy(n * (n - 1) / 2 - 1, vector<int>(2));
  vector<int> f(n, 0);
  for (int i = 0; i < xy.size(); i++) {
    cin >> xy[i][0] >> xy[i][1];
    f[xy[i][0] - 1]++;
    f[xy[i][1] - 1]++;
  }
  vector<int> ans;
  for (int i = 0; i < n; i++) {
    if (f[i] != n - 1) {
      ans.push_back(i + 1);
    }
  }
  set<int> s;
  for (int i = 0; i < xy.size(); i++) {
    if (xy[i][0] == ans[1]) {
      s.insert(xy[i][1]);
    }
  }
  int x = 0;
  for (int i = 0; i < xy.size(); i++) {
    if (s.count(xy[i][0]) != 0 and xy[i][1] == ans[0]) {
      x++;
      break;
    }
  }
  if (x == 0) {
    cout << ans[0] << " " << ans[1];
  } else {
    cout << ans[1] << " " << ans[0];
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int t = 1;
  while (t--) {
    solve();
    cout << "\n";
  }
  return 0;
}
