#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y;
  scanf("%d", &n);
  vector<int> g[59];
  vector<int> cont(59, 0);
  vector<bool> esta(59, false);
  int num = n;
  n = (n * (n - 1)) / 2;
  for (int i = 1; i < n; i++) {
    scanf("%d %d", &x, &y);
    g[x].push_back(y);
    cont[x]++;
    cont[y]++;
    esta[x] = esta[y] = true;
  }
  int a = 0, b = 0;
  for (int i = 1; i < 59; i++) {
    if (esta[i] and cont[i] == num - 2) {
      if (a == 0)
        a = i;
      else
        b = i;
    }
  }
  vector<bool> v(59, false);
  queue<int> q;
  v[a] = true;
  q.push(a);
  while (!q.empty()) {
    x = q.front();
    q.pop();
    for (int i = 0; i < (int)g[x].size(); i++) {
      y = g[x][i];
      if (v[y] == false) {
        v[y] = true;
        q.push(y);
      }
    }
  }
  if (v[b] == false) swap(a, b);
  printf("%d %d\n", a, b);
}
