#include <bits/stdc++.h>
using namespace std;
int N;
int x;
int main() {
  cin >> N;
  vector<int> a(N);
  vector<int> y(N);
  for (int i = 0; i < N; i++) cin >> a[i];
  for (int j = 0; j < N; j++) {
    x = 0;
    for (int k = 1; k < N; k++) {
      if (j + k > N - 1) {
        if (a[j + k - N] > x) x = a[j + k - N];
      } else {
        if (a[j + k] > x) x = a[j + k];
      }
    }
    y[j] = x;
    cout << y[j] << "\n";
  }
}
