#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, fop, sop, x, y, temp;
  cin >> n;
  bool check = false;
  temp = ((n * (n - 1)) / 2) - 1;
  int *wins = new int[n];
  int *played = new int[n];
  for (int i = 0; i < n; i++) {
    wins[i] = 0;
    played[i] = 0;
  }
  for (int i = 0; i < temp; i++) {
    cin >> x >> y;
    wins[x - 1]++;
    played[x - 1]++;
    played[y - 1]++;
  }
  for (int i = 0; i < n; i++) {
    if (!check && played[i] != n - 1) {
      fop = i + 1;
      check = true;
    } else if (check && played[i] != n - 1) {
      sop = i + 1;
    }
  }
  if (wins[fop - 1] > wins[sop - 1]) {
    cout << fop << " " << sop;
  } else if (wins[sop - 1] >= wins[fop - 1]) {
    cout << sop << " " << fop;
  }
  return 0;
}
