#include <bits/stdc++.h>
using namespace std;
int N, M[55][55], C[55];
int main() {
  cin >> N;
  for (int i = 1; i <= N * (N - 1) / 2 - 1; ++i) {
    int a, b;
    cin >> a >> b;
    M[a][b] = M[b][a] = 1;
    C[a]++;
  }
  for (int i = 1; i <= N; ++i)
    for (int j = i + 1; j <= N; ++j)
      if (!M[i][j]) {
        if (C[i] > C[j])
          cout << i << ' ' << j << '\n';
        else
          cout << j << ' ' << i << '\n';
      }
  return 0;
}
