#include <bits/stdc++.h>
using namespace std;
int a[60][60], ans[60];
long long rez = 10e18;
int main() {
  int n, x, y, k;
  cin >> n;
  k = n * (n - 1) / 2 - 1;
  for (int i = 0; i < k; i++) {
    cin >> x >> y;
    a[max(x, y)][min(x, y)]++;
    ans[x]++;
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j < i; j++)
      if (a[i][j] == 0)
        if (ans[i] > ans[j])
          cout << i << " " << j << "\n";
        else
          cout << j << " " << i;
}
