#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t, p1, p2;
  cin >> n;
  t = (n * (n - 1)) / 2;
  t--;
  vector<pair<int, int> > x(n + 1);
  while (t--) {
    cin >> p1 >> p2;
    x[p1].first++;
    x[p1].second++;
    x[p2].first++;
  }
  int min = 1000, minind = 10000, min2 = 1000, minind2 = 1000;
  for (int i = int(1); i < int(n + 1); i++) {
    if (x[i].first < min) {
      min = x[i].first;
      minind = i;
    }
  }
  for (int i = int(1); i < int(n + 1); i++) {
    if (x[i].first < min2 && i != minind) {
      min2 = x[i].first;
      minind2 = i;
    }
  }
  if (x[minind].second > x[minind2].second)
    cout << minind << " " << minind2 << endl;
  else
    cout << minind2 << " " << minind << endl;
  return 0;
}
