#include <bits/stdc++.h>
using namespace std;
// type alias
typedef long long LL;
typedef pair<int,int> II;
typedef tuple<int,int,int> III;
typedef vector<int> VI;
typedef vector<string> VS;
typedef unordered_map<int,int> MAPII;
typedef unordered_set<int> SETI;
template<class T> using VV=vector<vector<T>>;
// minmax
template<class T> inline T SMIN(T& a, const T b) { return a=(a>b)?b:a; }
template<class T> inline T SMAX(T& a, const T b) { return a=(a<b)?b:a; }
// repetition
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define REPE(i,n)  for(int i=0;i<=(n);++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i=0;i<(n);++i)
#define FORR(x,arr) for(auto& x:arr)
#define SZ(a) int((a).size())
// collection
#define ALL(c) (c).begin(),(c).end()
// DP
#define MINUS(dp) memset(dp, -1, sizeof(dp))
#define ZERO(dp) memset(dp, 0, sizeof(dp))
// stdout
#define println(args...) fprintf(stdout, ##args),putchar('\n');
// debug cerr
template<class Iter> void __kumaerrc(Iter begin, Iter end) { for(; begin!=end; ++begin) { cerr<<*begin<<','; } cerr<<endl; }
void __kumaerr(istream_iterator<string> it) { (void)it; cerr<<endl; }
template<typename T, typename... Args> void __kumaerr(istream_iterator<string> it, T a, Args... args) { cerr<<*it<<"="<<a<<", ",__kumaerr(++it, args...); }
template<typename S, typename T> std::ostream& operator<<(std::ostream& _os, const std::pair<S,T>& _p) { return _os<<"{"<<_p.first<<','<<_p.second<<"}"; }
#define __KUMATRACE__ true
#ifdef __KUMATRACE__
#define dump(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); __kumaerr(_it, args); }
#define dumpc(ar) { cerr<<#ar<<": "; FORR(x,(ar)) { cerr << x << ','; } cerr << endl; }
#define dumpC(beg,end) { cerr<<"~"<<#end<<": "; __kumaerrc(beg,end); }
#else
#define dump(args...)
#define dumpc(ar)
#define dumpC(beg,end)
#endif

// $ cp-batch BicoloredRBS | diff BicoloredRBS.out -
// $ g++ -std=c++14 -Wall -O2 -D_GLIBCXX_DEBUG -fsanitize=address BicoloredRBS.cpp && ./a.out

/*

 5/15/2019

 8:09-

 */

const int MAX_N=1e6+1;
int N;
string S;

int dep(string &S) {
  int N=SZ(S);
  int d=0,res=0;
  REP(i,N) {
    if(S[i]=='(') ++d;
    else --d;
        if(d<0) dump(S);
    assert(d>=0);
    SMAX(res,d);
  }
  assert(d==0);
  return res;
}
int res[MAX_N];
bool ok(int D) {
  int d=0; bool reached=false;
  ZERO(res);
  string T;
  REP(i,N) {
    if(!reached) {
      if(S[i]=='(') {
        ++d;
        if(d==D) reached=true;
      } else {
        --d;
      }
    } else {
      if(d>0&&S[i]==')') --d;
      else {
        T.push_back(S[i]);
        res[i]=1;
      }
    }
  }
  if(!reached||d>0) return true;
//  dump(D,T);
  return (dep(T)<=D);
}
void solve() {
  int good=1e7,bad=0;
  while(abs(good-bad)>1) {
    int m=(good+bad)/2;
    bool a=ok(m);
    (a?good:bad)=m;
  }
//  dump(good);
  ok(good);
  REP(i,N) printf("%d",res[i]);
  println("");
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout<<setprecision(12)<<fixed;

  cin>>N>>S;
  solve();

  return 0;
}


#include <iostream>
using namespace std;

int main() {
	int n;
	string str, sr = "", ss = "";
	cin >> n >> str;
	int r = 0, s = 0;
	for(char c : str) {
		if(c == '(') {
			if(r > s) {
				s++;
				cout << '0';
			}
			else {
				r++;
				cout << '1';
			}
		}
		else {
			if(r > s){
				r--;
				cout << '1';
			}
			else {
				s--;
				cout << '0';
			}
		}
	}
	return 0;
}


#include <iostream>
using namespace std;

int main() {
	int n;
	cin >> n;getchar_unlocked();
	char c;
	int r = 0, s = 0;
	while(n--) {
	    c = getchar_unlocked();
		int a = (c == '(' ? 0 : 1);
		if(r > s) {
			s++;
			putchar_unlocked((0^a)+'0');
		}
		else {
			r++;
			putchar_unlocked((1^a)+'0');
		}
	}
	return 0;
}


#include <iostream>
using namespace std;

int main() {
	int n;
	string str, sr = "", ss = "";
	cin >> n >> str;
	int r = 0, s = 0;
	for(char c : str) {
		int a = (c == '(' ? 0 : 1);
		if(r > s) {
			s++;
			cout << (0^a);
		}
		else {
			r++;
			cout << (1^a);
		}
	}
	return 0;
}


#include <iostream>
using namespace std;

