// includes {{{
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<tuple>
#include<cmath>
#include<random>
#include<cassert>
// #include<deque>
// #include<multiset>
// #include<bitset>
// #include<cstring>
// #include<bits/stdc++.h>
// }}}
using namespace std;
using ll = long long;

// #undef DEBUG
// #define DEBUG
// DEBUG {{{
#include <array>
#include <deque>
#include <list>
#include <ostream>
#include <queue>
#include <stack>
#include <tuple>
#include <valarray>
#include <vector>
template < int n, class... T >
typename enable_if< (n >= sizeof...(T)) >::type __output_tuple(ostream &,
    tuple< T... > const &) {}
template < int n, class... T >
typename enable_if< (n < sizeof...(T)) >::type __output_tuple(ostream &os,
    tuple< T... > const &t) {
  os << (n == 0 ? "" : ", ") << get< n >(t);
  __output_tuple< n + 1 >(os, t);
}
template < class... T >
ostream &operator<<(ostream &os, tuple< T... > const &t) {
  os << "(";
  __output_tuple< 0 >(os, t);
  os << ")";
  return os;
}
template < class T, class U >
ostream &operator<<(ostream &os, pair< T, U > const &p) {
  os << "(" << p.first << ", " << p.second << ")";
  return os;
}
template < class T >
ostream &operator<<(ostream &os, const stack< T > &a) {
  os << "{";
  for(auto tmp = a; tmp.size(); tmp.pop())
    os << (a.size() == tmp.size() ? "" : ", ") << tmp.top();
  os << "}";
  return os;
}
template < class T, class Container, class Compare >
ostream &operator<<(ostream &os, priority_queue< T, Container, Compare > a) {
  os << "{ (top) ";
  while(a.size()) os << a.top() << (a.size() == 1 ? "" : ", "), a.pop();
  os << " }";
  return os;
}
template < class T, class Container >
ostream &operator<<(ostream &os, queue< T, Container > a) {
  os << "{ ";
  while(a.size()) os << a.front() << (a.size() == 1 ? "" : ", "), a.pop();
  os << " }";
  return os;
}
#ifdef DEBUG
#if !defined(DEBUG_OUT)
#define DEBUG_OUT cerr
#endif
#define dump(...)                                                                \
  [&]() {                                                                        \
    auto __debug_tap = make_tuple(__VA_ARGS__);                                  \
    DEBUG_OUT << "[" << __LINE__ << "] " << #__VA_ARGS__ << " = " << __debug_tap \
    << endl;                                                           \
  }()
template < class T >
inline void dump2D(T &d, size_t sizey, size_t sizex) {
  for(size_t i = 0; i < sizey; i++) {
    DEBUG_OUT << "\t";
    for(size_t j = 0; j < sizex; j++)
      DEBUG_OUT << d[i][j] << (j + 1 == sizex ? "" : "\t");
    DEBUG_OUT << endl;
  }
}
template < class T >
inline void dump1D(T &d, size_t sizey) {
  for(size_t i = 0; i < sizey; i++) {
    DEBUG_OUT << d[i] << (i + 1 == sizey ? "" : " ");
  }
  DEBUG_OUT << endl;
}
template < class T, class = typename iterator_traits< decltype(begin(T())) >::value_type,
         class = typename enable_if< !is_same< T, string >::value >::type >
         ostream &operator<<(ostream &os, const T &a) {
           os << "{";
           for(auto ite = begin(a); ite != end(a); ++ite)
             os << (ite == begin(a) ? "" : ", ") << *ite;
           os << "}";
           return os;
         }
#else
#define dump(...) (42)
#define dump2D(...) (42)
#define dump1D(...) (42)
template < class T, class = typename iterator_traits< decltype(begin(T())) >::value_type,
         class = typename enable_if< !is_same< T, string >::value >::type >
         ostream &operator<<(ostream &os, const T &a) {
           for(auto ite = begin(a); ite != end(a); ++ite)
             os << (ite == begin(a) ? "" : " ") << *ite;
           return os;
         }
#endif
// }}}


int a[112345];

void NO() {
  cout << ":(" << endl;
  exit(0);
}

deque<char>* mrg(deque<char>* a, deque<char>* b) {
  if(!b) return a;
  assert(a);
  if(a->size() > b->size()) {
    for(auto e: *b) {
      a->push_back(e);
    }
    return a;
  } else {
    for(int i = (int) a->size() - 1; i >= 0; i--) {
      b->push_front((*a)[i]);
    }
    return b;
  }
}

int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  int n;
  cin >> n;
  // vector<pair<int, int>> v;
  for(int i = 0; i < n; i++) {
    cin >> a[i];
    // v.emplace_back(i, a[i]);
  }
  vector<tuple<int, int, deque<char>*>> u;
  const int inf = 1e9;
  u.emplace_back(inf, -1, new deque<char>);
  for(int i = 0; i < n; i++) {
    int id = a[i];
    // tie(ignore, id) = v[i];
    deque<char>* carry = new deque<char>;
    int las = id;
    while(u.size() && get<0>(u.back()) > id) {
      auto d = u.back();
      las = max(las, get<1>(d));
      carry = mrg(get<2>(d), carry);
      u.pop_back();
    }
    if(u.size() && get<1>(u.back()) >= id) NO();
    carry->push_back(')');
    carry->push_front('(');
    u.emplace_back(id, las, carry);
  }

  string ans;
  for(auto e : u) {
    for(auto c : *get<2>(e)) {
      ans += c;
    }
  }
  
  cout << ans << endl;
  return 0;
}

