#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  valarray<int> a(n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  valarray<int> b = a;
  int max1 = b.max();
  for (int i = 0; i < n; ++i) {
    cout << max1 << "\n";
  }
}
