#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int t = (n * (n - 1)) / 2 - 1;
  vector<int> freq(n + 1, 0);
  vector<int> winner(n + 1, 0);
  for (int i = 0; i < t; i++) {
    int x, y;
    cin >> x >> y;
    winner[x]++;
    freq[x]++;
    freq[y]++;
  }
  vector<int> missing;
  for (int i = 1; i < n + 1; i++) {
    if (freq[i] == n - 2) missing.push_back(i);
  }
  if (winner[missing[0]] > winner[missing[1]])
    cout << missing[0] << " " << missing[1];
  else
    cout << missing[1] << " " << missing[0];
}
