#include <bits/stdc++.h>
using namespace std;
int n, m;
bool vis[100];
bool g[100][100];
void dfs(int x) {
  vis[x] = true;
  for (int i = 1; i <= n; i++) {
    if (!vis[i] && g[x][i]) dfs(i);
  }
}
int main() {
  int x, y;
  cin >> n;
  m = n * (n - 1) / 2 - 1;
  while (m--) {
    scanf("%d%d", &x, &y);
    g[x][y] = true;
  }
  for (x = 1; x <= n; x++)
    for (y = x + 1; y <= n; y++) {
      if (g[x][y] + g[y][x] == 0) {
        dfs(x);
        if (vis[y])
          printf("%d %d\n", x, y);
        else
          printf("%d %d\n", y, x);
      }
    }
  return 0;
}
