#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int numb;
  int max = 0;
  for (int i = 0; i < N; i++) {
    cin >> numb;
    if (max < numb) {
      max = numb;
    }
    cout << max << endl;
  }
}
