function main(input) {
    var stdin = input.split("\n").map(function (item) { return parseInt(item); });
    var num = stdin[0];
    var arr = stdin.splice(1, num);
    for (var index = 0; index < num; index++) {
        var arr2 = arr;
        arr2.splice(index);
        console.log(arr2.sort()[0]);
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
