#include <bits/stdc++.h>
using namespace std;
int ind[100], mark[100];
vector<int> ve[100];
set<pair<int, int> > seti;
int main() {
  int n, m;
  cin >> n;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (i != j) seti.insert(pair<int, int>(i, j));
  for (int i = 0; i < n * (n - 1) / 2 - 1; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    ve[u].push_back(v);
    ind[v]++;
    seti.erase(pair<int, int>(u, v));
    seti.erase(pair<int, int>(v, u));
  }
  int x = (*seti.begin()).first, y = (*seti.begin()).second;
  int t = 0;
  ve[y].push_back(x);
  ind[x]++;
  for (int i = 0; i < n; i++) {
    if (mark[i] <= 0 && ind[i] == 0) {
      mark[i] = 1;
      t++;
      for (int j = 0; j < ve[i].size(); j++) ind[ve[i][j]]--;
      i = -1;
    }
  }
  if (t < n)
    cout << x + 1 << ' ' << y + 1 << endl;
  else
    cout << y + 1 << ' ' << x + 1 << endl;
}
