#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 1LL << 60;
const double PI = acos(-1.0);
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;
}
long long GCD(long long a, long long b) { return b ? GCD(b, a % b) : a; }
long long LCM(long long a, long long b) {
  long long g = GCD(a, b);
  return a / g * b;
}
inline double comb(long long n, long long r) {
  if (n == 0) {
    return 0;
  }
  if (r == 0) {
    return 1;
  }
  if (r == 1) {
    return n;
  }
  if (n == r) {
    return 1;
  }
  if (r > n / 2) {
    r = n / 2;
  }
  double result = 1;
  for (double i = 1; i <= r; i++) {
    result *= (n - i + 1) / i;
  }
  return (result);
}
vector<pair<long long, long long> > prime_factorize(long long n) {
  vector<pair<long long, long long> > res;
  for (long long p = 2; p * p <= n; ++p) {
    if (n % p != 0) continue;
    long long num = 0;
    while (n % p == 0) {
      ++num;
      n /= p;
    }
    res.push_back(make_pair(p, num));
  }
  if (n != 1) res.push_back(make_pair(n, 1));
  return res;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  long long N;
  cin >> N;
  vector<long long> A(N);
  for (long long i = 0; i < N; i++) cin >> A.at(i);
  for (long long i = 0; i < N; i++) {
    for (long long j = 0; j < N - 1; j++) {
      if (j == i)
        swap(A.at(j), A.at(j + 1));
      else if (A.at(j) > A.at(j + 1))
        swap(A.at(j), A.at(j + 1));
    }
    cout << A.at(N - 1) << endl;
  }
}
