#include <bits/stdc++.h>
using ll = long long;
using ld = long double;
template <class T, class S>
void cmin(T &a, const S &b) {
  if (a > b) a = b;
}
template <class T, class S>
void cmax(T &a, const S &b) {
  if (a < b) a = b;
}
ll dx[] = {0, 0, 1, -1};
ll dy[] = {1, -1, 0, 0};
ll W, H;
bool inrange(ll x, ll y) { return (0 <= x && x < W) && (0 <= y && y < H); }
using namespace std;
signed main() {
  ll n;
  cin >> n;
  vector<ll> v(n);
  for (ll i = 0; i < n; i++) cin >> v[i];
  for (ll i = 0; i < n; i++)
    for (ll j = 0; j < n; j++)
      if (abs(v[i] - v[j]) % (n - 1) == 0)
        return cout << v[i] << " " << v[j] << endl, 0;
}
