#include <bits/stdc++.h>
using namespace std;
bool adj[55][55], vis[55];
vector<int> topo_sorted, edges[55];
void topological_sort(int u) {
  vis[u] = 1;
  for (int v : edges[u])
    if (!vis[v]) topological_sort(v);
  topo_sorted.push_back(u);
}
int main() {
  int n, m, u, v, i, j;
  cin >> n;
  m = n * (n - 1) / 2 - 1;
  for (i = 1; i <= m; ++i)
    cin >> u >> v, edges[u].push_back(v), adj[u][v] = adj[v][u] = 1;
  for (i = 1; i <= n; ++i)
    if (!vis[i]) topological_sort(i);
  for (i = 1; i <= n; ++i)
    for (j = 1; j <= n; ++j)
      if (i != j && !adj[i][j]) u = i, v = j;
  for (int x : topo_sorted) {
    if (x == u) {
      swap(u, v);
      break;
    } else if (x == v) {
      break;
    }
  }
  cout << u << ' ' << v << endl;
  return 0;
}
