#include <bits/stdc++.h>
int b[1000000][100];
using namespace std;
signed main() {
  int a, c, d = 0;
  cin.tie(NULL);
  ios::sync_with_stdio(false);
  cin >> a;
  for (int i = 0; i < a; i++) {
    cin >> c;
    for (int j = 0; j < a; j++) {
      b[j][i] = c;
    }
  }
  for (int i = 0; i < a; i++) {
    b[i][d] = 0;
    d++;
  }
  for (int i = 0; i < a; i++) {
    sort(b[i], b[i] + a, greater<int>());
    cout << b[i][0] << "\n";
  }
  return (0);
}
