#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
const double EPS = 1e-10;
const double PI = acos(-1.0);
template <class T>
T max(T *a, long long n) {
  T maxi = a[0];
  for (long long i = 0; i < n; ++i) {
    if (a[i] > maxi) maxi = a[i];
  }
  return maxi;
}
template <class T>
T min(T *a, long long n) {
  T mini = a[0];
  for (long long i = 0; i < n; ++i) {
    if (a[i] < mini) mini = a[i];
  }
  return mini;
}
template <class T>
T sum(T *a, long long n) {
  T s = 0;
  for (long long i = 0; i < n; ++i) {
    s += a[i];
  }
  return s;
}
int main() {
  long long n;
  cin >> n;
  long long a[n];
  for (int i = (0); i < (n); ++i) {
    cin >> a[i];
  }
  for (int i = (0); i < (n); ++i) {
    long long o = a[i];
    a[i] = 0;
    cout << max(a, sizeof(a) / sizeof(a[0]));
    if (i != n - 1) cout << "\n";
    a[i] = o;
  }
  return 0;
}
