#include <bits/stdc++.h>
using namespace std;
int a[52][52];
int n, i, j, s1, s2, x, y;
int main() {
  cin >> n;
  for (i = 1; i < n * (n - 1) / 2; i++) {
    cin >> x >> y;
    a[x][y] = 2;
    a[y][x] = 1;
  }
  x = 0;
  y = 0;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++)
      if (i != j && a[i][j] == 0) {
        x = i;
        y = j;
        break;
      }
    if (x != 0) break;
  }
  for (i = 1; i <= n; i++) {
    if (a[x][i] == 2) s1++;
    if (a[y][i] == 2) s2++;
  }
  if (s1 > s2)
    cout << x << ' ' << y << endl;
  else
    cout << y << ' ' << x << endl;
}
