#include <bits/stdc++.h>
using namespace std;
const int INF = 55;
int n, vis[INF];
bool Map[INF][INF];
signed main() {
  scanf("%d", &n);
  int m = n * (n - 1) / 2 - 1;
  for (int i = 1; i <= m; i++) {
    int x = 0, y = 0;
    scanf("%d %d", &x, &y);
    Map[x][y] = Map[y][x] = 1;
    vis[x]++;
  }
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) {
      if (!Map[i][j]) {
        if (vis[i] > vis[j])
          printf("%d %d\n", i, j);
        else
          printf("%d %d\n", j, i);
        return 0;
      }
    }
  return 0;
}
