#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int a = 0, f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) a = (a << 3) + (a << 1) + ch - '0';
  return a * f;
}
const int mod = 1e9 + 7;
const int N = 50 + 5;
int a[N], cnt[N][N];
signed main() {
  int n = read();
  for (int i = 1; i < (n - 1) * n / 2; i++) {
    int x = read(), y = read();
    cnt[max(x, y)][min(x, y)]++;
    a[x]++;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j < i; j++) {
      if (!cnt[i][j]) {
        if (a[i] > a[j])
          printf("%d %d\n", i, j);
        else
          printf("%d %d\n", j, i);
      }
    }
  }
  return 0;
}
