#include <bits/stdc++.h>
using namespace std;
const int maxn = 100;
vector<int> Q[maxn];
int cnt[maxn];
int vis[maxn];
bool dfs(int x, int y) {
  if (x == y) {
    return true;
  }
  for (int i = 0; i < Q[x].size(); i++) {
    int z = Q[x][i];
    if (!vis[z]) {
      vis[z] = 1;
      if (dfs(z, y)) return true;
    }
  }
  return false;
}
int main() {
  int n;
  int u, v;
  cin >> n;
  memset(cnt, 0, sizeof(cnt));
  for (int i = 1; i < (n - 1) * n / 2; i++) {
    scanf("%d%d", &u, &v);
    cnt[u]++;
    cnt[v]++;
    Q[u].push_back(v);
  }
  int flag = 0;
  for (int i = 1; i <= n; i++) {
    if (cnt[i] != n - 1 && flag == 0) {
      u = i;
      flag = 1;
    } else if (cnt[i] != n - 1 && flag == 1) {
      v = i;
    }
  }
  if (dfs(v, u))
    cout << v << " " << u << endl;
  else
    cout << u << " " << v << endl;
}
