#include <bits/stdc++.h>
using namespace std;
int n;
int a[500];
int win[500];
vector<int> sol;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  int q = (n * n - n) / 2;
  q--;
  int t1, t2;
  while (q--) {
    cin >> t1 >> t2;
    win[t1]++;
    a[t1]++, a[t2]++;
  }
  for (int i = 1; i <= n; i++)
    if (a[i] != n - 1) sol.push_back(i);
  if (win[sol[0]] < win[sol[1]]) swap(sol[0], sol[1]);
  cout << sol[0] << " " << sol[1];
  return 0;
}
