#include <bits/stdc++.h>
using namespace std;
int play[55], win[55];
int main() {
  int n, a, b;
  cin >> n;
  for (int i = 0; i < (n * (n - 1)) / 2 - 1; i++) {
    cin >> a >> b;
    play[a]++;
    play[b]++;
    win[a]++;
  }
  int fs, sc;
  bool f = true;
  for (int i = 1; i <= n; i++) {
    if (play[i] != n - 1) {
      if (f) {
        fs = i;
        f = false;
      } else
        sc = i;
    }
  }
  if (win[fs] > win[sc])
    cout << fs << " " << sc << '\n';
  else
    cout << sc << " " << fs << '\n';
  return 0;
}
