#include <bits/stdc++.h>
using namespace std;
namespace solveIt {
long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9')
    x = (x << 3) + (x << 1) + (c ^ '0'), c = getchar();
  return x * f;
}
template <class _T>
void write(_T x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
}
template <class _T>
void write(_T x, char end) {
  write(x);
  putchar(end);
}
int n, mat[55][55], deg[55];
void Main() {
  n = read();
  for (int i = 1, u, v; i < n * (n - 1) / 2; ++i) {
    u = read(), v = read();
    mat[max(u, v)][min(u, v)] = 1;
    deg[u]++;
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j < i; ++j) {
      if (mat[i][j] == 0) {
        if (deg[i] >= deg[j])
          write(i, ' '), write(j, '\n');
        else
          write(j, ' '), write(i, '\n');
        goto suc;
      }
    }
  }
suc:;
}
}  // namespace solveIt
int main() {
  solveIt::Main();
  return 0;
}
