#include <bits/stdc++.h>
using namespace std;
vector<int> v[51];
int f1 = -1, f2, visited[51] = {0};
bool flag = false;
int dfs(int index) {
  visited[index] = 1;
  if (index == f2) flag = true;
  for (int i = 0; i < v[index].size(); ++i) {
    int j = v[index].at(i);
    if (visited[j] == 0) dfs(j);
  }
  return 0;
}
int main() {
  int n;
  cin >> n;
  int x, y, nm[51] = {0};
  for (int i = 0; i < (n * (n - 1)) / 2 - 1; ++i) {
    cin >> x >> y;
    nm[x]++;
    nm[y]++;
    v[x].push_back(y);
  }
  for (int i = 1; i <= n; ++i) {
    if (nm[i] != n - 1) {
      if (f1 == -1)
        f1 = i;
      else
        f2 = i;
    }
  }
  dfs(f1);
  if (flag)
    cout << f1 << " " << f2;
  else
    cout << f2 << " " << f1;
  return 0;
}
