#include <bits/stdc++.h>
using namespace std;
int i, j, temp;
void solve() {
  int n;
  cin >> n;
  int N = (n) * (n - 1) / 2;
  N--;
  vector<int> v[60];
  vector<int> cnt[60];
  int x, y;
  for (i = 0; i < N; i++) {
    cin >> x >> y;
    v[x].push_back(y);
    cnt[x].push_back(y);
    cnt[y].push_back(x);
  }
  int total = n - 1;
  int flag = 0, xs = 0, ys = 0;
  for (i = 1; i < n + 1; i++) {
    int crt = cnt[i].size();
    if (crt < total) {
      if (flag == 0) {
        x = i;
        flag = 1;
        xs = v[i].size();
      } else {
        y = i;
        ys = v[i].size();
      }
    }
  }
  if (xs > ys) {
    cout << x << " " << y << endl;
  } else {
    cout << y << " " << x << endl;
  }
}
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
}
