#include <bits/stdc++.h>
using namespace std;
const long long N = 1e5 + 2;
const long long mod = 1000000007;
vector<long long> adj[100];
long long aboro = 0, a, b;
;
long long vis[100];
void dfs(long long a) {
  if (vis[a]) return;
  vis[a] = 1;
  for (long long e : adj[a]) {
    if (e == b) {
      aboro = 1;
      return;
    }
    dfs(e);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  vector<long long> cnt(200);
  long long n;
  cin >> n;
  set<long long> st;
  for (int i = 0; i < n; i++) st.insert(i + 1);
  for (int i = 0; i + 1 < n * (n - 1) / 2; i++) {
    long long x, y;
    cin >> x >> y;
    cnt[x]++, cnt[y]++;
    if (cnt[x] == n - 1) st.erase(x);
    if (cnt[y] == n - 1) st.erase(y);
    adj[x].push_back(y);
  }
  a = *st.begin(), b = *--st.end();
  dfs(a);
  if (aboro)
    cout << a << " " << b;
  else
    cout << b << " " << a;
}
