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