#include <bits/stdc++.h>
int hs[100];
int map[100][100];
int en, be;
int visit[100];
int ok = 0;
void dfs(int k) {
  if (k == en) {
    ok = 1;
    return;
  }
  for (int i = 1; i <= 50; i++)
    if (map[k][i] == 1 && !visit[i]) {
      visit[i] = 1;
      dfs(i);
    }
}
int main() {
  int n;
  scanf("%d", &n);
  memset(map, 0, sizeof(map));
  memset(hs, 0, sizeof(hs));
  memset(visit, 0, sizeof(visit));
  for (int i = 1; i <= n * (n - 1) / 2 - 1; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    map[a][b] = 1;
    hs[a]++;
    hs[b]++;
  }
  be = en = 0;
  for (int i = 1; i <= n; i++) {
    if (hs[i] != n - 1)
      if (!be)
        be = i;
      else
        en = i;
  }
  dfs(be);
  if (ok)
    printf("%d %d\n", be, en);
  else
    printf("%d %d\n", en, be);
  return 0;
}
