"use strict";
const main = arg => {
  let A = arg.split("\n").map(n=>n*1);
  let N = A[0];
  A = A.slice(1, N+1);
  let temp = 0;
  for(let i = 0; i < N; i++){
    temp = A[i];
    A[i] = 0;
  	console.log(Math.max(...A));
    A[i] = temp;
  }
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
