#include <bits/stdc++.h>
using namespace std;
vector<long> vec[55];
long vis[55];
void dfs(long u) {
  for (long i = 0; i < vec[u].size(); i++) {
    if (vis[vec[u][i]] == 0) {
      vis[vec[u][i]] = 1;
      dfs(vec[u][i]);
    }
  }
}
int main() {
  long n;
  while (cin >> n) {
    long m = (n * (n - 1)) / 2, f = 0, ar[55][55] = {0}, i, a, b, j, src, dest;
    for (i = 1; i < m; i++) {
      cin >> a >> b;
      vec[a].push_back(b);
      ar[a][b] = 1;
      ar[b][a] = 1;
    }
    memset(vis, 0, sizeof(vis));
    for (i = 1; i <= n; i++) {
      for (j = i + 1; j <= n; j++) {
        if (ar[i][j] == 0) {
          src = i, dest = j;
          f = 1;
          break;
        }
      }
      if (f == 1) break;
    }
    dfs(src);
    if (vis[dest] == 1) {
      cout << src << " " << dest << endl;
    } else
      cout << dest << " " << src << endl;
    for (i = 0; i < 55; i++) vec[i].clear();
  }
}
