#include <bits/stdc++.h>
using namespace std;
int w[100];
int l[100];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  for (int i = 0; i < n * (n - 1) / 2 - 1; i++) {
    int x, y;
    cin >> x >> y;
    w[x]++;
    l[y]++;
  }
  vector<int> ans;
  for (int i = 1; i <= n; i++) {
    if (w[i] + l[i] < n - 1) {
      ans.push_back(i);
    }
  }
  if (w[ans[0]] > w[ans[1]]) {
    cout << ans[0] << " " << ans[1];
  } else {
    cout << ans[1] << " " << ans[0];
  }
  return 0;
}
