#include <bits/stdc++.h>
using namespace std;
int du[100];
int val[100];
int main() {
  int n;
  cin >> n;
  memset(du, 0, sizeof(du));
  memset(val, 0, sizeof(val));
  for (int i = 0; i < (n - 1) * n / 2 - 1; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    du[a]++;
    du[b]++;
    val[a]++;
  }
  int s1, s2;
  for (int i = 1; i <= n; i++) {
    if (du[i] < n - 1) {
      s1 = i;
      break;
    }
  }
  for (int i = s1 + 1; i <= n; i++) {
    if (du[i] < n - 1) {
      s2 = i;
      break;
    }
  }
  if (val[s2] > val[s1])
    printf("%d %d\n", s2, s1);
  else
    printf("%d %d\n", s1, s2);
  return 0;
}
