n = gets.to_i
arr = gets.chomp.split.map(&:to_i)
str, max = "", 0
arr.each{|x|
    str << "(" *  (x - max) if x > max
    str << ")"
    max = x if max < x
}
arr_in, arr_out, count = [], [], 0
str.each_char{|c|
    case c
    when '('
        count += 1
        arr_in << count
    when ')'
        arr_out << arr_in.pop
    end
}
puts arr == arr_out ? str : ":("
