#include <bits/stdc++.h>
using namespace std;
clock_t time_p = clock();
void timer() {
  time_p = clock() - time_p;
  cerr << "Execution Time: " << (float)(time_p) / CLOCKS_PER_SEC << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, x, y;
  cin >> n;
  long long nn = n * (n - 1) / 2 - 1;
  long long play[55], won[55];
  memset(play, 0, sizeof play);
  memset(won, 0, sizeof won);
  for (long long i = 0; i < nn; i++) {
    cin >> x >> y;
    play[x]++;
    play[y]++;
    won[x]++;
  }
  bool one = false;
  for (long long i = 1; i <= n; i++) {
    if (play[i] == n - 2) {
      if (one) {
        y = i;
        break;
      } else {
        x = i;
        one = true;
      }
    }
  }
  if (won[x] <= won[y])
    cout << y << " " << x;
  else
    cout << x << " " << y;
  timer();
  return 0;
}
