#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> vt(60);
  vector<int> ft(60);
  vector<int> rt(60);
  int lt = n * (n - 1) / 2;
  for (int i = 1; i <= lt - 1; i++) {
    int l, r;
    cin >> l >> r;
    vt[l]++;
    vt[r]++;
    ft[l]++;
    rt[r]++;
  }
  int count = 0, s, ct;
  for (int i = 1; i <= n; i++) {
    if (vt[i] != n - 1 && count == 0) {
      s = i;
      count = 1;
      continue;
    }
    if (vt[i] != n - 1 && count == 1) {
      ct = i;
      break;
    }
  }
  if (ft[ct] == ft[s])
    cout << ct << " " << s << endl;
  else {
    if (ft[ct] > ft[s])
      cout << ct << " " << s << endl;
    else
      cout << s << " " << ct << endl;
  }
}
