#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n + 7];
  for (int i = 0; i < n; i++) cin >> a[i];
  if (n <= 2) {
    for (int i = 0; i < n; i++) cout << a[i] << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      a[i] > a[j] ? cout << a[i] << endl : cout << a[j] << endl;
    }
  }
}
