#include <bits/stdc++.h>
using namespace std;
int cnt[55], dis[55];
vector<int> T[55];
bool find(int root, int target) {
  if (root == target) {
    return dis[root] = true;
  }
  if (dis[root] != -1) return dis[root];
  if (T[root].size() == 0) return false;
  bool flag = false;
  for (int i = 0; i < T[root].size(); i++) {
    flag = (flag || find(T[root][i], target));
  }
  return dis[root] = flag;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n * (n - 1) / 2 - 1; i++) {
    int a, b;
    cin >> a >> b;
    cnt[a]++;
    cnt[b]++;
    T[a].push_back(b);
  }
  int x[2], pos = 0;
  for (int i = 1; i <= n; i++) {
    if (cnt[i] < n - 1) x[pos++] = i;
  }
  memset(dis, -1, sizeof(dis));
  if (find(x[0], x[1]))
    cout << x[0] << ' ' << x[1];
  else
    cout << x[1] << ' ' << x[0];
  return 0;
}
