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