#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> L(N);
  for (int i = 0; i < N; i++) {
    cin >> L.at(i);
  }
  int max_v = 0;
  for (int j = 0; j < N; j++) {
    if (j != 0) {
      max_v = max(max_v, L.at(j));
    } else {
      continue;
    }
    cout << max_v << endl;
  }
}
