#include <bits/stdc++.h>
using namespace std;
int games[60][60];
int winsto[60][60];
bool getsToWinTo(int i, int j) {
  for (int ii = 1; ii <= 60; ii++) {
    if (winsto[i][ii] && winsto[ii][j]) return true;
  }
  return false;
}
int main() {
  int n;
  cin >> n;
  int a, b;
  memset(games, 0, sizeof(games));
  int t = n * (n - 1);
  t /= 2;
  t--;
  for (int i = 0; i < t; i++) {
    cin >> a >> b;
    games[a][b] = 1;
    games[b][a] = 1;
    winsto[a][b] = 1;
  }
  bool done = false;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (i == j) continue;
      if (!games[i][j]) {
        if (getsToWinTo(i, j))
          printf("%d %d", i, j);
        else
          printf("%d %d", j, i);
        return 0;
      }
    }
    if (done) break;
  }
  return 0;
}
