#include <bits/stdc++.h>
using namespace std;
const long long N = 65, INF = 1e9 + 7;
int n;
int dp[N], usd[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  for (int i = 1; i < n * (n - 1) / 2; ++i) {
    int l, r;
    cin >> l >> r;
    usd[l]++;
    usd[r]++;
    dp[l]++;
  }
  int x = -1, y = -1;
  for (int i = 1; i <= n; ++i) {
    if (usd[i] < n - 1)
      if (x == -1)
        x = i;
      else
        y = i;
  }
  if (dp[x] >= dp[y])
    cout << x << " " << y;
  else
    cout << y << " " << x;
}
