#include <bits/stdc++.h>
using namespace std;
int s[51];
int main() {
  int n, g, check = 0, t = 0, q = 0;
  cin >> n;
  g = (n * (n - 1)) / 2;
  pair<int, int> can[g - 1];
  for (int i = 0; i < g - 1; i++) {
    cin >> can[i].first >> can[i].second;
    s[can[i].first]++;
    s[can[i].second]++;
  }
  for (int i = 1; i <= n; i++) {
    if (s[i] < n - 1) {
      if (t == 0)
        t = i;
      else
        q = i;
    }
  }
  for (int i = 0; i < g; i++) {
    if (can[i].first == t) {
      check = 1;
      for (int r = 0; r < g; r++) {
        if (can[r].first == can[i].second && can[r].second == q) {
          cout << t << " " << q;
          return 0;
        }
      }
    }
  }
  if (check == 0) {
    cout << q << " " << t;
    return 0;
  }
  for (int i = 0; i < g; i++) {
    if (can[i].first == q) {
      for (int r = 0; r < g; r++) {
        if (can[r].first == can[i].second && can[r].second == t) {
          cout << q << " " << t;
          return 0;
        }
      }
    }
  }
  cout << t << " " << q;
}
