#include <bits/stdc++.h>
using namespace std;
void fill_bitset(bitset<50>& b, int p, vector<pair<int, int>> const& matches) {
  for (size_t i{0}; i < matches.size(); i++) {
    if (matches[i].first == p) {
      b.set(matches[i].second - 1);
    }
  }
}
int main() {
  int n;
  cin >> n;
  std::array<int, 50> num_matches{};
  std::vector<pair<int, int>> matches;
  matches.reserve(n * (n - 1) / 2 - 1);
  for (int i{0}; i < n * (n - 1) / 2 - 1; i++) {
    int a, b;
    cin >> a >> b;
    num_matches[a - 1]++;
    num_matches[b - 1]++;
    matches.emplace_back(a, b);
  }
  int num_missing{0};
  pair<int, int> missing;
  for (int i{0}; i < n; i++) {
    if (num_matches[i] != (n - 1)) {
      num_missing++;
      if (num_missing == 1) {
        missing.first = i + 1;
      } else if (num_missing == 2) {
        missing.second = i + 1;
      } else {
        cerr << "detected " << num_missing << " players w/o (n-1) matches\n";
        return 1;
      }
    }
  }
  bitset<50> b1;
  bitset<50> b2;
  fill_bitset(b1, missing.first, matches);
  fill_bitset(b2, missing.second, matches);
  auto bxor = b1 ^ b2;
  for (int i{0}; i < n; i++) {
    if (bxor[i]) {
      if (b1[i]) {
        cout << missing.first << ' ' << missing.second << '\n';
      } else {
        assert(b2[i]);
        cout << missing.second << ' ' << missing.first << '\n';
      }
      return 0;
    }
  }
  cout << missing.first << ' ' << missing.second << '\n';
}
