#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int k = (n * (n - 1)) / 2 - 1;
  int x, y;
  int arr[n + 1][n + 1];
  int win[n + 1];
  memset(win, 0, sizeof(win));
  memset(arr, 0, sizeof(arr));
  for (int i = 0; i < k; i++) {
    cin >> x >> y;
    win[x]++;
    arr[x][y] = 1;
    arr[y][x] = 1;
  }
  bool flag = true;
  for (int i = 1; i < n + 1; i++) {
    for (int j = 1; j < n + 1; j++) {
      if (i != j && arr[i][j] != 1) {
        if (win[i] >= win[j]) {
          cout << i << " " << j << endl;
        } else {
          cout << j << " " << i << endl;
        }
        flag = false;
      }
      if (flag == false) {
        break;
      }
    }
    if (flag == false) {
      break;
    }
  }
  return 0;
}
