#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const long long INF = 1LL << 60;
long long MOD = 1000000007;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  vector<long long> a(n), cnt(8);
  for (long long i = 0; i < (n); ++i) cin >> a[i];
  for (long long i = 0; i < (n); ++i) {
    if (a[i] <= 399)
      cnt[0]++;
    else if (a[i] <= 799)
      cnt[0]++;
    else if (a[i] <= 1199)
      cnt[0]++;
    else if (a[i] <= 1599)
      cnt[0]++;
    else if (a[i] <= 1999)
      cnt[0]++;
    else if (a[i] <= 2399)
      cnt[0]++;
    else if (a[i] <= 2799)
      cnt[0]++;
    else if (a[i] <= 3199)
      cnt[0]++;
  }
  cout << *max_element((a).begin(), (a).end()) << endl;
  cout << *min_element((a).begin(), (a).end()) << endl;
}