int main() {
	int n;
	cin >> n;getchar();
	char c;
	int r = 0, s = 0;
	while(n--) {
	    c = getchar();
		int a = (c == '(' ? 0 : 1);
		if(r > s) {
			s++;
			putchar((0^a)+'0');
		}
		else {
			r++;
			putchar((1^a)+'0');
		}
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#ifdef ONLINE_JUDGE
    #define cerr if(false)cerr
#else
    #define cerr if(true)cerr
#endif
#define inputarr(a,n) for(ll i=0;i<n;i++) cin>>a[i];
#define prllarr(a,n) for(ll i=0;i<n;i++) cerr<<a[i]<<" "; cerr<<endl;
#define pb push_back
#define ll long long
#define mod 998244353
#define foi ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);
#define in(n) scanf("%lld",&n);
#define in2(x,y) scanf("%lld %lld",&(x),&(y));
#define in3(x,y,z) scanf("%lld %lld %lld",&(x),&(y),&(z));
#define in4(x,y,z,m) scanf("%lld %lld %lld %lld",&(x),&(y),&(z),&(m));
#define out(n) printf("%lld\n",n);
#define out2(x,y) printf("%lld %lld\n",x,y);
#define test(t)  ll t; in(t);while(t--)
#define set(arr,n,s) for(ll i=0;i<n;i++){arr[i]=s;}
#define fr(i,s,e) for(ll i=s;i<e;i++)
#define frr(i,s,e) for(ll i=e-1;i>=s;i--)
#define vi vector<ll>
#define see2(x,y) cerr<<x<<" "<<y<<endl;
#define see(x) cerr<<x<<endl;
#define see3(x,y,z) cerr<<x<<" "<<y<<" "<<z<<endl;
#define see4(x,y,z,m) cout<<x<<" "<<y<<" "<<z<<" "<<m<<endl;
#define invec(a,n) fr(i,0,n){ll x;in(x) a.pb(x);}
#define vii vector<pair<ll,ll> >
#define all(a) a.begin(),a.end()
#define pii pair<ll,ll>

ll power(ll x,ll y,ll p){ll res=1;x=x%p;while(y>0){if(y&1){res=(res*x)%p;} y=y>>1;x=(x*x)%p;}return res;}
ll modInverse(ll a,ll p){return power(a,p-2,p);}//used with feemat little//only for prime
// void gcd(ll a, ll b, ll& d, ll& u, ll& v) {
//     if (b == 0) {
//         d = a;
//         u = 1;
//         v = 0;
//     } else {
//         gcd(b, a % b, d, v, u);
//         // a u + b v = b u' + (a - (a/b) * b) v'
//         // = a v' + b (u' - (a/b) v').
//         v -= a / b * u;
//     }
// }
// ll Inverse(ll a, ll m) {
//     a %= m;
//     if (a < 0) a += m;
//     ll d, u, v;
//     gcd(a, m, d, u, v);
//     assert(d == 1);
//     u %= m;
//     if (u < 0) u += m;
//     return u;
// }

ll gcd(ll x,ll y){if(x==0 || y==0){return max(y,x);}return gcd(y%x,x);}
// ll gcdExtended(ll a,ll b,ll &x,ll &y){if(a==0){x=0;y=1;return b;}ll x1,y1;ll gcd = gcdExtended(b%a,a,x1,y1);x=y1-(b/a)*x1;y=x1;return gcd;}//o(log(b))
// ;

int main(){
	ll n;
    in(n)
    string s;
    cin>>s;
    vi a;
    a.resize(n);
    ll b1=0;
    ll b2=0;
    ll t=0;
    for(ll i=0;i<n;i++){
        if(s[i]=='('){
            if(b1>b2){
                b2++;
                a[i]=1;
            }
            else {
                b1++;
                a[i]=0;
            }
        }
        else {
            if(b1>b2){
                b1--;
                a[i]=0;
            }
            else {
                b2--;
                a[i]=1;
            }
        }

    }
    for(auto p:a)cout<<p;
}
/*error-----
convert every int to long long eg-1LL
create array with proper analysis of problem constrain
check mod also
*/


#include <bits/stdc++.h>
using namespace std;
#ifdef ONLINE_JUDGE
    #define cerr if(false)cerr
#else
    #define cerr if(true)cerr
#endif
#define inputarr(a,n) for(ll i=0;i<n;i++) cin>>a[i];
#define prllarr(a,n) for(ll i=0;i<n;i++) cerr<<a[i]<<" "; cerr<<endl;
#define pb push_back
#define ll long long
#define mod 998244353
#define foi ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);
#define in(n) scanf("%lld",&n);
#define in2(x,y) scanf("%lld %lld",&(x),&(y));
#define in3(x,y,z) scanf("%lld %lld %lld",&(x),&(y),&(z));
#define in4(x,y,z,m) scanf("%lld %lld %lld %lld",&(x),&(y),&(z),&(m));
#define out(n) printf("%lld\n",n);
#define out2(x,y) printf("%lld %lld\n",x,y);
#define test(t)  ll t; in(t);while(t--)
#define set(arr,n,s) for(ll i=0;i<n;i++){arr[i]=s;}
#define fr(i,s,e) for(ll i=s;i<e;i++)
#define frr(i,s,e) for(ll i=e-1;i>=s;i--)
#define vi vector<ll>
#define see2(x,y) cerr<<x<<" "<<y<<endl;
#define see(x) cerr<<x<<endl;
#define see3(x,y,z) cerr<<x<<" "<<y<<" "<<z<<endl;
#define see4(x,y,z,m) cout<<x<<" "<<y<<" "<<z<<" "<<m<<endl;
#define invec(a,n) fr(i,0,n){ll x;in(x) a.pb(x);}
#define vii vector<pair<ll,ll> >
#define all(a) a.begin(),a.end()
#define pii pair<ll,ll>

ll power(ll x,ll y,ll p){ll res=1;x=x%p;while(y>0){if(y&1){res=(res*x)%p;} y=y>>1;x=(x*x)%p;}return res;}
ll modInverse(ll a,ll p){return power(a,p-2,p);}//used with feemat little//only for prime
// void gcd(ll a, ll b, ll& d, ll& u, ll& v) {
//     if (b == 0) {
//         d = a;
//         u = 1;
//         v = 0;
//     } else {
//         gcd(b, a % b, d, v, u);
//         // a u + b v = b u' + (a - (a/b) * b) v'
//         // = a v' + b (u' - (a/b) v').
//         v -= a / b * u;
//     }
// }
// ll Inverse(ll a, ll m) {
//     a %= m;
//     if (a < 0) a += m;
//     ll d, u, v;
//     gcd(a, m, d, u, v);
//     assert(d == 1);
//     u %= m;
//     if (u < 0) u += m;
//     return u;
// }

ll gcd(ll x,ll y){if(x==0 || y==0){return max(y,x);}return gcd(y%x,x);}
// ll gcdExtended(ll a,ll b,ll &x,ll &y){if(a==0){x=0;y=1;return b;}ll x1,y1;ll gcd = gcdExtended(b%a,a,x1,y1);x=y1-(b/a)*x1;y=x1;return gcd;}//o(log(b))
// ;

int main(){
	ll n;
    in(n)
    string s;
    cin>>s;
    vi a;
    a.resize(n);
    ll b1=0;
    ll b2=0;
    ll t=0;
    for(ll i=0;i<n;i++){
        if(s[i]=='('){
            if(t){
                b1++;
                a[i]=0;
            }
            else {
                b2++;
                a[i]=1;
            }
            t^=1;
        }
        else {
            if(b1>0){
                b1--;
                a[i]=0;
            }
            else {
                b2--;
                a[i]=1;
            }
        }

    }
    for(auto p:a)cout<<p<<" ";
}
/*error-----
convert every int to long long eg-1LL
create array with proper analysis of problem constrain
check mod also
*/


#include <bits/stdc++.h>
using namespace std;
#ifdef ONLINE_JUDGE
    #define cerr if(false)cerr
#else
    #define cerr if(true)cerr
#endif
#define inputarr(a,n) for(ll i=0;i<n;i++) cin>>a[i];
#define prllarr(a,n) for(ll i=0;i<n;i++) cerr<<a[i]<<" "; cerr<<endl;
#define pb push_back
#define ll long long
#define mod 998244353
#define foi ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);
#define in(n) scanf("%lld",&n);
#define in2(x,y) scanf("%lld %lld",&(x),&(y));
#define in3(x,y,z) scanf("%lld %lld %lld",&(x),&(y),&(z));
#define in4(x,y,z,m) scanf("%lld %lld %lld %lld",&(x),&(y),&(z),&(m));
#define out(n) printf("%lld\n",n);
#define out2(x,y) printf("%lld %lld\n",x,y);
#define test(t)  ll t; in(t);while(t--)
#define set(arr,n,s) for(ll i=0;i<n;i++){arr[i]=s;}
#define fr(i,s,e) for(ll i=s;i<e;i++)
#define frr(i,s,e) for(ll i=e-1;i>=s;i--)
#define vi vector<ll>
#define see2(x,y) cerr<<x<<" "<<y<<endl;
#define see(x) cerr<<x<<endl;
#define see3(x,y,z) cerr<<x<<" "<<y<<" "<<z<<endl;
#define see4(x,y,z,m) cout<<x<<" "<<y<<" "<<z<<" "<<m<<endl;
#define invec(a,n) fr(i,0,n){ll x;in(x) a.pb(x);}
#define vii vector<pair<ll,ll> >
#define all(a) a.begin(),a.end()
#define pii pair<ll,ll>

ll power(ll x,ll y,ll p){ll res=1;x=x%p;while(y>0){if(y&1){res=(res*x)%p;} y=y>>1;x=(x*x)%p;}return res;}
ll modInverse(ll a,ll p){return power(a,p-2,p);}//used with feemat little//only for prime
// void gcd(ll a, ll b, ll& d, ll& u, ll& v) {
//     if (b == 0) {
//         d = a;
//         u = 1;
//         v = 0;
//     } else {
//         gcd(b, a % b, d, v, u);
//         // a u + b v = b u' + (a - (a/b) * b) v'
//         // = a v' + b (u' - (a/b) v').
//         v -= a / b * u;
//     }
// }
// ll Inverse(ll a, ll m) {
//     a %= m;
//     if (a < 0) a += m;
//     ll d, u, v;
//     gcd(a, m, d, u, v);
//     assert(d == 1);
//     u %= m;
//     if (u < 0) u += m;
//     return u;
// }

ll gcd(ll x,ll y){if(x==0 || y==0){return max(y,x);}return gcd(y%x,x);}
// ll gcdExtended(ll a,ll b,ll &x,ll &y){if(a==0){x=0;y=1;return b;}ll x1,y1;ll gcd = gcdExtended(b%a,a,x1,y1);x=y1-(b/a)*x1;y=x1;return gcd;}//o(log(b))
// ;

int main(){
	ll n;
    in(n)
    string s;
    cin>>s;
    vi a;
    a.resize(n);
    ll b1=0;
    ll b2=0;
    ll t=0;
    for(ll i=0;i<n;i++){
        if(s[i]=='('){
            if(t){
                b1++;
                a[i]=0;
            }
            else {
                b2++;
                a[i]=1;
            }
            t^=1;
        }
        else {
            if(b1>0){
                b1--;
                a[i]=0;
            }
            else {
                b2--;
                a[i]=1;
            }
        }

    }
    for(auto p:a)cout<<p;
}
/*error-----
convert every int to long long eg-1LL
create array with proper analysis of problem constrain
check mod also
*/


#include <bits/stdc++.h>
using namespace std;
#ifdef ONLINE_JUDGE
    #define cerr if(false)cerr
#else
    #define cerr if(true)cerr
#endif
#define inputarr(a,n) for(ll i=0;i<n;i++) cin>>a[i];
#define prllarr(a,n) for(ll i=0;i<n;i++) cerr<<a[i]<<" "; cerr<<endl;
#define pb push_back
#define ll long long
#define mod 998244353
#define foi ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);
#define in(n) scanf("%lld",&n);
#define in2(x,y) scanf("%lld %lld",&(x),&(y));
#define in3(x,y,z) scanf("%lld %lld %lld",&(x),&(y),&(z));
#define in4(x,y,z,m) scanf("%lld %lld %lld %lld",&(x),&(y),&(z),&(m));
#define out(n) printf("%lld\n",n);
#define out2(x,y) printf("%lld %lld\n",x,y);
#define test(t)  ll t; in(t);while(t--)
#define set(arr,n,s) for(ll i=0;i<n;i++){arr[i]=s;}
#define fr(i,s,e) for(ll i=s;i<e;i++)
#define frr(i,s,e) for(ll i=e-1;i>=s;i--)
#define vi vector<ll>
#define see2(x,y) cerr<<x<<" "<<y<<endl;
#define see(x) cerr<<x<<endl;
#define see3(x,y,z) cerr<<x<<" "<<y<<" "<<z<<endl;
#define see4(x,y,z,m) cout<<x<<" "<<y<<" "<<z<<" "<<m<<endl;
#define invec(a,n) fr(i,0,n){ll x;in(x) a.pb(x);}
#define vii vector<pair<ll,ll> >
#define all(a) a.begin(),a.end()
#define pii pair<ll,ll>

ll power(ll x,ll y,ll p){ll res=1;x=x%p;while(y>0){if(y&1){res=(res*x)%p;} y=y>>1;x=(x*x)%p;}return res;}
ll modInverse(ll a,ll p){return power(a,p-2,p);}//used with feemat little//only for prime
// void gcd(ll a, ll b, ll& d, ll& u, ll& v) {
//     if (b == 0) {
//         d = a;
//         u = 1;
//         v = 0;
//     } else {
//         gcd(b, a % b, d, v, u);
//         // a u + b v = b u' + (a - (a/b) * b) v'
//         // = a v' + b (u' - (a/b) v').
//         v -= a / b * u;
//     }
// }
// ll Inverse(ll a, ll m) {
//     a %= m;
//     if (a < 0) a += m;
//     ll d, u, v;
//     gcd(a, m, d, u, v);
//     assert(d == 1);
//     u %= m;
//     if (u < 0) u += m;
//     return u;
// }

ll gcd(ll x,ll y){if(x==0 || y==0){return max(y,x);}return gcd(y%x,x);}
// ll gcdExtended(ll a,ll b,ll &x,ll &y){if(a==0){x=0;y=1;return b;}ll x1,y1;ll gcd = gcdExtended(b%a,a,x1,y1);x=y1-(b/a)*x1;y=x1;return gcd;}//o(log(b))
// ;

int main(){
	ll n;
    in(n)
    string s;
    cin>>s;
    vi a;
    a.resize(n);
    ll b1=0;
    ll b2=0;
    ll t=0;
    for(ll i=0;i<n;i++){
        if(s[i]=='('){
            if(t){
                b1++;
                a[i]=0;
            }
            else {
                b2++;
                a[i]=1;
            }
            t^=1;
        }
        else {
            if(b1>0){
                b1--;
                a[i]=0;
                t=1;
            }
            else {
                b2--;
                a[i]=1;
                t=0;
            }
        }

    }
    for(auto p:a)cout<<p;
}
/*error-----
convert every int to long long eg-1LL
create array with proper analysis of problem constrain
check mod also
*/


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define N 100000
#define mod 1000000007
int main()
{
	ll n;
	cin>>n;
	string s;
	cin>>s;
	vector<ll> a;
	ll cnt=0;
	for(ll i=0;i<n;i++)
	{
		if(s[i]=='(')
		cnt++;
		else
		cnt--;
		a.pb(cnt);
	}
	ll max=0;
	/*for(ll i=0;i<n;i++)
	{
		cout<<a[i]<<" ";
		if(a[i]>max)
		max=a[i];
	}
	cout<<endl;*/
	max=max/2;
	vector<int> b(n);
	ll temp=0,cur=0;
	for(ll i=0;i<n;i++)
	{
		if(cur==0)
		temp=0;
		if(cur<max && temp==0 && s[i]=='(')
		{
			b[i]=1;
			cur++;
		}
		else if(cur>0 && temp==1 && s[i]==')')
		{
			b[i]=1;
			cur--;
		}
		else if(s[i]==')' && a[i]==0 && cur>0)
		{
			b[i]=1;
			cur--;
		}
		if(cur==max)
		temp=1;
	}
	for(ll i=0;i<n;i++)
	{
		cout<<b[i];
	}

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define N 100000
#define mod 1000000007
int main()
{
	ll n;
	cin>>n;
	string s;
	cin>>s;
	vector<ll> a;
	ll cnt=0;
	for(ll i=0;i<n;i++)
	{
		if(s[i]=='(')
		cnt++;
		else
		cnt--;
		a.pb(cnt);
	}
	ll max=0;
	for(ll i=0;i<n;i++)
	{
		cout<<a[i]<<" ";
		if(a[i]>max)
		max=a[i];
	}
	cout<<endl;
	max=max/2;
	vector<int> b(n);
	ll temp=0,cur=0;
	for(ll i=0;i<n;i++)
	{
		if(cur==0)
		temp=0;
		if(cur<max && temp==0 && s[i]=='(')
		{
			b[i]=1;
			cur++;
		}
		if(cur>0 && temp==1 && s[i]==')')
		{
			b[i]=1;
			cur--;
		}
		if(cur==max)
		temp=1;
	}
	for(ll i=0;i<n;i++)
	{
		cout<<b[i];
	}

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define N 100000
#define mod 1000000007
int main()
{
	ll n;
	cin>>n;
	string s;
	cin>>s;
	vector<ll> a;
	ll cnt=0;
	for(ll i=0;i<n;i++)
	{
		if(s[i]=='(')
		cnt++;
		else
		cnt--;
		a.pb(cnt);
	}
	ll max=0;
	for(ll i=0;i<n;i++)
	{
		cout<<a[i]<<" ";
		if(a[i]>max)
		max=a[i];
	}
	cout<<endl;
	max=max/2;
	vector<int> b(n);
	ll temp=0,cur=0;
	for(ll i=0;i<n;i++)
	{
		if(cur==0)
		temp=0;
		if(cur<max && temp==0 && s[i]=='(')
		{
			b[i]=1;
			cur++;
		}
		else if(cur>0 && temp==1 && s[i]==')')
		{
			b[i]=1;
			cur--;
		}
		else if(s[i]==')' && a[i]==0 && cur>0)
		{
			b[i]=1;
			cur--;
		}
		if(cur==max)
		temp=1;
	}
	for(ll i=0;i<n;i++)
	{
		cout<<b[i];
	}

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define N 100000
#define mod 1000000007
int main()
{
	ll n;
	cin>>n;
	string s;
	cin>>s;
	vector<ll> a;
	ll cnt=0;
	for(ll i=0;i<n;i++)
	{
		if(s[i]=='(')
		cnt++;
		else
		cnt--;
		a.pb(cnt);
	}
	ll max=0;
	for(ll i=0;i<n;i++)
	{
	//	cout<<a[i]<<" ";
		if(a[i]>max)
		max=a[i];
	}
	//cout<<endl;
	max=max/2;
	vector<int> b(n);
	ll temp=0,cur=0;
	for(ll i=0;i<n;i++)
	{
		if(cur==0)
		temp=0;
		if(cur<max && temp==0 && s[i]=='(')
		{
			b[i]=1;
			cur++;
		}
		if(cur>0 && temp==1 && s[i]==')')
		{
			b[i]=1;
			cur--;
		}
		if(cur==max)
		temp=1;
	}
	for(ll i=0;i<n;i++)
	{
		cout<<b[i];
	}

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define N 100000
#define mod 1000000007
int main()
{
	ll n;
	cin>>n;
	string s;
	cin>>s;
	vector<ll> a;
	ll cnt=0;
	for(ll i=0;i<n;i++)
	{
		if(s[i]=='(')
		cnt++;
		else
		cnt--;
		a.pb(cnt);
	}
	ll max=0;
	for(ll i=0;i<n;i++)
	{
		//cout<<a[i]<<" ";
		if(a[i]>max)
		max=a[i];
	}
	//cout<<endl;*/
	max=max/2;
	vector<int> b(n);
	ll temp=0,cur=0;
	for(ll i=0;i<n;i++)
	{
		if(cur==0)
		temp=0;
		if(cur<max && temp==0 && s[i]=='(')
		{
			b[i]=1;
			cur++;
		}
		else if(cur>0 && temp==1 && s[i]==')')
		{
			b[i]=1;
			cur--;
		}
		else if(s[i]==')' && a[i]==0 && cur>0)
		{
			b[i]=1;
			cur--;
		}
		if(cur==max)
		temp=1;
	}
	for(ll i=0;i<n;i++)
	{
		cout<<b[i];
	}

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define N 100000
#define mod 1000000007
int main()
{
	ll n;
	cin>>n;
	string s;
	cin>>s;
	vector<ll> a;
	ll cnt=0;
	for(ll i=0;i<n;i++)
	{
		if(s[i]=='(')
		cnt++;
		else
		cnt--;
		a.pb(cnt);
	}
	ll max=0;
	for(ll i=0;i<n;i++)
	{
		//cout<<a[i]<<" ";
		if(a[i]>max)
		max=a[i];
	}
	//cout<<endl;
	max=max/2;
	vector<int> b(n);
	stack<int> c;
	for(ll i=0;i<n;i++)
	{
		if(s[i]=='(' && c.size()<max)
		{
			b[i]=1;
			c.push(1);
		}
		if(s[i]==')' && c.size()>0)
		{
			b[i]=1;
			c.pop();
		}
	}
	for(ll i=0;i<n;i++)
	{
		cout<<b[i];
	}

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define PI acos(–1)
#define F first
#define S second
#define PB push_back
#define FAST_INPUT ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long long ll;
typedef pair<ll,ll> pl;
typedef vector<ll> vl;
typedef vector<pl> vp;
ll Min(ll a,ll b){return (a<b)?a:b;}
ll Max(ll a,ll b){return (a>b)?a:b;}
ll gcd(ll m, ll n) { if (n == 0) return m; else return gcd(n, m % n); }
ll lcm(ll m, ll n) { return m * n / gcd(m, n); }
// @@@ don’t touch or edit @@@
vector<char>v;
string s;
ll a[300004];
int main(){
    FAST_INPUT
    ll len;
    cin>>len>>s;

    ll cur,mx=0;
    for(int i=0;i<len;i++){
        v.PB(s[i]);
        if(s[i]=='('){
            cur++;
            a[i]=(cur%2);
            mx=Max(mx,cur);
        }
        else{

            a[i]=(cur%2);
            cur--;
            v.pop_back();
            v.pop_back();
        }
    }
    for(int i=0;i<len;i++)cout<<a[i];
    exit(0);
}


#include<bits/stdc++.h>
using namespace std;
#define PI acos(–1)
#define F first
#define S second
#define PB push_back
#define FAST_INPUT ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long long ll;
typedef pair<ll,ll> pl;
typedef vector<ll> vl;
typedef vector<pl> vp;
ll Min(ll a,ll b){return (a<b)?a:b;}
ll Max(ll a,ll b){return (a>b)?a:b;}
ll gcd(ll m, ll n) { if (n == 0) return m; else return gcd(n, m % n); }
ll lcm(ll m, ll n) { return m * n / gcd(m, n); }
// @@@ don’t touch or edit @@@
vector<char>v;
string s;
ll a[300004];
int main(){
    FAST_INPUT
    ll len;
    cin>>len>>s;

    ll cur,mx=0;
    for(int i=0;i<len;i++){
        v.PB(s[i]);
        if(s[i]=='('){
            cur++;
            mx=Max(mx,cur);
        }
        else{
            cur--;
            v.pop_back();
            v.pop_back();
        }
    }
    ll ers=mx/2;
    for(int i=0;i<len;i++){
        v.PB(s[i]);
        if(s[i]=='('){
            cur++;
            if(cur>ers){
                a[i]=1;
            }
        }
        else{
            if(cur>ers){
                a[i]=1;
            }
            cur--;
            v.pop_back();
            v.pop_back();
        }
    }
    for(int i=0;i<len;i++)cout<<a[i];
    exit(0);
}


#include<bits/stdc++.h>
using namespace std;
#define PI acos(–1)
#define F first
#define S second
#define PB push_back
#define FAST_INPUT ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long long ll;
typedef pair<ll,ll> pl;
typedef vector<ll> vl;
typedef vector<pl> vp;
ll Min(ll a,ll b){return (a<b)?a:b;}
ll Max(ll a,ll b){return (a>b)?a:b;}
ll gcd(ll m, ll n) { if (n == 0) return m; else return gcd(n, m % n); }
ll lcm(ll m, ll n) { return m * n / gcd(m, n); }
// @@@ don’t touch or edit @@@
vector<char>v;
string s;
ll a[300004];
int main(){
    FAST_INPUT
    cin>>s;
    ll len=s.length();
    ll cur,mx=0;
    for(int i=0;i<len;i++){
        v.PB(s[i]);
        if(s[i]=='('){
            cur++;
            mx=Max(mx,cur);
        }
        else{
            cur--;
            v.pop_back();
            v.pop_back();
        }
    }
    ll ers=mx/2;
    for(int i=0;i<len;i++){
        v.PB(s[i]);
        if(s[i]=='('){
            cur++;
            if(cur>ers){
                a[i]=1;
            }
        }
        else{
            if(cur>ers){
                a[i]=1;
            }
            cur--;
            v.pop_back();
            v.pop_back();
        }
    }
    for(int i=0;i<len;i++)cout<<a[i];
    exit(0);
}


#include<bits/stdc++.h>
using namespace std;
#define PI acos(–1)
#define F first
#define S second
#define PB push_back
#define FAST_INPUT ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long long ll;
typedef pair<ll,ll> pl;
typedef vector<ll> vl;
typedef vector<pl> vp;
ll Min(ll a,ll b){return (a<b)?a:b;}
ll Max(ll a,ll b){return (a>b)?a:b;}
ll gcd(ll m, ll n) { if (n == 0) return m; else return gcd(n, m % n); }
ll lcm(ll m, ll n) { return m * n / gcd(m, n); }
// @@@ don’t touch or edit @@@
vector<char>v;
string s;
ll a[300004];
int main(){
    FAST_INPUT
    ll len;
    cin>>len>>s;

    ll cur=0,mx=0;
    for(int i=0;i<len;i++){
        v.PB(s[i]);
        if(s[i]=='('){
            cur++;
            mx=Max(mx,cur);
        }
        else{
            cur--;
            v.pop_back();
            v.pop_back();
        }
    }
    ll ers=mx/2;
    for(int i=0;i<len;i++){
        v.PB(s[i]);
        if(s[i]=='('){
            cur++;
            if(cur>ers){
                a[i]=1;
            }
        }
        else{
            if(cur>ers){
                a[i]=1;
            }
            cur--;
            v.pop_back();
            v.pop_back();
        }
    }
    for(int i=0;i<len;i++)cout<<a[i];
    exit(0);
}


#include<iostream>
#include<cstdio>
#include<stack>
#include<cstring>
#define N 200000+10
using namespace std;
int n;
int a[N];
char s[N];
stack<char> take;

int length(){
    char last='(';
    int k=0;
    for(int i=0 ; i<n ; i++){
        if(last=='(' && last==s[i]){
            k++;
        }
        last=s[i];
    }
    return k;
}

void change(int ceng){
    int k=1;
    for(int i=0 ; i<n ; i++){
        if(s[i]=='('){
            if(k <= ceng)
                a[i]=1;
            k++;
        }
        else{
            k--;
            if(k <= ceng)
                a[i]=1;
        }
    }
    return ;
}

int main(){
    //freopen("input.txt","r",stdin);
    scanf("%d",&n);
    for(int i=0 ; i<n ; i++)
        a[i]=0;
    scanf("%s",s);
    int k=length();
    k/=2;
    change(k);
    for(int i=0 ; i<n ; i++)
        cout << a[i];
    return 0;
}


#include<iostream>
#include<cstdio>
#include<stack>
#include<cstring>
#define N 200000+10
using namespace std;
int n;
int a[N];
char s[N];
int length(){
    int k=0;
    int max=0;
    for(int i=0 ; i<n ; i++){
        if(s[i]=='(')
            k++;
        else
            k--;
        if(max<k)
            max=k;
    }
    return max;
}

void change(int ceng){
    int k=1;
    for(int i=0 ; i<n ; i++){
        if(s[i]=='('){
            if(k <= ceng)
                a[i]=0;
            k++;
        }
        else{
            k--;
            if(k <= ceng)
                a[i]=0;
        }
    }
    return ;
}

int main(){
    //freopen("input.txt","r",stdin);
    scanf("%d",&n);
    for(int i=0 ; i<n ; i++)
        a[i]=1;
    scanf("%s",s);
    int k=length();
    //cout << k <<endl;
    k/=2;
    //cout << k <<endl;
    change(k);
    for(int i=0 ; i<n ; i++)
        cout << a[i];
    return 0;
}


#include<iostream>
#include<cstdio>
#include<stack>
#include<cstring>
#define N 200000+10
using namespace std;
int n;
int a[N];
char s[N];
int length(){
    char last='(';
    int k=0;
    for(int i=0 ; i<n ; i++){
        if(last=='(' && last==s[i])
            k++;
        last=s[i];
    }
    return k;
}

void change(int ceng){
    int k=1;
    for(int i=0 ; i<n ; i++){
        if(s[i]=='('){
            if(k <= ceng)
                a[i]=0;
            k++;
        }
        else{
            k--;
            if(k <= ceng)
                a[i]=0;
        }
    }
    return ;
}

int main(){
    //freopen("input.txt","r",stdin);
    scanf("%d",&n);
    for(int i=0 ; i<n ; i++)
        a[i]=1;
    scanf("%s",s);
    int k=length();
    cout << k <<endl;
    k/=2;
    cout << k <<endl;
    change(k);
    for(int i=0 ; i<n ; i++)
        cout << a[i];
    return 0;
}


#include<iostream>
#include<cstdio>
#include<stack>
#include<cstring>
#define N 200000+10
using namespace std;
int n;
int a[N];
char s[N];
stack<char> take;

int length(){
    char last='(';
    int k=0;
    for(int i=0 ; i<n ; i++){
        if(last=='(' && last==s[i]){
            k++;
        }
        last=s[i];
    }
    return k;
}

void change(int ceng){
    int k=1;
    for(int i=0 ; i<n ; i++){
        if(s[i]=='('){
            if(k <= ceng)
                a[i]=1;
            k++;
        }
        else{
            k--;
            if(k <= ceng)
                a[i]=1;
        }
    }
    return ;
}

int main(){
    //freopen("input.txt","r",stdin);
    scanf("%d",&n);
    for(int i=0 ; i<n ; i++)
        a[i]=0;
    scanf("%s",s);
    int k=length();
    k/=2;
    cout << k <<endl;
    change(k);
    for(int i=0 ; i<n ; i++)
        cout << a[i] <<" ";
    return 0;
}


#include<iostream>
#include<cstdio>
#include<stack>
#include<cstring>
#define N 200000+10
using namespace std;
int n;
int a[N];
char s[N];
int length(){
    char last='(';
    int k=0;
    for(int i=0 ; i<n ; i++){
        if(last=='(' && last==s[i])
            k++;
        last=s[i];
    }
    return k;
}

void change(int ceng){
    int k=1;
    for(int i=0 ; i<n ; i++){
        if(s[i]=='('){
            if(k <= ceng)
                a[i]=0;
            k++;
        }
        else{
            k--;
            if(k <= ceng)
                a[i]=0;
        }
    }
    return ;
}

int main(){
    //freopen("input.txt","r",stdin);
    scanf("%d",&n);
    for(int i=0 ; i<n ; i++)
        a[i]=1;
    scanf("%s",s);
    int k=length();
    //cout << k <<endl;
    k/=2;
    //cout << k <<endl;
    change(k);
    for(int i=0 ; i<n ; i++)
        cout << a[i];
    return 0;
}


#include<iostream>
#include<cstdio>
#include<stack>
#include<cstring>
#define N 200000+10
using namespace std;
int n;
int a[N];
char s[N];
stack<char> take;

int length(){
    char last='(';
    int k=0;
    for(int i=0 ; i<n ; i++){
        if(last=='(' && last==s[i]){
            k++;
        }
        last=s[i];
    }
    return k;
}

void change(int ceng){
    int k=1;
    for(int i=0 ; i<n ; i++){
        if(s[i]=='('){
            if(k <= ceng)
                a[i]=1;
            k++;
        }
        else{
            k--;
            if(k <= ceng)
                a[i]=1;
        }
    }
    return ;
}

int main(){
    //freopen("input.txt","r",stdin);
    scanf("%d",&n);
    for(int i=0 ; i<n ; i++)
        a[i]=0;
    scanf("%s",s);
    int k=length();
    k/=2;
    change(k);
    for(int i=0 ; i<n ; i++)
        cout << a[i] <<" ";
    return 0;
}


#include<iostream>
#include<random>
#include <iomanip>
#include<math.h>
#include "vector"
#include "string"
#include "algorithm"
#include "iterator"
#include "map"
#include "set"
#include "stack"
#include "queue"
#include "unordered_map"
#include "unordered_set"
#include"deque"
#define ll long long
#define ld long double
#define uint unsigned long
#define pp pair<ll,ll>
#define rep(v) for(auto&it:(v))
#define repp(a) for(auto&ptr:(a))
#define dbg cout<<"heinto"<<endl;
#define loop(n) for(int i=1;i<=(n);i++)
#define MOD 998244353
#define MAX INT32_MAX
#define MIN INT32_MIN
#define MAXL INT64_MAX
#define MINL INT64_MIN
#define pset(n) setprecision(n)

using namespace std;

ll pow(ll a,ll p,ll m=MOD)
{ll res=1;while(p>0){if(p&1)res=(res*a)%m;a=(a*a)%m;p>>=1;}return res;}

void func(){

	int n;
	cin>>n;

	string s;
	cin>>s;

	int cnt=0;
	int ans=-1;

	for(int i=0;i<s.size();i++){
		if(s[i]=='(')cnt++;
		else cnt--;
		ans=max(ans,cnt);
	}
	cout<<ans<<endl;

	int val = ans- ans/2;
	unordered_set<int>mm;
	int temp=0;
	for(int i=0;i<s.size();i++){
		if(s[i]=='*')continue;
		if(s[i]=='('){
			if(temp==val){
				int j=i;
				int cnt=0;
				while(j<s.size()){
					if(s[j]=='*'){
						j++;
						continue;
					}
					if(s[j]=='(')mm.insert(j++),cnt++;
					else break;
				}
				int k=0;
				int prev=j;
				while(j<s.size() && k<cnt){
					if(s[j]==')')k++,mm.insert(j),s[j]='*';
					j++;
				}
				i=prev-1;
			}
			else temp++;
		}
		else temp--;
	}

	string sol;
	rep(s)sol.push_back('1');
	rep(mm)sol[it]='0';
	cout<<sol;

}

int main(){

	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("out.txt","w",stdout);
	#endif

	func();

	return 0;
}


#include<iostream>
#include<random>
#include <iomanip>
#include<math.h>
#include "vector"
#include "string"
#include "algorithm"
#include "iterator"
#include "map"
#include "set"
#include "stack"
#include "queue"
#include "unordered_map"
#include "unordered_set"
#include"deque"
#define ll long long
#define ld long double
#define uint unsigned long
#define pp pair<ll,ll>
#define rep(v) for(auto&it:(v))
#define repp(a) for(auto&ptr:(a))
#define dbg cout<<"heinto"<<endl;
#define loop(n) for(int i=1;i<=(n);i++)
#define MOD 998244353
#define MAX INT32_MAX
#define MIN INT32_MIN
#define MAXL INT64_MAX
#define MINL INT64_MIN
#define pset(n) setprecision(n)

using namespace std;

ll pow(ll a,ll p,ll m=MOD)
{ll res=1;while(p>0){if(p&1)res=(res*a)%m;a=(a*a)%m;p>>=1;}return res;}

void func(){

	int n;
	cin>>n;

	string s;
	cin>>s;

	int cnt=0;
	int ans=-1;

	for(int i=0;i<s.size();i++){
		if(s[i]=='(')cnt++;
		else cnt--;
		ans=max(ans,cnt);
	}
	//cout<<ans<<endl;

	int val = ans- ans/2;
	unordered_set<int>mm;
	int temp=0;
	for(int i=0;i<s.size();i++){
		if(s[i]=='*')continue;
		if(s[i]=='('){
			if(temp==val){
				int j=i;
				int cnt=0;
				while(j<s.size() && s[j]!=')')mm.insert(j),j++,cnt++;
				int k=0;
				int prev=j;
				while(j<s.size() && k<cnt){
					if(s[j]==')')k++,mm.insert(j),s[j]='*';
					j++;
				}
				i=prev-1;
			}
			else temp++;
		}
		else temp--;
	}

	string sol;
	rep(s)sol.push_back('1');
	rep(mm)sol[it]='0';
	cout<<sol;

}

int main(){

	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("out.txt","w",stdout);
	#endif

	func();

	return 0;
}


#include<iostream>
#include<random>
#include <iomanip>
#include<math.h>
#include "vector"
#include "string"
#include "algorithm"
#include "iterator"
#include "map"
#include "set"
#include "stack"
#include "queue"
#include "unordered_map"
#include "unordered_set"
#include"deque"
#define ll long long
#define ld long double
#define uint unsigned long
#define pp pair<ll,ll>
#define rep(v) for(auto&it:(v))
#define repp(a) for(auto&ptr:(a))
#define dbg cout<<"heinto"<<endl;
#define loop(n) for(int i=1;i<=(n);i++)
#define MOD 998244353
#define MAX INT32_MAX
#define MIN INT32_MIN
#define MAXL INT64_MAX
#define MINL INT64_MIN
#define pset(n) setprecision(n)

using namespace std;

ll pow(ll a,ll p,ll m=MOD)
{ll res=1;while(p>0){if(p&1)res=(res*a)%m;a=(a*a)%m;p>>=1;}return res;}

void func(){

	int n;
	cin>>n;

	string s;
	cin>>s;

	int cnt=0;
	int ans=-1;

	for(int i=0;i<s.size();i++){
		if(s[i]=='(')cnt++;
		else cnt--;
		ans=max(ans,cnt);
	}
	// cout<<ans<<endl;

	int val = ans- ans/2;
	unordered_set<int>mm;
	int temp=0;
	for(int i=0;i<s.size();i++){
		if(s[i]=='*')continue;
		if(s[i]=='('){
			if(temp==val){
				int j=i;
				int cnt=0;
				while(j<s.size()){
					if(s[j]=='*'){
						j++;
						continue;
					}
					if(s[j]=='(')mm.insert(j++),cnt++;
					else break;
				}
				int k=0;
				int prev=j;
				while(j<s.size() && k<cnt){
					if(s[j]==')')k++,mm.insert(j),s[j]='*';
					j++;
				}
				i=prev-1;
			}
			else temp++;
		}
		else temp--;
	}

	string sol;
	rep(s)sol.push_back('1');
	rep(mm)sol[it]='0';
	cout<<sol;

}

int main(){

	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("out.txt","w",stdout);
	#endif

	func();

	return 0;
}


#include<iostream>
#include<random>
#include <iomanip>
#include<math.h>
#include "vector"
#include "string"
#include "algorithm"
#include "iterator"
#include "map"
#include "set"
#include "stack"
#include "queue"
#include "unordered_map"
#include "unordered_set"
#include"deque"
#define ll long long
#define ld long double
#define uint unsigned long
#define pp pair<ll,ll>
#define rep(v) for(auto&it:(v))
#define repp(a) for(auto&ptr:(a))
#define dbg cout<<"heinto"<<endl;
#define loop(n) for(int i=1;i<=(n);i++)
#define MOD 998244353
#define MAX INT32_MAX
#define MIN INT32_MIN
#define MAXL INT64_MAX
#define MINL INT64_MIN
#define pset(n) setprecision(n)

using namespace std;

ll pow(ll a,ll p,ll m=MOD)
{ll res=1;while(p>0){if(p&1)res=(res*a)%m;a=(a*a)%m;p>>=1;}return res;}

void func(){

	int n;
	cin>>n;

	string s;
	cin>>s;

	unordered_set<int>mm;
	string sol;
	rep(s)sol.push_back('1');

	int cnt=n/2;

	int i=0;
	int j=0;
	while(j<cnt/2){
		if(s[i]=='(')mm.insert(i),j++;
		i++;
	}

	i=0;
	j=0;
	while(j<cnt/2){
		if(s[i]==')')mm.insert(i),j++;
		i++;
	}

	rep(mm)sol[it]='0';

	cout<<sol;

}

int main(){

	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("out.txt","w",stdout);
	#endif

	func();

	return 0;
}


#include<iostream>
#include<random>
#include <iomanip>
#include<math.h>
#include "vector"
#include "string"
#include "algorithm"
#include "iterator"
#include "map"
#include "set"
#include "stack"
#include "queue"
#include "unordered_map"
#include "unordered_set"
#include"deque"
#define ll long long
#define ld long double
#define uint unsigned long
#define pp pair<ll,ll>
#define rep(v) for(auto&it:(v))
#define repp(a) for(auto&ptr:(a))
#define dbg cout<<"heinto"<<endl;
#define loop(n) for(int i=1;i<=(n);i++)
#define MOD 998244353
#define MAX INT32_MAX
#define MIN INT32_MIN
#define MAXL INT64_MAX
#define MINL INT64_MIN
#define pset(n) setprecision(n)

using namespace std;

ll pow(ll a,ll p,ll m=MOD)
{ll res=1;while(p>0){if(p&1)res=(res*a)%m;a=(a*a)%m;p>>=1;}return res;}

void func(){

	int n;
	cin>>n;

	string s;
	cin>>s;

	int cnt=0;
	int ans=-1;

	for(int i=0;i<s.size();i++){
		if(s[i]=='(')cnt++;
		else cnt--;
		ans=max(ans,cnt);
	}
	cout<<ans<<endl;

	int val = ans- ans/2;
	unordered_set<int>mm;
	int temp=0;
	for(int i=0;i<s.size();i++){
		if(s[i]=='*')continue;
		if(s[i]=='('){
			if(temp==val){
				int j=i;
				int cnt=0;
				while(j<s.size()){
					if(s[j]=='*'){
						j++;
						continue;
					}
					if(s[j]=='(')mm.insert(j);
					j++;
				}
				int k=0;
				int prev=j;
				while(j<s.size() && k<cnt){
					if(s[j]==')')k++,mm.insert(j),s[j]='*';
					j++;
				}
				i=prev-1;
			}
			else temp++;
		}
		else temp--;
	}

	string sol;
	rep(s)sol.push_back('1');
	rep(mm)sol[it]='0';
	cout<<sol;

}

int main(){

	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("out.txt","w",stdout);
	#endif

	func();

	return 0;
}


#include<bits/stdc++.h>
#define fff	ios_base::sync_with_stdio(0);cin.tie(0)
#define _for(i,_) for(int i=0 ; i<_ ; i++)
#define _forr(i,_) for(int i=1 ; i<=_ ; i++)
#define _rof(i,_) for(int i=_-1 ; i>=0 ; i--)
#define _roff(i,_) for(int i=_ ; i>=1 ; i--)
#define NL cout << endl
#define SP cout << " "
#define pb push_back
#define pp pop_back
#define inf INT_MAX
#define INF 1e18
#define ss second
#define ff first
using namespace std;
typedef	long long ll;
typedef long double ld;
typedef	pair<ll,ll> pl;
typedef	vector<ll> vl;
typedef	vector<int> vi;
const int mod = 1000000007;
const int MAX = 500009;

ll n, z, o, l;
string s;

int main()
{
    cin >> n >> s;
    _for(i,n)
    {
        if(s[i] == '(')
        {
            if(z <= o)
                cout << 0,
                l = 0,
                z++;
            else
                cout << 1,
                l = 1,
                o++;
        }
        else
        {
            if(z < o)
                cout << 1,
                o--;
            else if(z > o)
                cout << 0,
                z--;
            else
            {
                if(l >= 0)
                    cout << 0,
                    z--;
                else
                    cout << 1,
                    o--;
            }
        }
    }
}


#include<bits/stdc++.h>
#define fff	ios_base::sync_with_stdio(0);cin.tie(0)
#define _for(i,_) for(int i=0 ; i<_ ; i++)
#define _forr(i,_) for(int i=1 ; i<=_ ; i++)
#define _rof(i,_) for(int i=_-1 ; i>=0 ; i--)
#define _roff(i,_) for(int i=_ ; i>=1 ; i--)
#define NL cout << endl
#define SP cout << " "
#define pb push_back
#define pp pop_back
#define inf INT_MAX
#define INF 1e18
#define ss second
#define ff first
using namespace std;
typedef	long long ll;
typedef long double ld;
typedef	pair<ll,ll> pl;
typedef	vector<ll> vl;
typedef	vector<int> vi;
const int mod = 1000000007;
const int MAX = 500009;

ll n, z, o;
stack<int> l;
string s;

int main()
{
    cin >> n >> s;
    _for(i,n)
    {
        if(s[i] == '(')
        {
            if(z <= o)
                cout << 0,
                l.push(0),
                z++;
            else
                cout << 1,
                l.push(1),
                o++;
        }
        else
        {
            ll t = l.top();
            l.pop();
            cout << t;
        }
    }
}


#include<bits/stdc++.h>
#define fff	ios_base::sync_with_stdio(0);cin.tie(0)
#define _for(i,_) for(int i=0 ; i<_ ; i++)
#define _forr(i,_) for(int i=1 ; i<=_ ; i++)
#define _rof(i,_) for(int i=_-1 ; i>=0 ; i--)
#define _roff(i,_) for(int i=_ ; i>=1 ; i--)
#define NL cout << endl
#define SP cout << " "
#define pb push_back
#define pp pop_back
#define inf INT_MAX
#define INF 1e18
#define ss second
#define ff first
using namespace std;
typedef	long long ll;
typedef long double ld;
typedef	pair<ll,ll> pl;
typedef	vector<ll> vl;
typedef	vector<int> vi;
const int mod = 1000000007;
const int MAX = 500009;

ll n, z, o, l;
string s;

int main()
{
    cin >> n >> s;
    _for(i,n)
    {
        if(s[i] == '(')
        {
            if(z <= o)
                cout << 0,
                l = 0,
                z++;
            else
                cout << 1,
                l = 1,
                o++;
        }
        else
        {
            if(z < o)
                cout << 0,
                z++;
            else if(z > o)
                cout << 1,
                o++;
            else
            {
                if(l >= 0)
                    cout << 0,
                    z++;
                else
                    cout << 1,
                    o++;
            }
        }
    }
}


#include<vector>
#include <iostream>
#include<algorithm>
#include<cmath>
#include<set>
#include<string>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false); cout.tie(0);
    int t; cin >> t;
    string s; cin >> s; vector<bool> v(t); v[0] = 1;
    for (int i = 1; i < s.size(); i++) {
        if (s[i - 1] == '(' && s[i] == '(') {
            v[i] = !v[i - 1];
        }
        else if (s[i - 1] == '(' && s[i] == ')') {
            v[i] = v[i - 1];
        }
        else if (s[i - 1] == ')' && s[i] == ')') {
            v[i] = !v[i - 1];
        }
        else if (s[i - 1] == ')' && s[i] == '(') {
            v[i] = v[i - 1];
        }
    }
    for (auto i : v) cout << i;
}


#include<vector>
#include <iostream>
#include<algorithm>
#include<cmath>
#include<set>
#include<string>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false); cout.tie(0);
    int t,cnt = 1; cin >> t;
    string s; cin >> s; vector<bool> v(t); v[0] = 1;
    cout << 1;
    for (int i = 1; i < s.size(); i++) {
        int prevcnt = cnt;
        if (s[i] == '(') cnt++;
        else cnt--;
        if (prevcnt < cnt) {
            if (v[i - 1]) {
                v[i] = 0;
                cout << 0;
            }
            else {
                v[i] = 1;
                cout << 1;
            }
        }
        else {
            v[i] = v[i - 1];
            cout << v[i];
        }
    }
}


#include<vector>
#include <iostream>
#include<algorithm>
#include<cmath>
#include<set>
#include<string>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false); cout.tie(0);
    int t; cin >> t;
    vector<int> ans(t);
    vector<pair<char, int>> v(t); for (int i = 0; i < t; i++) {
        cin >> v[i].first;
        v[i].second = i;
    }
    bool cnt = 0;
    int sz = v.size();
    while (sz > 0) {
        cnt = !cnt;
        for (int i = 0; i < sz - 1; i++) {
            if (v[i].first == '(' && v[i + 1].first == ')') {
                ans[v[i].second] = cnt; ans[v[i + 1].second] = cnt;
                v.erase(v.begin() + i); v.erase(v.begin() + i); i--;
            }
            sz = v.size();
        }
        sz = v.size();
    }
    for (auto i : ans) cout << i;
}


#include<vector>
#include <iostream>
#include<algorithm>
#include<cmath>
#include<set>
#include<string>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false); cout.tie(0);
    int t; cin >> t;
    string s; cin >> s; vector<bool> v(t); v[0] = 1;
    for (int i = 1; i < s.size(); i++) {
        if (s[i - 1] == '(' && s[i] == '(') {
            v[i] = !v[i - 1];
        }
        else if (s[i - 1] == '(' && s[i] == ')') {
            v[i] = v[i - 1];
        }
        else if (s[i - 1] == ')' && s[i] == ')') {
            v[i] = !v[i - 1];
        }
        else if (s[i - 1] == ')' && s[i] == '(') {
            v[i] = !v[i - 1];
        }
    }
    for (auto i : v) cout << i;
}


#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;

//c++ templte for help.......................................................................................................................................................

typedef long long ll;
typedef long double ld;

template<typename... T>
void print1(T... t){
    ((cout<<t<<" "),...);
}

template<typename... T>
void print2(T... t){
        vector<vector<ll>> ans={t...};
        for(ll i=0;i<(ll)ans.size();i++){
            if(i!=0) cerr<<"\t\t";
            else cerr<<"\t";
            for(ll j=0;j<(ll)ans[i].size();j++){
                cerr<<ans[i][j]<<" ";
            }
            if(i!=(ll)ans.size()-1)
            cerr<<endl;
        }
}
#define deb(...) {cerr<<" [ "#__VA_ARGS__<<" : "; print1(__VA_ARGS__); cerr<<"]"<<endl; }
#define vdeb(...) {cerr<<" [ "#__VA_ARGS__<<" : "; print2(__VA_ARGS__); cerr<<"]"<<endl;}

// to return everything in string
#define ret(...) {stringstream returnn;returnn<<__VA_ARGS__;return returnn.str();}

stringstream retvec;
template<typename... T>
void returnvector(T... t){
        vector<vector<ll>> ans={t...};
        for(ll i=0;i<(ll)ans.size();i++){
            for(ll j=0;j<(ll)ans[i].size();j++){
                retvec<<ans[i][j];
                if(j!=(ll)ans[i].size()-1)
                    retvec<<" ";
            }
            if(i!=(ll)ans.size()-1)
                retvec<<endl;
        }
}
#define vret(...) {retvec.clear();returnvector(__VA_ARGS__);return retvec.str();}

//for loop
#define fo(i,n) for(int i=0;i<(ll)n;i++)
#define Fo(i,k,n) for(int i=k;i<n;i++)

//to print vector element
template<typename T>
void printV(T vec){
    fo(i,vec.size()) cout<<vec[i]<<" "<<flush;
    cout<<endl;
    }

#define M ll(1e9+7)
const ll INF=ll(1e10+5);

//iterate map
template<typename T>
void itR(T map){
     for(auto itr=map.begin();itr!=map.end();itr++){
                deb(itr->first,itr->second);
            }
    cout<<endl;
}

typedef tree<
ll,
null_type,
greater<int>,
rb_tree_tag,
tree_order_statistics_node_update>
pods;

//c++ template for help.....................................................................................................................................................

string solve(){
	// CALM DOWN : - )

	ll n;
	cin>>n;

	string s;
	cin>>s;

	ll cnt=0;
	ll ans=0;
	stack<char> sta;
	for(auto x:s){
		if(sta.empty()) sta.push(x);
		else if(sta.top()=='(' and x==')'){
			sta.pop();
		}else sta.push(x);
		ans=max(ans,(ll)sta.size());
	}

	//deb(ans);
	ans=(ans+1)/2;

	cnt=0;
	vector<pair<char,ll>> st_vec;
	for(int i=0;i<n;i++){st_vec.push_back({s[i],0});}

	for(int i=0;i<n;i++){
		if(s[i]=='('){
			cnt++;
			//deb(cnt,ans);
			if(cnt<=ans){
				st_vec[i].second=1;
			}
		}else cnt--;
	}

	//for(int j=0;j<n;j++){
		//cout<<st_vec[j].second;
	//}cout<<endl;

	//exit(1);

	stack<pair<char,ll>> st;
	for(int i=0;i<n;i++){
		//deb(1,i);
		//if(i==1) deb(st.top().first,st_vec[i].first);
		if(st.empty()) st.push(st_vec[i]);
		else if(st.top().first=='(' and st_vec[i].first==')'){
			if(st.top().second==1)
				st_vec[i].second=1;
			st.pop();
		}else st.push(st_vec[i]);
		//deb(2,i);
	}

	for(int j=0;j<n;j++){
		cout<<st_vec[j].second;
	}cout<<endl;

ret("");
}

int main() {
    cout<<setprecision(20);
    ios::sync_with_stdio(0);
    cin.tie(0);

    //ll testCase;
    //cin>>testCase;
    //for(ll tt=0;tt<testCase;tt++){
        string ans1=solve();
        if(ans1!="")
            cout<<ans1<<endl;
    //}
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;

//c++ templte for help.......................................................................................................................................................

typedef long long ll;
typedef long double ld;

template<typename... T>
void print1(T... t){
    ((cout<<t<<" "),...);
}

template<typename... T>
void print2(T... t){
        vector<vector<ll>> ans={t...};
        for(ll i=0;i<(ll)ans.size();i++){
            if(i!=0) cerr<<"\t\t";
            else cerr<<"\t";
            for(ll j=0;j<(ll)ans[i].size();j++){
                cerr<<ans[i][j]<<" ";
            }
            if(i!=(ll)ans.size()-1)
            cerr<<endl;
        }
}
#define deb(...) {cerr<<" [ "#__VA_ARGS__<<" : "; print1(__VA_ARGS__); cerr<<"]"<<endl; }
#define vdeb(...) {cerr<<" [ "#__VA_ARGS__<<" : "; print2(__VA_ARGS__); cerr<<"]"<<endl;}

// to return everything in string
#define ret(...) {stringstream returnn;returnn<<__VA_ARGS__;return returnn.str();}

stringstream retvec;
template<typename... T>
void returnvector(T... t){
        vector<vector<ll>> ans={t...};
        for(ll i=0;i<(ll)ans.size();i++){
            for(ll j=0;j<(ll)ans[i].size();j++){
                retvec<<ans[i][j];
                if(j!=(ll)ans[i].size()-1)
                    retvec<<" ";
            }
            if(i!=(ll)ans.size()-1)
                retvec<<endl;
        }
}
#define vret(...) {retvec.clear();returnvector(__VA_ARGS__);return retvec.str();}

//for loop
#define fo(i,n) for(int i=0;i<(ll)n;i++)
#define Fo(i,k,n) for(int i=k;i<n;i++)

//to print vector element
template<typename T>
void printV(T vec){
    fo(i,vec.size()) cout<<vec[i]<<" "<<flush;
    cout<<endl;
    }

#define M ll(1e9+7)
const ll INF=ll(1e10+5);

//iterate map
template<typename T>
void itR(T map){
     for(auto itr=map.begin();itr!=map.end();itr++){
                deb(itr->first,itr->second);
            }
    cout<<endl;
}

typedef tree<
ll,
null_type,
greater<int>,
rb_tree_tag,
tree_order_statistics_node_update>
pods;

//c++ template for help.....................................................................................................................................................

string solve(){
	// CALM DOWN : - )

	ll n;
	cin>>n;

	string s;
	cin>>s;

	ll cnt=0;
	ll ans=0;
	for(auto x:s){
		if(x=='(') cnt++;
		else cnt=0;
		ans=max(ans,cnt);
	}

	ll maxi=ans;
	ans=(ans+1)/2;

	cnt=0;
	vector<pair<char,ll>> st_vec;
	for(int i=0;i<n;i++){st_vec.push_back({s[i],0});}

	for(int i=0;i<n;i++){
		if(s[i]=='('){
			cnt++;
			if(cnt==maxi){
				for(int j=i;j>i-ans;j--){
					st_vec[j].second=1;
				}
				break;
			}
		}else cnt=0;
	}

	//for(int j=0;j<n;j++){
		//cout<<st_vec[j].second;
	//}cout<<endl;

	//exit(1);

	stack<pair<char,ll>> st;
	for(int i=0;i<n;i++){
		//deb(1,i);
		//if(i==1) deb(st.top().first,st_vec[i].first);
		if(st.empty()) st.push(st_vec[i]);
		else if(st.top().first=='(' and st_vec[i].first==')'){
			if(st.top().second==1)
				st_vec[i].second=1;
			st.pop();
		}else st.push(st_vec[i]);
		//deb(2,i);
	}

	for(int j=0;j<n;j++){
		cout<<st_vec[j].second;
	}cout<<endl;

ret("");
}

int main() {
    cout<<setprecision(20);
    ios::sync_with_stdio(0);
    cin.tie(0);

    //ll testCase;
    //cin>>testCase;
    //for(ll tt=0;tt<testCase;tt++){
        string ans1=solve();
        if(ans1!="")
            cout<<ans1<<endl;
    //}
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;

//c++ templte for help.......................................................................................................................................................

typedef long long ll;
typedef long double ld;

template<typename... T>
void print1(T... t){
    ((cout<<t<<" "),...);
}

template<typename... T>
void print2(T... t){
        vector<vector<ll>> ans={t...};
        for(ll i=0;i<(ll)ans.size();i++){
            if(i!=0) cerr<<"\t\t";
            else cerr<<"\t";
            for(ll j=0;j<(ll)ans[i].size();j++){
                cerr<<ans[i][j]<<" ";
            }
            if(i!=(ll)ans.size()-1)
            cerr<<endl;
        }
}
#define deb(...) {cerr<<" [ "#__VA_ARGS__<<" : "; print1(__VA_ARGS__); cerr<<"]"<<endl; }
#define vdeb(...) {cerr<<" [ "#__VA_ARGS__<<" : "; print2(__VA_ARGS__); cerr<<"]"<<endl;}

// to return everything in string
#define ret(...) {stringstream returnn;returnn<<__VA_ARGS__;return returnn.str();}

stringstream retvec;
template<typename... T>
void returnvector(T... t){
        vector<vector<ll>> ans={t...};
        for(ll i=0;i<(ll)ans.size();i++){
            for(ll j=0;j<(ll)ans[i].size();j++){
                retvec<<ans[i][j];
                if(j!=(ll)ans[i].size()-1)
                    retvec<<" ";
            }
            if(i!=(ll)ans.size()-1)
                retvec<<endl;
        }
}
#define vret(...) {retvec.clear();returnvector(__VA_ARGS__);return retvec.str();}

//for loop
#define fo(i,n) for(int i=0;i<(ll)n;i++)
#define Fo(i,k,n) for(int i=k;i<n;i++)

//to print vector element
template<typename T>
void printV(T vec){
    fo(i,vec.size()) cout<<vec[i]<<" "<<flush;
    cout<<endl;
    }

#define M ll(1e9+7)
const ll INF=ll(1e10+5);

//iterate map
template<typename T>
void itR(T map){
     for(auto itr=map.begin();itr!=map.end();itr++){
                deb(itr->first,itr->second);
            }
    cout<<endl;
}

typedef tree<
ll,
null_type,
greater<int>,
rb_tree_tag,
tree_order_statistics_node_update>
pods;

//c++ template for help.....................................................................................................................................................

string solve(){
	// CALM DOWN : - )

	ll n;
	cin>>n;

	string s;
	cin>>s;

	ll cnt=0;
	ll ans=0;
	for(auto x:s){
		if(x=='(') cnt++;
		else cnt=0;
		ans=max(ans,cnt);
	}

	ans=(ans+1)/2;

	cnt=0;
	vector<pair<char,ll>> st_vec;
	for(int i=0;i<n;i++){st_vec.push_back({s[i],0});}

	for(int i=0;i<n;i++){
		if(s[i]=='('){
			cnt++;
			//deb(cnt,ans);
			if(cnt<=ans){
				st_vec[i].second=1;
			}
		}else cnt--;
	}

	//for(int j=0;j<n;j++){
		//cout<<st_vec[j].second;
	//}cout<<endl;

	//exit(1);

	stack<pair<char,ll>> st;
	for(int i=0;i<n;i++){
		//deb(1,i);
		//if(i==1) deb(st.top().first,st_vec[i].first);
		if(st.empty()) st.push(st_vec[i]);
		else if(st.top().first=='(' and st_vec[i].first==')'){
			if(st.top().second==1)
				st_vec[i].second=1;
			st.pop();
		}else st.push(st_vec[i]);
		//deb(2,i);
	}

	for(int j=0;j<n;j++){
		cout<<st_vec[j].second;
	}cout<<endl;

ret("");
}

int main() {
    cout<<setprecision(20);
    ios::sync_with_stdio(0);
    cin.tie(0);

    //ll testCase;
    //cin>>testCase;
    //for(ll tt=0;tt<testCase;tt++){
        string ans1=solve();
        if(ans1!="")
            cout<<ans1<<endl;
    //}
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;

//c++ templte for help.......................................................................................................................................................

typedef long long ll;
typedef long double ld;

template<typename... T>
void print1(T... t){
    ((cout<<t<<" "),...);
}

template<typename... T>
void print2(T... t){
        vector<vector<ll>> ans={t...};
        for(ll i=0;i<(ll)ans.size();i++){
            if(i!=0) cerr<<"\t\t";
            else cerr<<"\t";
            for(ll j=0;j<(ll)ans[i].size();j++){
                cerr<<ans[i][j]<<" ";
            }
            if(i!=(ll)ans.size()-1)
            cerr<<endl;
        }
}
#define deb(...) {cerr<<" [ "#__VA_ARGS__<<" : "; print1(__VA_ARGS__); cerr<<"]"<<endl; }
#define vdeb(...) {cerr<<" [ "#__VA_ARGS__<<" : "; print2(__VA_ARGS__); cerr<<"]"<<endl;}

// to return everything in string
#define ret(...) {stringstream returnn;returnn<<__VA_ARGS__;return returnn.str();}

stringstream retvec;
template<typename... T>
void returnvector(T... t){
        vector<vector<ll>> ans={t...};
        for(ll i=0;i<(ll)ans.size();i++){
            for(ll j=0;j<(ll)ans[i].size();j++){
                retvec<<ans[i][j];
                if(j!=(ll)ans[i].size()-1)
                    retvec<<" ";
            }
            if(i!=(ll)ans.size()-1)
                retvec<<endl;
        }
}
#define vret(...) {retvec.clear();returnvector(__VA_ARGS__);return retvec.str();}

//for loop
#define fo(i,n) for(int i=0;i<(ll)n;i++)
#define Fo(i,k,n) for(int i=k;i<n;i++)

//to print vector element
template<typename T>
void printV(T vec){
    fo(i,vec.size()) cout<<vec[i]<<" "<<flush;
    cout<<endl;
    }

#define M ll(1e9+7)
const ll INF=ll(1e10+5);

//iterate map
template<typename T>
void itR(T map){
     for(auto itr=map.begin();itr!=map.end();itr++){
                deb(itr->first,itr->second);
            }
    cout<<endl;
}

typedef tree<
ll,
null_type,
greater<int>,
rb_tree_tag,
tree_order_statistics_node_update>
pods;

//c++ template for help.....................................................................................................................................................

string solve(){
	// CALM DOWN : - )

	ll n;
	cin>>n;

	string s;
	cin>>s;

	ll cnt=0;
	ll ans=0;
	for(auto x:s){
		if(x=='(') cnt++;
		else cnt=0;
		ans=max(ans,cnt);
	}

	ans=(ans+1)/2;

	cnt=0;
	vector<pair<char,ll>> st_vec;
	for(int i=0;i<n;i++){st_vec.push_back({s[i],0});}

	for(int i=0;i<n;i++){
		if(s[i]=='('){
			cnt++;
			//deb(cnt,ans);
			if(cnt<=ans){
				st_vec[i].second=1;
			}
		}else cnt=0;
	}

	//for(int j=0;j<n;j++){
		//cout<<st_vec[j].second;
	//}cout<<endl;

	//exit(1);

	stack<pair<char,ll>> st;
	for(int i=0;i<n;i++){
		//deb(1,i);
		//if(i==1) deb(st.top().first,st_vec[i].first);
		if(st.empty()) st.push(st_vec[i]);
		else if(st.top().first=='(' and st_vec[i].first==')'){
			if(st.top().second==1)
				st_vec[i].second=1;
			st.pop();
		}else st.push(st_vec[i]);
		//deb(2,i);
	}

	for(int j=0;j<n;j++){
		cout<<st_vec[j].second;
	}cout<<endl;

ret("");
}

int main() {
    cout<<setprecision(20);
    ios::sync_with_stdio(0);
    cin.tie(0);

    //ll testCase;
    //cin>>testCase;
    //for(ll tt=0;tt<testCase;tt++){
        string ans1=solve();
        if(ans1!="")
            cout<<ans1<<endl;
    //}
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;

//c++ templte for help.......................................................................................................................................................

typedef long long ll;
typedef long double ld;

template<typename... T>
void print1(T... t){
    ((cout<<t<<" "),...);
}

template<typename... T>
void print2(T... t){
        vector<vector<ll>> ans={t...};
        for(ll i=0;i<(ll)ans.size();i++){
            if(i!=0) cerr<<"\t\t";
            else cerr<<"\t";
            for(ll j=0;j<(ll)ans[i].size();j++){
                cerr<<ans[i][j]<<" ";
            }
            if(i!=(ll)ans.size()-1)
            cerr<<endl;
        }
}
#define deb(...) {cerr<<" [ "#__VA_ARGS__<<" : "; print1(__VA_ARGS__); cerr<<"]"<<endl; }
#define vdeb(...) {cerr<<" [ "#__VA_ARGS__<<" : "; print2(__VA_ARGS__); cerr<<"]"<<endl;}

// to return everything in string
#define ret(...) {stringstream returnn;returnn<<__VA_ARGS__;return returnn.str();}

stringstream retvec;
template<typename... T>
void returnvector(T... t){
        vector<vector<ll>> ans={t...};
        for(ll i=0;i<(ll)ans.size();i++){
            for(ll j=0;j<(ll)ans[i].size();j++){
                retvec<<ans[i][j];
                if(j!=(ll)ans[i].size()-1)
                    retvec<<" ";
            }
            if(i!=(ll)ans.size()-1)
                retvec<<endl;
        }
}
#define vret(...) {retvec.clear();returnvector(__VA_ARGS__);return retvec.str();}

//for loop
#define fo(i,n) for(int i=0;i<(ll)n;i++)
#define Fo(i,k,n) for(int i=k;i<n;i++)

//to print vector element
template<typename T>
void printV(T vec){
    fo(i,vec.size()) cout<<vec[i]<<" "<<flush;
    cout<<endl;
    }

#define M ll(1e9+7)
const ll INF=ll(1e10+5);

//iterate map
template<typename T>
void itR(T map){
     for(auto itr=map.begin();itr!=map.end();itr++){
                deb(itr->first,itr->second);
            }
    cout<<endl;
}

typedef tree<
ll,
null_type,
greater<int>,
rb_tree_tag,
tree_order_statistics_node_update>
pods;

//c++ template for help.....................................................................................................................................................

string solve(){
	// CALM DOWN : - )

	ll n;
	cin>>n;

	string s;
	cin>>s;

	ll cnt=0;
	ll ans=0;
	for(auto x:s){
		if(x=='(') cnt++;
		else cnt=0;
		ans=max(ans,cnt);
	}

	ll maxi=ans;
	ans=(ans+1)/2;

	cnt=0;
	vector<pair<char,ll>> st_vec;
	for(int i=0;i<n;i++){
		st_vec.push_back({s[i],0});
		if(s[i]=='('){
			cnt++;
			if(cnt==maxi){
				for(int j=i;j>i-ans;j--){
					st_vec[j].second=1;
				}
			}
		}else cnt=0;
	}

	stack<pair<char,ll>> st;
	for(int i=0;i<n;i++){
		//deb(1,i);
		//if(i==1) deb(st.top().first,st_vec[i].first);
		if(st.empty()) st.push(st_vec[i]);
		else if(st.top().first=='(' and st_vec[i].first==')'){
			if(st.top().second==1)
				st_vec[i].second=1;
			st.pop();
		}else st.push(st_vec[i]);
		//deb(2,i);
	}

	for(int j=0;j<n;j++){
		cout<<st_vec[j].second;
	}cout<<endl;

ret("");
}

int main() {
    cout<<setprecision(20);
    ios::sync_with_stdio(0);
    cin.tie(0);

    //ll testCase;
    //cin>>testCase;
    //for(ll tt=0;tt<testCase;tt++){
        string ans1=solve();
        if(ans1!="")
            cout<<ans1<<endl;
    //}
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;

//c++ templte for help.......................................................................................................................................................

typedef long long ll;
typedef long double ld;

template<typename... T>
void print1(T... t){
    ((cout<<t<<" "),...);
}

template<typename... T>
void print2(T... t){
        vector<vector<ll>> ans={t...};
        for(ll i=0;i<(ll)ans.size();i++){
            if(i!=0) cerr<<"\t\t";
            else cerr<<"\t";
            for(ll j=0;j<(ll)ans[i].size();j++){
                cerr<<ans[i][j]<<" ";
            }
            if(i!=(ll)ans.size()-1)
            cerr<<endl;
        }
}
#define deb(...) {cerr<<" [ "#__VA_ARGS__<<" : "; print1(__VA_ARGS__); cerr<<"]"<<endl; }
#define vdeb(...) {cerr<<" [ "#__VA_ARGS__<<" : "; print2(__VA_ARGS__); cerr<<"]"<<endl;}

// to return everything in string
#define ret(...) {stringstream returnn;returnn<<__VA_ARGS__;return returnn.str();}

stringstream retvec;
template<typename... T>
void returnvector(T... t){
        vector<vector<ll>> ans={t...};
        for(ll i=0;i<(ll)ans.size();i++){
            for(ll j=0;j<(ll)ans[i].size();j++){
                retvec<<ans[i][j];
                if(j!=(ll)ans[i].size()-1)
                    retvec<<" ";
            }
            if(i!=(ll)ans.size()-1)
                retvec<<endl;
        }
}
#define vret(...) {retvec.clear();returnvector(__VA_ARGS__);return retvec.str();}

//for loop
#define fo(i,n) for(int i=0;i<(ll)n;i++)
#define Fo(i,k,n) for(int i=k;i<n;i++)

//to print vector element
template<typename T>
void printV(T vec){
    fo(i,vec.size()) cout<<vec[i]<<" "<<flush;
    cout<<endl;
    }

#define M ll(1e9+7)
const ll INF=ll(1e10+5);

//iterate map
template<typename T>
void itR(T map){
     for(auto itr=map.begin();itr!=map.end();itr++){
                deb(itr->first,itr->second);
            }
    cout<<endl;
}

typedef tree<
ll,
null_type,
greater<int>,
rb_tree_tag,
tree_order_statistics_node_update>
pods;

//c++ template for help.....................................................................................................................................................

string solve(){
	// CALM DOWN : - )

	ll n;
	cin>>n;

	string s;
	cin>>s;

	ll cnt=0;
	ll ans=0;
	for(auto x:s){
		if(x=='(') cnt++;
		else cnt=0;
		ans=max(ans,cnt);
	}

	ll maxi=ans;
	ans=(ans+1)/2;

	cnt=0;
	vector<pair<char,ll>> st_vec;
	for(int i=0;i<n;i++){
		st_vec.push_back({s[i],0});
		if(s[i]=='('){
			cnt++;
			if(cnt==maxi){
				for(int j=i;j>i-ans;j--){
					st_vec[j].second=1;
				}
				break;
			}
		}else cnt=0;
	}

	stack<pair<char,ll>> st;
	for(int i=0;i<n;i++){
		//deb(1,i);
		//if(i==1) deb(st.top().first,st_vec[i].first);
		if(st.empty()) st.push(st_vec[i]);
		else if(st.top().first=='(' and st_vec[i].first==')'){
			if(st.top().second==1)
				st_vec[i].second=1;
			st.pop();
		}else st.push(st_vec[i]);
		//deb(2,i);
	}

	for(int j=0;j<n;j++){
		cout<<st_vec[j].second;
	}cout<<endl;

ret("");
}

int main() {
    cout<<setprecision(20);
    ios::sync_with_stdio(0);
    cin.tie(0);

    //ll testCase;
    //cin>>testCase;
    //for(ll tt=0;tt<testCase;tt++){
        string ans1=solve();
        if(ans1!="")
            cout<<ans1<<endl;
    //}
    return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include "math.h"
#include "unordered_map"
#include <set>
#include <time.h>
#include <deque>
#include <iomanip>
#include <map>
#include <queue>
#include <stack>
#include <memory.h>

using namespace std;
typedef long long int ll;
typedef long double ld;
#define debug(val) "[ " << #val " : " << (val)
#define space " "
#define vi vector<int>
#define PI (double)(atan(1)*4)
#define pb push_back
#define pi pair<int , int >
#define ff first
#define ss second
#define INF 2000000000
vi dx = {-1, 0, 0, 1};
vi dy = {0, -1, 1, 0};

void solve() {
    int n;
    cin >> n;
    string s;
    cin >> s;
    string res = "";
    stack<int> st;
    for (int i = 0; i < n; i++) {
        if (s[i] == '(') {
            if ((int) st.size() % 2 == 0) res.push_back('1');
            else res.pb('0');
            st.push(res.back() - '0');
        } else {
            res.push_back((char) ('0' + st.top()));
            st.pop();
        }
    }
    cout << res << endl;

}

//#define _DEBUG

int main() {
#ifdef _DEBUG // place in cmake-build-debug folder
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int q = 1;
    //  cin >> q;
    for (int i = 1; i <= q; i++) {
       // cout << "Case #" << i << ": ";
        solve();
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef  unsigned long long ull;
#define IO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

int main() {
    IO;
    int n ;
    cin>>n ;
    string str;
    cin>>str;
    string ans(n,'?');
    stack<char>stk;
    int R=0,S=0;
    for(int i = 0 ; i< n;i ++){
        if(str[i]=='('){
            if(R>S){
                ans[i]='1';
                S++;
            }else{
                R++;
                ans[i]='0';
            }
            stk.push(ans[i]);
        }else{
            if(stk.top()=='1'){
                S--;
                ans[i]='1';
            }else{
                ans[i]='0';
                R--;
            }
            stk.pop();
        }

    }
    cout<<ans<<endl;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef  unsigned long long ull;
#define IO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
const int N = 5e5+5;

int main() {
    IO;
    int n ;
    cin>>n ;
    string str;
    cin>>str;
    string ans(n,'?');
    bool isR= true;
    for(int  i = 0; i< n; i++){
        if(str[i]=='('){
            if(isR){
                isR=false;
                ans[i]='1';
            }else{
                isR=true;
                ans[i]='0';
            }
        }
    }
    stack<char>die;
    for(int i = 0; i< n ; i++){
        if(ans[i]!='?')die.push(ans[i]);
        else{
            ans[i]=die.top();
            die.pop();
        }
    }
    cout<<ans<<endl;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include "math.h"
#include "unordered_map"
#include <set>
#include <time.h>
#include <deque>
#include <iomanip>
#include <map>
#include <queue>
#include <stack>
#include <memory.h>

using namespace std;
typedef long long int ll;
typedef long double ld;
#define debug(val) "[ " << #val " : " << (val)
#define space " "
#define vi vector<int>
#define PI (double)(atan(1)*4)
#define pb push_back
#define pi pair<int , int >
#define ff first
#define ss second
#define INF 2000000000
vi dx = {-1, 0, 0, 1};
vi dy = {0, -1, 1, 0};

void solve() {
    int n;
    cin >> n;
    string s;
    cin >> s;
    string res = "";
    stack<int> st;
    for (int i = 0; i < n; i++) {
        if (s[i] == '(') {
            if ((int) st.size() % 2 == 0) res.push_back('1');
            else res.pb('0');
            st.push(res.back() - '0');
        } else {
            res.push_back((char) ('0' + st.top()));
            st.pop();
        }
    }
    cout << res << endl;

}

//#define _DEBUG

int main() {
#ifdef _DEBUG // place in cmake-build-debug folder
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int q = 1;
    //  cin >> q;
    for (int i = 1; i <= q; i++) {
        cout << "Case #" << i << ": ";
        solve();
    }
}


/*input
10
((()())())
*/
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	ios_base::sync_with_stdio(false);
	int n, k = 0;
	string s;
	cin >> n >> s;
	for (int i = 0; i < s.size(); i++)
	{
		if (s[i] == '(')
		{
			k = 1 - k;
		}
		cout << k;
		if (s[i] == ')')
		{
			k = 1 - k;
		}
	}
}


/*input
10
((()())())
*/
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
set<int>x[202020];
int K[202020];
int ans[202020];
string s;
void solve(int l, int rr, int c)
{
	if (l >= rr)
		return;
	if (s[l] != '(')
		return;
	int r = *x[K[l] - 1].upper_bound(l);
	ans[l] = ans[r] = c;
	solve(l + 1, r - 1, 1 - c);
	solve(r + 1, rr, c);
}
int main()
{
	ios_base::sync_with_stdio(false);
	int n;
	cin >> n;
	int k = 0;
	cin >> s;
	for (int i = 0; i < s.size(); i++)
	{
		if (s[i] == '(')
			k++;
		else
			k--;
		x[k].insert(i);
		K[i] = k;
	}
	solve(0, s.size() - 1, 0);
	for (int i = 0; i < s.size(); i++)
		cout << ans[i];
}


#import<iostream>
int k;char c;main(){std::cin>>k;k=0;while(std::cin>>c){k^=c=='(';std::cout<<k;k^=c==')';}}


/*input
10
((()())())
*/
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
deque<int>x[202020];
int K[202020];
int ans[202020];
string s;
void solve(int l, int rr, int c)
{
	if (l >= rr)
		return;
	if (s[l] != '(')
		return;
	int r = x[K[l] - 1][0];
	x[K[l] - 1].pop_front();
	ans[l] = ans[r] = c;
	solve(l + 1, r - 1, 1 - c);
	solve(r + 1, rr, c);
}
int main()
{
	ios_base::sync_with_stdio(false);
	int n;
	cin >> n;
	int k = 0;
	cin >> s;
	for (int i = 0; i < s.size(); i++)
	{
		if (s[i] == '(')
			k++;
		else
		{
			k--;
			x[k].push_back(i);
		}
		K[i] = k;
	}
	solve(0, s.size() - 1, 0);
	for (int i = 0; i < s.size(); i++)
		cout << ans[i];
}


/*input
10
((()())())
*/
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
list<int>x[202020];
int K[202020];
int ans[202020];
string s;
void solve(int l, int rr, int c)
{
	if (l >= rr)
		return;
	if (s[l] != '(')
		return;
	int r = x[K[l] - 1].front();
	x[K[l] - 1].pop_front();
	ans[l] = ans[r] = c;
	solve(l + 1, r - 1, 1 - c);
	solve(r + 1, rr, c);
}
int main()
{
	ios_base::sync_with_stdio(false);
	int n;
	cin >> n;
	int k = 0;
	cin >> s;
	for (int i = 0; i < s.size(); i++)
	{
		if (s[i] == '(')
			k++;
		else
		{
			k--;
			x[k].push_back(i);
		}
		K[i] = k;
	}
	solve(0, s.size() - 1, 0);
	for (int i = 0; i < s.size(); i++)
		cout << ans[i];
}


#import<iostream>
int k;char c;main(){std::cin>>k;k=0;while(std::cin>>c)k^=41-c,std::cout<<k,k^=c-40;}


/*input
10
((()())())
*/
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	ios_base::sync_with_stdio(false);
	int n, k = 0;
	string s;
	cin >> n >> s;
	for (char c : s)
	{
		if (c == '(')
		{
			k = 1 - k;
		}
		cout << k;
		if (c == ')')
		{
			k = 1 - k;
		}
	}
}


/*input
10
((()())())
*/
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
deque<int>x[202020];
int K[202020];
int ans[202020];
string s;
void solve(int l, int rr, int c)
{
	if (l >= rr)
		return;
	if (s[l] != '(')
		return;
	x[K[l] - 1].pop_front();
	int r = x[K[l] - 1][0];
	ans[l] = ans[r] = c;
	solve(l + 1, r - 1, 1 - c);
	solve(r + 1, rr, c);
}
int main()
{
	ios_base::sync_with_stdio(false);
	int n;
	cin >> n;
	int k = 0;
	cin >> s;
	for (int i = 0; i < s.size(); i++)
	{
		if (s[i] == '(')
			k++;
		else
			k--;
		x[k].push_back(i);
		K[i] = k;
	}
	solve(0, s.size() - 1, 0);
	for (int i = 0; i < s.size(); i++)
		cout << ans[i];
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <iomanip>
using namespace std;
#define all(x) x.begin(), x.end()
typedef vector <int> vi;
typedef pair<int,int> ii;
typedef long long ll;
typedef long double ld;
const int mod = 1e9 + 7;
const ll inf = 3e18 + 5;
int add(int a, int b) { return (a += b) < mod ? a : a - mod; }
int mul(int a, int b) { return 1LL * a * b % mod; }

int res[200500];

int main(){
	ios_base::sync_with_stdio(false); cin.tie(0);
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif

	int n;
	cin >> n;
	string s;
	cin >> s;
	int o = 0, mx = 0;
	for(int i = 0; i < n; i++){
		if(s[i] == '(')
			o++;
		else
			o = 0;
		mx = max(mx, o);
	}
	int ub = mx / 2;
	int r = 0, b = 0;
	for(int i = 0; i < n; i++){
		if(s[i] == '('){
			if(r + 1 <= ub){
				res[i] = 0;
				r++;
			}
			else{
				res[i] = 1;
				b++;
			}
		}
		else{
			if(r > b){
				res[i] = 0;
				r--;
			}
			else{
				res[i] = 1;
				b--;
			}
		}
	}
	for(int i = 0; i < n; i++)
		cout << res[i];
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <iomanip>
using namespace std;
#define all(x) x.begin(), x.end()
typedef vector <int> vi;
typedef pair<int,int> ii;
typedef long long ll;
typedef long double ld;
const int mod = 1e9 + 7;
const ll inf = 3e18 + 5;
int add(int a, int b) { return (a += b) < mod ? a : a - mod; }
int mul(int a, int b) { return 1LL * a * b % mod; }

int res[200500];

int main(){
	ios_base::sync_with_stdio(false); cin.tie(0);
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif

	int n;
	cin >> n;
	string s;
	cin >> s;
	int o = 0, mx = 0;
	for(int i = 0; i < n; i++){
		if(s[i] == '(')
			o++;
		else
			o = 0;
		mx = max(mx, o);
	}
	int ub = mx / 2;
	if(mx % 2 == 1)
		ub++;
	int r = 0, b = 0;
	for(int i = 0; i < n; i++){
		if(s[i] == '('){
			if(r + 1 <= ub){
				res[i] = 0;
				r++;
			}
			else{
				res[i] = 1;
				b++;
			}
		}
		else{
			if(r >= b){
				res[i] = 0;
				r--;
			}
			else{
				res[i] = 1;
				b--;
			}
		}
	}
	for(int i = 0; i < n; i++)
		cout << res[i];
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <iomanip>
using namespace std;
#define all(x) x.begin(), x.end()
typedef vector <int> vi;
typedef pair<int,int> ii;
typedef long long ll;
typedef long double ld;
const int mod = 1e9 + 7;
const ll inf = 3e18 + 5;
int add(int a, int b) { return (a += b) < mod ? a : a - mod; }
int mul(int a, int b) { return 1LL * a * b % mod; }

int res[200500];

int main(){
	ios_base::sync_with_stdio(false); cin.tie(0);
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif

	int n;
	cin >> n;
	string s;
	cin >> s;
	int o = 0, mx = 0;
	for(int i = 0; i < n; i++){
		if(s[i] == '(')
			o++;
		else
			o--;
		mx = max(mx, o);
	}
	int ub = mx / 2;
	if(mx % 2 == 1)
		ub++;
	int r = 0, b = 0;
	for(int i = 0; i < n; i++){
		if(s[i] == '('){
			if(r + 1 <= ub){
				res[i] = 0;
				r++;
			}
			else{
				res[i] = 1;
				b++;
			}
		}
		else{
			if(r >= b){
				res[i] = 0;
				r--;
			}
			else{
				res[i] = 1;
				b--;
			}
		}
	}
	for(int i = 0; i < n; i++)
		cout << res[i];
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <iomanip>
using namespace std;
#define all(x) x.begin(), x.end()
typedef vector <int> vi;
typedef pair<int,int> ii;
typedef long long ll;
typedef long double ld;
const int mod = 1e9 + 7;
const ll inf = 3e18 + 5;
int add(int a, int b) { return (a += b) < mod ? a : a - mod; }
int mul(int a, int b) { return 1LL * a * b % mod; }

int res[200500];

int main(){
	ios_base::sync_with_stdio(false); cin.tie(0);
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif

	int n;
	cin >> n;
	string s;
	cin >> s;
	int o = 0, mx = 0;
	for(int i = 0; i < n; i++){
		if(s[i] == '(')
			o++;
		else
			o = 0;
		mx = max(mx, o);
	}
	int ub = mx / 2;
	if(mx % 2 == 1)
		ub++;
	int r = 0, b = 0;
	for(int i = 0; i < n; i++){
		if(s[i] == '('){
			if(r + 1 < ub){
				res[i] = 0;
				r++;
			}
			else{
				res[i] = 1;
				b++;
			}
		}
		else{
			if(r > b){
				res[i] = 0;
				r--;
			}
			else{
				res[i] = 1;
				b--;
			}
		}
	}
	for(int i = 0; i < n; i++)
		cout << res[i];
}


#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <iomanip>
using namespace std;
#define all(x) x.begin(), x.end()
typedef vector <int> vi;
typedef pair<int,int> ii;
typedef long long ll;
typedef long double ld;
const int mod = 1e9 + 7;
const ll inf = 3e18 + 5;
int add(int a, int b) { return (a += b) < mod ? a : a - mod; }
int mul(int a, int b) { return 1LL * a * b % mod; }

int res[200500];

int main(){
	ios_base::sync_with_stdio(false); cin.tie(0);
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif

	int n;
	cin >> n;
	string s;
	cin >> s;
	int o = 0, mx = 0;
	for(int i = 0; i < n; i++){
		if(s[i] == '(')
			o++;
		else
			o = 0;
		mx = max(mx, o);
	}
	int ub = mx / 2;
	if(mx % 2 == 1)
		ub++;
	int r = 0, b = 0;
	for(int i = 0; i < n; i++){
		if(s[i] == '('){
			if(r + 1 <= ub){
				res[i] = 0;
				r++;
			}
			else{
				res[i] = 1;
				b++;
			}
		}
		else{
			if(r > b){
				res[i] = 0;
				r--;
			}
			else{
				res[i] = 1;
				b--;
			}
		}
	}
	for(int i = 0; i < n; i++)
		cout << res[i];
}


#include <bits/stdc++.h>
using namespace std;
char s[200005];
stack<int>st1, st2;
int ans[200005];
int main()
{
	int n;
	scanf("%d", &n);
	scanf("%s", s);
	int len = strlen(s);
	for (int i = 0; i < len; i++)
	{
		if (s[i] == '(')
		{
			if (st1.size() > st2.size())
				st2.push(i);
			else
				st1.push(i);
		}
		else
		{
			if (st1.size() > st2.size())
			{
				ans[st1.top()] = 0;
				st1.pop();
				ans[i] = 0;
			}
			else
			{
				ans[st2.top()] = 1;
				st2.pop();
				ans[i] = 1;
			}
		}
	}
	for (int i = 0; i < n; i++)
		printf("%d", ans[i]);
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;
int ans[200005];
char s[200005];
int main()
{
	int n;
	scanf("%d", &n);
	scanf("%s", s);
	int f = 0, cnt = 0, nex;
	for (int i = 0; i < n; i++)
	{
		if (f == 0 && s[i] == '(')
			f = 1, ans[i] = 1, cnt++, nex = i;
		else if (f == 1 && s[i] == ')')
			f = 0, ans[i] = 1, cnt++, nex = i;
	}
	if (cnt & 1)
		ans[nex] = 0;
	for (int i = 0; i < n; i++)
		printf("%d", ans[i]);
}


#include <bits/stdc++.h>
#define ll long long
using namespace std;
int ans[200005];
char s[200005];
int main()
{
	int n;
	scanf("%d", &n);
	scanf("%s", s);
	stack<char>st1, st2;
	for (int i = 0; i < n; i++)
	{
		if (s[i] == '(')
		{
			if (st1.size() > st2.size())
			{
				st2.push(i);
				ans[i] = 1;
			}
			else
			{
				st1.push(i);
				ans[i] = 0;
			}
		}
		else
		{
			if (st1.size() > st2.size())
			{
				st1.pop();
				ans[i] = 0;
			}
			else
			{
				st2.pop();
				ans[i] = 1;
			}
		}
	}
	for (int i = 0; i < n; i++)
		printf("%d", ans[i]);
}


#include <bits/stdc++.h>
using namespace std;
char s[200005];
stack<int>st1, st2;
int ans[200005];
int main()
{
	int n, res = 1;
	scanf("%d", &n);
	scanf("%s", s);
	int len = strlen(s);
	for (int i = 0; i < len; i++)
	{
		if (s[i] == '(')
		{
			if (st1.size() > st2.size())
				st2.push(i);
			else
				st1.push(i);
		}
		else
		{
			if (st1.size() > st2.size())
			{
				ans[st1.top()] = 0;
				st1.pop();
				ans[i] = 0;
			}
			else
			{
				ans[st2.top()] = 1;
				st2.pop();
				ans[i] = 1;
			}
		}
	}
	printf("%d\n", res);
	for (int i = 0; i < n; i++)
		printf("%d", ans[i]);
}


#include <bits/stdc++.h>
#define ull unsigned long long int
#define ll long long
#define int long long
#define ld long double
#define endl '\n'
int mod= 1e9+7;
#define F first
#define S second
//#define x first
//#define y second
#define pb push_back
#define mp make_pair
#define trace(x) cerr << #x << " is " << x << endl;
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<"\n";
#define all(x) x.begin(),x.end()
#define reset(x,val) memset(x,val,sizeof(x))
#define flush fflush(stdout)
#define sz(a) a.size()
#define pii pair<int,int>
void fail(){std::cout<<"-1\n";exit(0);}
using namespace std;

int32_t main() {
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    int n;
    cin>>n;
    string s;
    cin>>s;
    stack<pair<char,int> >st;
    for(int i=0;i<n-1;i++)
    {
     if(s[i]=='(' && s[i+1]==')')
     {
      s[i]='1';
      s[i+1]='1';
     }
    }
    for(int i=0;i<n;i++)
    {
     if(s[i]!='1')s[i]='0';
     cout<<s[i];
    }
    cout<<endl;
    return 0;
}


#include <bits/stdc++.h>
#define ull unsigned long long int
#define ll long long
#define int long long
#define ld long double
#define endl '\n'
int mod= 1e9+7;
#define F first
#define S second
//#define x first
//#define y second
#define pb push_back
#define mp make_pair
#define trace(x) cerr << #x << " is " << x << endl;
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<"\n";
#define all(x) x.begin(),x.end()
#define reset(x,val) memset(x,val,sizeof(x))
#define flush fflush(stdout)
#define sz(a) a.size()
#define pii pair<int,int>
void fail(){std::cout<<"-1\n";exit(0);}
using namespace std;

int32_t main() {
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    int n;
    cin>>n;
    string s;
    cin>>s;
    stack<pair<char,int> >st;
    int x=0;
    for(int i=0;i<n;i++)
    {
     if(st.empty())st.push({s[i],i});
     else
     {
      if(s[i]=='(')
      {
       st.push({s[i],i});
      }
      else
      {
       auto t=st.top();
       st.pop();
       s[t.S]=(x+'0');
       s[i]=(x+'0');
       x^=1;
      }
     }
    }
    for(int i=0;i<n;i++)cout<<s[i];cout<<endl;
    return 0;
}


#include <bits/stdc++.h>
#define ull unsigned long long int
#define ll long long
#define int long long
#define ld long double
#define endl '\n'
const int mod= 1e9+7;
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define trace(x) cerr << #x << " is " << x << endl;
#define all(x) x.begin(),x.end()
#define reset(x,val) memset(x,val,sizeof(x))
#define flush fflush(stdout)
#define sz(a) a.size()
#define pii pair<int,int>
using namespace std;

int32_t main()
{
  ios_base::sync_with_stdio(false);cin.tie(NULL);
  int n;
  string s;
  cin>>n>>s;
  int lvl=0;
  for(int i=0;i<n;i++)
  {
      if(s[i]=='(')
      {
          lvl++;
          cout<<(lvl&1);
      }
      else
      {
          lvl--;
          cout<<1-(lvl&1);
      }
  }
  return 0;
}


#include <bits/stdc++.h>
#define ull unsigned long long int
#define ll long long
#define int long long
#define ld long double
#define endl '\n'
int mod= 1e9+7;
#define F first
#define S second
//#define x first
//#define y second
#define pb push_back
#define mp make_pair
#define trace(x) cerr << #x << " is " << x << endl;
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<"\n";
#define all(x) x.begin(),x.end()
#define reset(x,val) memset(x,val,sizeof(x))
#define flush fflush(stdout)
#define sz(a) a.size()
#define pii pair<int,int>
void fail(){std::cout<<"-1\n";exit(0);}
using namespace std;

int32_t main() {
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    int n;
    cin>>n;
    string s;
    cin>>s;
    string s2=s;
    stack<pair<char,int> >st;
    int x=0;
    for(int i=0;i<n-1;i++)
    {
     if(s[i]=='(' && s[i+1]==')')
     {
      s[i]='1';
      s[i+1]='1';
     }
    }

    for(int i=0;i<s.size();i++)
    {
     if(s[i]=='1')continue;
     if(st.empty())st.push({s[i],i});
     else
     {
      if(s[i]=='(')
      {
       st.push({s[i],i});
      }
      else
      {
       auto t=st.top();
       st.pop();
       s[t.S]=(x+'0');
       s[i]=(x+'0');
       x^=1;
      }
     }
    }
    for(int i=0;i<n;i++)cout<<s[i];cout<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;cin>>n;
    string s;cin>>s;
    string t="";
    for(int i=0;i<n;i++)
        t+='0';
    int x=0;
    while(x<n)
    {
        int y=x;
        int count=1;
        int max1=1;
        for(y++;y<n;y++)
        {
            if(s[y]=='(')
                count++;
            else
                count--;
            max1=max(max1,count);
            if(count==0)
                break;
        }
        int x1=x,y1=y;
        max1/=2;
        while(max1>0)
        {
            while(s[x1]!='(')
                x1++;
            t[x1]='1';
            x1++;
            while(s[y1]!=')')
                y1--;
            t[y1]='1';
            y1--;
            max1--;
        }
        x=y+1;
    }
    cout<<t<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;cin>>n;
    string s;cin>>s;
    string t="";
    for(int i=0;i<n;i++)
        t+='0';
    int x=0;
    vector<int> count(n,0);
    while(x<n)
    {
        int y=x;
        int max1=1;
        count[x]=1;
        for(y++;y<n;y++)
        {
            if(s[y]=='(')
                count[y]=count[y-1]+1;
            else
                count[y]=count[y-1]-1;
            if(max1<count[y])
            {
            	max1=count[y];
			}
            if(count[y]==0)
                break;
        }
        int x1=x;
        int x2=x-1;
        for(;x1<=y;x1++)
        {
            if(count[x1]==max1)
            {
                int c=0;
                for(int i=x1;i>=x2;i--)
                    if(s[i]=='(')
                    {
                        c++;
                        t[i]='1';
                        if(c==max1/2)
                            break;
                    }
                for(x1++;x1<=y;x1++)
                    if(s[x1]==')')
                    {
                        c--;
                        t[x1]='1';
                        if(c==0)
                            break;
                    }
                x2=x1;
            }
        }
        x=y+1;
    }
    cout<<t<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;cin>>n;
    string s;cin>>s;
    string t="";
    for(int i=0;i<n;i++)
        t+='0';
    int x=0;
    vector<int> count(n,0);
    while(x<n)
    {
        int y=x;
        int max1=1;
        count[x]=1;
        for(y++;y<n;y++)
        {
            if(s[y]=='(')
                count[y]=count[y-1]+1;
            else
                count[y]=count[y-1]-1;
            if(max1<count[y])
            {
            	max1=count[y];
			}
            if(count[y]==0)
                break;
        }
        int x1=x;
        int x2=x-1;
        for(;x1<=y;x1++)
        {
            if(count[x1]>max1/2 && count[x1]>count[x1+1])
            {
                int c=0;
                for(int i=x1;i>=x2;i--)
                    if(s[i]=='(')
                    {
                        c++;
                        t[i]='1';
                        if(c==max1/2)
                            break;
                    }
                for(x1++;x1<=y;x1++)
                    if(s[x1]==')')
                    {
                        c--;
                        t[x1]='1';
                        if(c==0)
                            break;
                    }
                x2=x1;
            }
        }
        x=y+1;
    }
    cout<<t<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;cin>>n;
    string s;cin>>s;
    string t="";
    for(int i=0;i<n;i++)
        t+='0';
    int x=0;
    while(x<n)
    {
        int y=x;
        int count=1;
        int max1=1;
        int x1=0;
        for(y++;y<n;y++)
        {
            if(s[y]=='(')
                count++;
            else
                count--;
            if(max1<count)
            {
            	max1=count;
            	x1=y;
			}
            if(count==0)
                break;
        }
        max1=(max1-1)/2+1;
        int max2=max1;
        for(int i=x1;i>=x && max1>0;i--)
        	if(s[i]=='(')
        	{
        		t[i]='1';
        		max1--;
			}
		for(int i=x1;i<=y && max2>0;i++)
			if(s[i]==')')
			{
				t[i]='1';
				max2--;
			}
        x=y+1;
    }
    cout<<t<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;cin>>n;
    string s;cin>>s;
    string t="";
    for(int i=0;i<n;i++)
        t+='0';
    int x=0;
    while(x<n)
    {
        int y=x;
        int count=1;
        int max1=1;
        for(y++;y<n;y++)
        {
            if(s[y]=='(')
                count++;
            else
                count--;
            if(max1<count)
            {
            	max1=count;
			}
            if(count==0)
                break;
        }
        max1=(max1-1)/2+1;
        int max2=max1;
        int  x1=x;
        for(;x1<=y && max1>0;x1++)
        {
            if(s[x1]=='(')
            {
                t[x1]='1';
                max1--;
            }
        }
        for(;x1<=y && max2>0;x1++)
        {
            if(s[x1]==')')
            {
                t[x1]='1';
                max2--;
            }
        }
        x=y+1;
    }
    cout<<t<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long int LL;
typedef unsigned long long uLL;
typedef pair< int,int > ii;
typedef pair< int,ii > iii;
const int inf = 1e9;
const LL INF = 1e18;
const int N = 100005;
const int MOD = 1e9+7;
const double EPS = 1e-6;
const double PI = acos(-1.0);

int n;
int ara[ 5*N ];
bool carry[ 5*N ] , hide[ 5*N ];

int can( int id , int val ) {
    int lo = id+1 , hi = n , ret = -inf;
    while( lo <= hi ) {
        int mid = (lo+hi)/2;
        if( ara[mid] >= (2*val) && !carry[mid] ) {
            ret = mid;
            hi = mid-1;
        }
        else lo = mid+1;
    }
    if( ret == -inf ) return ret;
    if( carry[ret] ) ret = can( id+1 , val );
    return ret;
}
int main( int argc, char const *argv[] ) {
    scanf("%d",&n);
    for( int i = 1; i <= n; i++ ) {
        scanf("%d",&ara[i]);
    }
    sort( ara+1 , ara+n+1 );
    for( int i = 1; i <= n; i++ ) {
        int idx = can( i , ara[i] );
        if( idx != -inf ) hide[i] = true , carry[idx] = true;
    }
    int cnt = 0;
    for( int i = 1; i <= n; i++ ) {
        if( !hide[i] ) cnt++;
    }
    printf("%d\n",cnt);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long int LL;
typedef unsigned long long uLL;
typedef pair< int,int > ii;
typedef pair< int,ii > iii;
const int inf = 1e9;
const LL INF = 1e18;
const int N = 100005;
const int MOD = 1e9+7;
const double EPS = 1e-6;
const double PI = acos(-1.0);

int n;
int ara[ 5*N ];

bool carry[ 5*N ] , hide[ 5*N ];

int can( int id , int val ) {
    int lo = id+1 , hi = n , ret = -inf;
    while( lo <= hi ) {
        int mid = (lo+hi)/2;
        if( ara[mid] >= (2*val) && !carry[mid] ) {
            ret = mid;
            hi = mid-1;
        }
        else lo = mid+1;
    }
    return ret;
}
int main( int argc, char const *argv[] ) {
    scanf("%d",&n);
    for( int i = 1; i <= n; i++ ) {
        scanf("%d",&ara[i]);
    }
    sort( ara+1 , ara+n+1 );
    for( int i = 1; i <= n; i++ ) {
        int idx = can( i , ara[i] );
        if( idx != -inf ) hide[i] = true , carry[idx] = true;
    }
    int ans = n/2;
    for( int i = 1; i <= n/2; i++ ) {
        if( !hide[i] ) ans++;
    }
    printf("%d\n",ans);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long int LL;
typedef unsigned long long uLL;
typedef pair< int,int > ii;
typedef pair< int,ii > iii;
const int inf = 1e9;
const LL INF = 1e18;
const int N = 100005;
const int MOD = 1e9+7;
const double EPS = 1e-6;
const double PI = acos(-1.0);

int n;
int ara[ 5*N ];
bool carry[ 5*N ] , hide[ 5*N ];

int can( int id , int val ) {
    int lo = id+1 , hi = n , ret = -inf;
    while( lo <= hi ) {
        int mid = (lo+hi)/2;
        if( ara[mid] >= (2*val) ) {
            if( !carry[mid] ) ret = mid;
            hi = mid-1;
        }
        else lo = mid+1;
    }
    return ret;
}
int main( int argc, char const *argv[] ) {
    scanf("%d",&n);
    for( int i = 1; i <= n; i++ ) {
        scanf("%d",&ara[i]);
    }
    sort( ara+1 , ara+n+1 );
    for( int i = 1; i <= n; i++ ) {
        int idx = can( i , ara[i] );
        if( idx != -inf ) hide[i] = true , carry[idx] = true;
    }
    int cnt = 0;
    for( int i = 1; i <= n; i++ ) {
        if( !hide[i] ) cnt++;
    }
    printf("%d\n",cnt);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long int LL;
typedef unsigned long long uLL;
typedef pair< int,int > ii;
typedef pair< int,ii > iii;
const int inf = 1e9;
const LL INF = 1e18;
const int N = 100005;
const int MOD = 1e9+7;
const double EPS = 1e-6;
const double PI = acos(-1.0);

int n;
int ara[ 5*N ];
bool carry[ 5*N ] , hide[ 5*N ];

int can( int id , int val ) {
    int lo = id+1 , hi = n , ret = -inf;
    while( lo <= hi ) {
        int mid = (lo+hi)/2;
        if( ara[mid] >= (2*val) ) {
            ret = mid;
            hi = mid-1;
        }
        else lo = mid+1;
    }
    return ret;
}
int main( int argc, char const *argv[] ) {
    scanf("%d",&n);
    for( int i = 1; i <= n; i++ ) {
        scanf("%d",&ara[i]);
    }
    sort( ara+1 , ara+n+1 );
    for( int i = 1; i <= n; i++ ) {
        int idx = can( i , ara[i] );
        if( idx != -inf ) {
            for( int j = i+1; j <= idx; j++ ) {
                if( !carry[j] && ara[j] >= 2*ara[i] ) {
                    carry[j] = true;
                    hide[i] = true;
                    break;
                }
            }
        }
    }
    int cnt = 0;
    for( int i = 1; i <= n; i++ ) {
        if( !hide[i] ) cnt++;
    }
    printf("%d\n",cnt);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

typedef long long int LL;
typedef unsigned long long uLL;
typedef pair< int,int > ii;
typedef pair< int,ii > iii;
const int inf = 1e9;
const LL INF = 1e18;
const int N = 100005;
const int MOD = 1e9+7;
const double EPS = 1e-6;
const double PI = acos(-1.0);

int n;
int ara[ 5*N ];
bool carry[ 5*N ] , hide[ 5*N ];

int can( int id , int val ) {
    int lo = id+1 , hi = n , ret = -inf;
    while( lo <= hi ) {
        int mid = (lo+hi)/2;
        if( ara[mid] >= (2*val) ) {
            ret = mid;
            hi = mid-1;
        }
        else lo = mid+1;
    }
    return ret;
}
int main( int argc, char const *argv[] ) {
    scanf("%d",&n);
    for( int i = 1; i <= n; i++ ) {
        scanf("%d",&ara[i]);
    }
    sort( ara+1 , ara+n+1 );
    for( int i = 1; i <= n; i++ ) {
        int idx = can( i , ara[i] );
        if( idx != -inf ) hide[i] = true , carry[idx] = true;
    }
    int cnt = 0;
    for( int i = 1; i <= n; i++ ) {
        if( !hide[i] ) cnt++;
    }
    printf("%d\n",cnt);
    return 0;
}