#include <bits/stdc++.h>
using namespace std;
int n, ind[2], num[2][100];
int main() {
  cin >> n;
  for (int i = 1; i < n * (n - 1) / 2; i++) {
    int x, y;
    cin >> x >> y;
    num[0][x]++;
    num[1][y]++;
  }
  for (int i = 1, k = 0; i <= n; i++) {
    if (num[0][i] + num[1][i] < n - 1) {
      ind[k] = i;
      k++;
    }
  }
  if (num[0][ind[0]] > num[0][ind[1]])
    cout << ind[0] << " " << ind[1] << endl;
  else
    cout << ind[1] << " " << ind[0] << endl;
  return 0;
}
