#include <bits/stdc++.h>
using namespace std;
int win[55], cont[55];
int main() {
  int n;
  cin >> n;
  for (int i = 0, u, v; i < n * (n - 1) / 2 - 1; i++) {
    cin >> u >> v;
    win[u]++, cont[u]++, cont[v]++;
  }
  int u = 0, v;
  for (int i = 1; i <= n; i++) {
    if (cont[i] == n - 2 && u == 0) u = i;
    if (cont[i] == n - 2) v = i;
  }
  if (win[u] > win[v])
    cout << u << " " << v;
  else
    cout << v << " " << u;
}
