#include <bits/stdc++.h>
using namespace std;
int apa[51], arr[51], n, x, y, xx, yy;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < (n * (n - 1) / 2) - 1; i++) {
    scanf("%d %d", &x, &y);
    arr[x]++;
    apa[x]++;
    apa[y]++;
  }
  for (int i = 1; i <= n; i++)
    if (apa[i] != n - 1) {
      if (xx == 0)
        xx = i;
      else
        yy = i;
    }
  if (arr[xx] > arr[yy])
    printf("%d %d", xx, yy);
  else
    printf("%d %d", yy, xx);
}
