#include <bits/stdc++.h>
using namespace std;
int match[1001];
string second[101][101];
int main() {
  int n, i, j, k, x, y, a, b;
  cin >> n;
  k = n * (n - 1) / 2 - 1;
  for (i = 0; i < k; i++) {
    cin >> x >> y;
    match[x]++;
    match[y]++;
    second[x][y] = "w";
    second[y][x] = "l";
  }
  bool ok = 0;
  for (i = 1; i <= n; i++) {
    if (!ok && match[i] < n - 1) {
      a = i;
      ok = 1;
    } else if (match[i] < n - 1) {
      b = i;
      break;
    }
  }
  for (i = 1; i <= n; i++) {
    if (second[a][i] == "w" && second[b][i] == "l") {
      cout << a << ' ' << b;
      break;
    } else if (second[a][i] == "l" && second[b][i] == "w") {
      cout << b << ' ' << a;
      break;
    }
  }
  if (i == n + 1) cout << a << ' ' << b;
}
