import scala.annotation.tailrec
import scala.collection.mutable
import scala.collection.mutable.ArrayBuffer
object Main extends App {
  import scala.io.StdIn._


  val n = readInt
  val p = readLine.trim.split(' ').map(_.toInt).zipWithIndex.sortBy(_._1).map(_._2 + 1)

  println(makeString(p))
  def makeString(p: Array[Int]): String = {
    val str = Array.tabulate(p.length * 2){_ ⇒ '0'}
    @tailrec
    def sub(position: Int, pos: Int, max: Int = 0, stack: List[Int] = Nil): Boolean = {
      if (position == p.length) {
        for (i ← pos until str.length) str(i) = ')'
        true
      }
      else if (p(position) < max) false
      else {
        stack match {
          case Nil ⇒
            str(pos) = '('
            sub(position + 1, pos + 1, max, p(position)::stack)
          case h::t if h < p(position) ⇒
            str(pos) = ')'
            sub(position, pos + 1, math.max(h, max), t)
          case _ ⇒
            str(pos) = '('
            sub(position + 1, pos + 1, max, p(position)::stack)
        }
      }
    }
    if (sub(0, 0)) str.mkString
    else ":("
  }
  implicit class Scope[T](val value: T) extends AnyVal {
    @inline
    def let[A](func: T ⇒ A): A = func(value)
    @inline
    def also(func: T ⇒ Unit): T = {
      func(value)
      value
    }
  }
}
