#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < (long long)n; i++) cin >> a[i];
  for (long long i = 0; i < (long long)n; i++) {
    for (long long j = 0; j < (long long)n; j++) {
      if (i == j) continue;
      if (abs(a[i] - a[j]) % (n - 1) == 0) {
        cout << a[i] << " " << a[j] << endl;
        return 0;
      }
    }
  }
}
