#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const long long MAX = 1e3 + 5;
const long long MAX2 = 11;
const int MOD = 1000000000 + 7;
const long long INF = 20000;
const int nr[] = {1, 0, -1, 0, 1, 1, -1, -1};
const int nc[] = {0, 1, 0, -1, 1, -1, 1, -1};
int n, m, a, b, x[55][55], y[55];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  m = n * (n - 1) / 2 - 1;
  while (m--) {
    cin >> a >> b;
    x[a][b] = 1;
    x[b][a] = 1;
    y[a]++;
    y[b]--;
  }
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) {
      if (x[i][j] == 0) {
        if (y[i] >= y[j])
          cout << i << " " << j;
        else
          cout << j << " " << i;
        return 0;
      }
    }
  return 0;
}
