#include <bits/stdc++.h>
using namespace std;
vector<long long int> adj[55];
long long int vis[55], h[55];
long long int f = 0;
void dfs(long long int x, long long int dest) {
  vis[x] = 1;
  if (x == dest) {
    f = 1;
    return;
  }
  if (f) return;
  for (long long int i = 0; i < adj[x].size(); i++) {
    if (!vis[adj[x][i]]) dfs(adj[x][i], dest);
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n;
  cin >> n;
  for (long long int i = 0; i < (n * (n - 1)) / 2 - 1; i++) {
    long long int x, y;
    cin >> x >> y;
    h[x]++;
    h[y]++;
    adj[x].push_back(y);
  }
  long long int root1 = -1, root2 = 1;
  for (long long int i = 1; i <= n; i++) {
    if (h[i] != n - 1) {
      if (root1 == -1)
        root1 = i;
      else
        root2 = i;
    }
  }
  dfs(root2, root1);
  if (f) return cout << root2 << ' ' << root1, 0;
  cout << root1 << ' ' << root2;
  cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
}
