#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a;
  for (int i = 0; i < (int)(n); i++) {
    cin >> a.at(i);
  }
  int jogai = 0;
  int op = 0;
  for (int j = 0; j < (int)(n); j++) {
    for (int i = 0; i < (int)(n); i++) {
      if (jogai == 0) continue;
      int max = a.at(i);
      if (max <= a.at(i)) max = a.at(i);
      op = max;
    }
    cout << op << endl;
    jogai++;
  }
}
