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