function main(input) {
    const stdin: number[] = input.split("\n").map(item => parseInt(item))
    const num = stdin[0]
    const arr = stdin.splice(1, num)
    for (let index = 0; index < num; index++) {
        const arr2 = arr
        arr2.splice(index)
        console.log(arr2.sort()[0])
    }

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