#include<stdio.h>
#include<iostream>
using namespace std;
int main(void)
{
	int n;
	while(cin>>n)
	{
		if(n<5)
		{
			if(n==3)
				printf("7\n");
			if(n==4)
				printf("11\n");
			if(n==2)
				printf("1\n");
		}
		else
		{
			int x=n%2;
			int y=n/2;
			if(x==1)
			{
					for(int i=0;i<y-1;i++)
					{
						printf("1");
					}
					printf("7\n");
					//cout<<"7";
					//cout<<endl;

			}
			else
			{
				for(int i=0;i<y;i++)
				{
					//cout<<"1";
					printf("1\n");
				}
			}
		}

	}

}


#include<stdio.h>
#include<iostream>
using namespace std;
int main(void)
{
	int n;
	while(cin>>n)
	{
		if(n<5)
		{
			if(n==3)
				printf("7\n");
			if(n==4)
				printf("11\n");
			if(n==2)
				printf("1\n");
		}
		else
		{
			int x=n%2;
			int y=n/2;
			if(x==1)
			{
				    printf("7");
					for(int i=0;i<y-1;i++)
					{
						printf("1");
					}
					printf("\n");

					//cout<<"7";
					//cout<<endl;

			}
			else
			{
				for(int i=0;i<y;i++)
				{
					printf("1\n");
				}
			}
		}

	}

}


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

int main()
{
    int n;
    while(cin>>n)
    {
        int res=9*(n/7);
        int extra=n%7;
        if(extra>=6)res+=9;
        else if(extra>=3)res+=7;
        else if(extra>=2)res+=1;
        cout<<res<<endl;
    }
}


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

int main()
{

    long long int n;
    while(cin>>n)
    {
        string res="";
        int ones=n/2;
        int extra=n%2;
        if(extra==1 && n>2)res+='7';
        for(int i=0;i<ones-extra;i++)
        res+='1';
        cout<<res<<endl;
    }
}


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

int pow(int base,int p)
{
    int res=1;
    for(int i=0;i<p;i++)
    {
        res*=base;
    }
    return res;
}
int main()
{

    int n;
    while(cin>>n)
    {
        int res=pow(10,n/6)-1;
        int extra=n%6;
        if(extra>=3)res+=7;
        else if(extra>=2)res+=1;
        cout<<res<<endl;
    }
}


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

int main()
{
    int n;
    while(cin>>n)
    {
        int res=9*(n/6);
        int extra=n%6;
        if(extra>=6)res+=9;
        else if(extra>=3)res+=7;
        else if(extra>=2)res+=1;
        cout<<res<<endl;
    }
}


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

int main()
{

    long long int n;
    while(cin>>n)
    {
        string res="";
        int nines=n/6;
        int extra=n%6;
        for(int i=0;i<nines;i++)
        res+='9';
        if(extra>=3)res+='7';
        else if(extra>=2)res+='2';
        cout<<res<<endl;
    }
}


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

int main()
{

    long long int n;
    while(cin>>n)
    {
        string res="";
        int ones=n/2;
        int extra=n%2;
        for(int i=0;i<ones-extra;i++)
        res+='1';
        if(extra==1)res+='7';
        cout<<res<<endl;
    }
}


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

int main()
{

    long long int n;
    while(cin>>n)
    {
        string res="";
        int nines=n/6;
        int extra=n%6;
        for(int i=0;i<nines;i++)
        res+='9';
        if(extra>=3)res+='7';
        else if(extra>=2)res+='1';
        cout<<res<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
#define rd freopen("in.txt", "r", stdin)
#define wr freopen("out.txt", "w", stdout)
#define ios ios_base::sync_with_stdio(false);cin.tie(NULL)
#define FOR(n) for(int i=0;i<n;i++)
#define FORIT(it, x) for(__typeof__((x).begin()) it=(x).begin();it!=(x).end();it++)
#define MOD 1000000007LL
#define vsort(v) sort(v.begin(),v.end())
#define dbg(args...) {cout<<"-->";debugger::call(#args,args);cout<<"\n";}
struct debugger {
    static void call(const char* it) {}
    template<typename T, typename ... aT>
    static void call(const char* it, T a, aT... rest) {
        string b;
        for(; *it&&*it!=','; ++it) if(*it!=' ')b+=*it;
        cout << ' ' << b << '=' << a;
        call(++it, rest...);
    }
};
template <class T> inline T bigmod(T p,T e,T M) {
    long long ret = 1;
    for(; e > 0; e >>= 1) {
        if(e & 1) ret = (ret * p) % M;
        p = (p * p) % M;
    }
    return (T)ret;
}
template <class T> inline T gcd(T a,T b) {
    if(b==0)return a;
    return gcd(b,a%b);
}
template <class T> inline T modinverse(T a,T M) {
    return bigmod(a,M-2,M);
}
template <class T> inline string toString(const T &t) {
    stringstream ss;
    ss << t;
    return ss.str();
}
typedef long long ll;
typedef unsigned long long ull;
const double PI=acos(-1.0);
const double EPS=1e-9;
int dx[4]= {0,1,0,-1};
int dy[4]= {1,0,-1,0};

int main() {
    ios;
    int n;
    cin >> n;
    if(n%2==0) {
        int c=0;
        for(int i=n; i>0; i-=2) {
            c++;
        }
        if(c>10) cout << 2147483647;
        else {
            for(int i=n; i>0; i-=2) {
                cout << 1;
            }
        }
    } else {
        if(n==3) {
            cout << 7;
        } else {
            int c=1;
            for(int i=n; i>3; i-=2) {
                c++;
            }
            if(c>10) cout << 2147483647;
            else {
                for(int i=n; i>3; i-=2) {
                    cout << 1;
                }
                cout << 7;
            }
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define rd freopen("in.txt", "r", stdin)
#define wr freopen("out.txt", "w", stdout)
#define ios ios_base::sync_with_stdio(false);cin.tie(NULL)
#define FOR(n) for(int i=0;i<n;i++)
#define FORIT(it, x) for(__typeof__((x).begin()) it=(x).begin();it!=(x).end();it++)
#define MOD 1000000007LL
#define vsort(v) sort(v.begin(),v.end())
#define dbg(args...) {cout<<"-->";debugger::call(#args,args);cout<<"\n";}
struct debugger {
    static void call(const char* it) {}
    template<typename T, typename ... aT>
    static void call(const char* it, T a, aT... rest) {
        string b;
        for(; *it&&*it!=','; ++it) if(*it!=' ')b+=*it;
        cout << ' ' << b << '=' << a;
        call(++it, rest...);
    }
};
template <class T> inline T bigmod(T p,T e,T M) {
    long long ret = 1;
    for(; e > 0; e >>= 1) {
        if(e & 1) ret = (ret * p) % M;
        p = (p * p) % M;
    }
    return (T)ret;
}
template <class T> inline T gcd(T a,T b) {
    if(b==0)return a;
    return gcd(b,a%b);
}
template <class T> inline T modinverse(T a,T M) {
    return bigmod(a,M-2,M);
}
template <class T> inline string toString(const T &t) {
    stringstream ss;
    ss << t;
    return ss.str();
}
typedef long long ll;
typedef unsigned long long ull;
const double PI=acos(-1.0);
const double EPS=1e-9;
int dx[4]= {0,1,0,-1};
int dy[4]= {1,0,-1,0};

int main() {
    ios;
    int n;
    cin >> n;
    if(n%2==0) {
        for(int i=n; i>0; i-=2) {
            cout << 1;
        }
    } else {
        if(n==3) {
            cout << 7;
        } else {
            cout << 7;
            for(int i=n; i>3; i-=2) {
                cout << 1;
            }
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define rd freopen("in.txt", "r", stdin)
#define wr freopen("out.txt", "w", stdout)
#define ios ios_base::sync_with_stdio(false);cin.tie(NULL)
#define FOR(n) for(int i=0;i<n;i++)
#define FORIT(it, x) for(__typeof__((x).begin()) it=(x).begin();it!=(x).end();it++)
#define MOD 1000000007LL
#define vsort(v) sort(v.begin(),v.end())
#define dbg(args...) {cout<<"-->";debugger::call(#args,args);cout<<"\n";}
struct debugger {
    static void call(const char* it) {}
    template<typename T, typename ... aT>
    static void call(const char* it, T a, aT... rest) {
        string b;
        for(; *it&&*it!=','; ++it) if(*it!=' ')b+=*it;
        cout << ' ' << b << '=' << a;
        call(++it, rest...);
    }
};
template <class T> inline T bigmod(T p,T e,T M) {
    long long ret = 1;
    for(; e > 0; e >>= 1) {
        if(e & 1) ret = (ret * p) % M;
        p = (p * p) % M;
    }
    return (T)ret;
}
template <class T> inline T gcd(T a,T b) {
    if(b==0)return a;
    return gcd(b,a%b);
}
template <class T> inline T modinverse(T a,T M) {
    return bigmod(a,M-2,M);
}
template <class T> inline string toString(const T &t) {
    stringstream ss;
    ss << t;
    return ss.str();
}
typedef long long ll;
typedef unsigned long long ull;
const double PI=acos(-1.0);
const double EPS=1e-9;
int dx[4]= {0,1,0,-1};
int dy[4]= {1,0,-1,0};

int main() {
    rd;
    ios;
    int n;
    cin >> n;
    if(n%2==0) {
        int c=0;
        for(int i=n; i>0; i-=2) {
            c++;
        }
        if(c>10) cout << 2147483647;
        else {
            for(int i=n; i>0; i-=2) {
                cout << 1;
            }
        }
    } else {
        if(n==3) {
            cout << 7;
        } else {
            int c=1;
            for(int i=n; i>3; i-=2) {
                c++;
            }
            if(c>10) cout << 2147483647;
            else {
                for(int i=n; i>3; i-=2) {
                    cout << 1;
                }
                cout << 7;
            }
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main() {
    int n;
    cin >> n;
    if(n%2==0) {
        for(int i=n;i>0;i-=2) {
            cout << 1;
        }
    } else {
        if(n==3) {
            cout << 7;
        } else {
            for(int i=n;i>3;i-=2) {
                cout << 1;
            }
            cout << 7;
        }
    }
    return 0;
}


/***********Template Starts Here***********/
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <deque>
#include <functional>
#include <string>
#include <iostream>
#include <cctype>
#include <set>
#include <climits>
#include <iomanip>
#include <cassert>
//#include <unordered_map>

#define pb push_back
#define nl puts ("")
#define sp printf ( " " )
#define phl printf ( "hello\n" )
#define ff first
#define ss second
#define POPCOUNT __builtin_popcountll
#define RIGHTMOST __builtin_ctzll
#define LEFTMOST(x) (63-__builtin_clzll((x)))
#define MP make_pair
#define FOR(i,x,y) for(int i = (x) ; i <= (y) ; ++i)
#define ROF(i,x,y) for(int i = (y) ; i >= (x) ; --i)
#define CLR(x,y) memset(x,y,sizeof(x))
#define UNIQUE(V) (V).erase(unique((V).begin(),(V).end()),(V).end())
#define MIN(a,b) ((a)<(b)?(a):(b))
#define MAX(a,b) ((a)>(b)?(a):(b))
#define NUMDIGIT(x,y) (((int)(log10((x))/log10((y))))+1)
#define SQ(x) ((x)*(x))
#define ABS(x) ((x)<0?-(x):(x))
#define FABS(x) ((x)+eps<0?-(x):(x))
#define ALL(x) (x).begin(),(x).end()
#define LCM(x,y) (((x)/gcd((x),(y)))*(y))
#define SZ(x) ((int)(x).size())
#define NORM(x) if(x>=mod)x-=mod;

using namespace std;

typedef long long vlong;
typedef unsigned long long uvlong;
typedef pair < int, int > pii;
typedef pair < vlong, vlong > pll;
typedef vector<pii> vii;
typedef vector<int> vi;

const vlong inf = 2147383647;
const double pi = 2 * acos ( 0.0 );
const double eps = 1e-9;

#ifdef forthright48
     #include <ctime>
     clock_t tStart = clock();
     #define debug(args...) {dbg,args; cerr<<endl;}
     #define timeStamp printf("Execution Time: %.2fs\n", (double)(clock() - tStart)/CLOCKS_PER_SEC)
#else
    #define debug(args...)  // Just strip off all debug tokens
    #define timeStamp
#endif

struct debugger{
    template<typename T> debugger& operator , (const T& v){
        cerr<<v<<" ";
        return *this;
    }
}dbg;

//int knightDir[8][2] = { {-2,1},{-1,2},{1,2},{2,1},{2,-1},{-1,-2},{1,-2},{-2,-1} };
//int dir4[4][2] = {{-1,0},{0,1},{1,0},{0,-1}};

inline vlong gcd ( vlong a, vlong b ) {
    a = ABS ( a ); b = ABS ( b );
    while ( b ) { a = a % b; swap ( a, b ); } return a;
}

vlong ext_gcd ( vlong A, vlong B, vlong *X, vlong *Y ){
    vlong x2, y2, x1, y1, x, y, r2, r1, q, r;
    x2 = 1; y2 = 0;
    x1 = 0; y1 = 1;
    for (r2 = A, r1 = B; r1 != 0; r2 = r1, r1 = r, x2 = x1, y2 = y1, x1 = x, y1 = y ) {
        q = r2 / r1;
        r = r2 % r1;
        x = x2 - (q * x1);
        y = y2 - (q * y1);
    }
    *X = x2; *Y = y2;
    return r2;
}

inline vlong modInv ( vlong a, vlong m ) {
    vlong x, y;
    ext_gcd( a, m, &x, &y );
    if ( x < 0 ) x += m; //modInv is never negative
    return x;
}

inline vlong power ( vlong a, vlong p ) {
    vlong res = 1, x = a;
    while ( p ) {
        if ( p & 1 ) res = ( res * x );
        x = ( x * x ); p >>= 1;
    }
    return res;
}

inline vlong bigmod ( vlong a, vlong p, vlong m ) {
    vlong res = 1 % m, x = a % m;
    while ( p ) {
        if ( p & 1 ) res = ( res * x ) % m;
        x = ( x * x ) % m; p >>= 1;
    }
    return res;
}

/***********Template Ends Here***********/

/*********** Hasib Templates Starts Here**********/

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

#define loop(i, n) for(int i=0; i<(n); i++)
#define sf scanf
#define pf printf
#define fr first
#define sc second
#define ll long long
#define dd double
#define all(v) (v).begin(), (v).end()
#define PI acos(-1.0)
#define mem(ara, val) memset(ara, val, sizeof(ara))
#define paii pair<int, int>
#define pall pair<ll, ll>
#define read(nm) freopen(nm, "r", stdin)
#define write(nm) freopen(nm, "w", stdout)
#define vdump(x) cerr<<#x<<" = "<<x<<endl;
//#define dump(args...) cerr,args; cerr<<endl
#define dump(args...) cerr<<"("<<#args<<") = (* ",args,"*)\n";
#define pbp(a,b) pb(MP(a,b))

template<typename T>
ostream& operator<<(ostream& out, vector<T> v)
{
    out<<"[ ";

    loop(i, SZ(v))
    {
        if(i) out<<", ";
        out<<v[i];
    }

    out<<" ]";
    return out;
}

template<typename T1, typename T2>
ostream& operator<<(ostream &out, pair<T1, T2> p)
{
    out<<"( "<<p.fr<<", "<<p.sc<<")";
    return out;
}

template<typename T>
ostream& operator,(ostream &out, T x)
{
    out<<x<<" ";
    return out;
}

/**********Hasib Templates Ends Here**************/

/**
 *  WARTNING for me:
 *     Never use    FOR
 *     Never use    pii, pll, vi, vi
 *     Never use    ff, ss, phl, sp, nl
 */

int main ()
{
    #ifdef hasibpc
        //read("input.txt");
        //write("output.txt");
    #endif // hasibpc

    int N;

    vector<int>v;

    sf("%d", &N);

    while(N > 1)
    {
            v.pb(1);
            N -= 2;
    }

    if(N == 1)
    {
            v[ SZ(v) - 1 ] = 7;
    }

    loop(i, SZ(v))
    {
            pf("%d", v[i]);
    }

    pf("\n");

    return 0;
}


/***********Template Starts Here***********/
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <deque>
#include <functional>
#include <string>
#include <iostream>
#include <cctype>
#include <set>
#include <climits>
#include <iomanip>
#include <cassert>
//#include <unordered_map>

#define pb push_back
#define nl puts ("")
#define sp printf ( " " )
#define phl printf ( "hello\n" )
#define ff first
#define ss second
#define POPCOUNT __builtin_popcountll
#define RIGHTMOST __builtin_ctzll
#define LEFTMOST(x) (63-__builtin_clzll((x)))
#define MP make_pair
#define FOR(i,x,y) for(int i = (x) ; i <= (y) ; ++i)
#define ROF(i,x,y) for(int i = (y) ; i >= (x) ; --i)
#define CLR(x,y) memset(x,y,sizeof(x))
#define UNIQUE(V) (V).erase(unique((V).begin(),(V).end()),(V).end())
#define MIN(a,b) ((a)<(b)?(a):(b))
#define MAX(a,b) ((a)>(b)?(a):(b))
#define NUMDIGIT(x,y) (((int)(log10((x))/log10((y))))+1)
#define SQ(x) ((x)*(x))
#define ABS(x) ((x)<0?-(x):(x))
#define FABS(x) ((x)+eps<0?-(x):(x))
#define ALL(x) (x).begin(),(x).end()
#define LCM(x,y) (((x)/gcd((x),(y)))*(y))
#define SZ(x) ((int)(x).size())
#define NORM(x) if(x>=mod)x-=mod;

using namespace std;

typedef long long vlong;
typedef unsigned long long uvlong;
typedef pair < int, int > pii;
typedef pair < vlong, vlong > pll;
typedef vector<pii> vii;
typedef vector<int> vi;

const vlong inf = 2147383647;
const double pi = 2 * acos ( 0.0 );
const double eps = 1e-9;

#ifdef forthright48
     #include <ctime>
     clock_t tStart = clock();
     #define debug(args...) {dbg,args; cerr<<endl;}
     #define timeStamp printf("Execution Time: %.2fs\n", (double)(clock() - tStart)/CLOCKS_PER_SEC)
#else
    #define debug(args...)  // Just strip off all debug tokens
    #define timeStamp
#endif

struct debugger{
    template<typename T> debugger& operator , (const T& v){
        cerr<<v<<" ";
        return *this;
    }
}dbg;

//int knightDir[8][2] = { {-2,1},{-1,2},{1,2},{2,1},{2,-1},{-1,-2},{1,-2},{-2,-1} };
//int dir4[4][2] = {{-1,0},{0,1},{1,0},{0,-1}};

inline vlong gcd ( vlong a, vlong b ) {
    a = ABS ( a ); b = ABS ( b );
    while ( b ) { a = a % b; swap ( a, b ); } return a;
}

vlong ext_gcd ( vlong A, vlong B, vlong *X, vlong *Y ){
    vlong x2, y2, x1, y1, x, y, r2, r1, q, r;
    x2 = 1; y2 = 0;
    x1 = 0; y1 = 1;
    for (r2 = A, r1 = B; r1 != 0; r2 = r1, r1 = r, x2 = x1, y2 = y1, x1 = x, y1 = y ) {
        q = r2 / r1;
        r = r2 % r1;
        x = x2 - (q * x1);
        y = y2 - (q * y1);
    }
    *X = x2; *Y = y2;
    return r2;
}

inline vlong modInv ( vlong a, vlong m ) {
    vlong x, y;
    ext_gcd( a, m, &x, &y );
    if ( x < 0 ) x += m; //modInv is never negative
    return x;
}

inline vlong power ( vlong a, vlong p ) {
    vlong res = 1, x = a;
    while ( p ) {
        if ( p & 1 ) res = ( res * x );
        x = ( x * x ); p >>= 1;
    }
    return res;
}

inline vlong bigmod ( vlong a, vlong p, vlong m ) {
    vlong res = 1 % m, x = a % m;
    while ( p ) {
        if ( p & 1 ) res = ( res * x ) % m;
        x = ( x * x ) % m; p >>= 1;
    }
    return res;
}

/***********Template Ends Here***********/

/*********** Hasib Templates Starts Here**********/

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

#define loop(i, n) for(int i=0; i<(n); i++)
#define sf scanf
#define pf printf
#define fr first
#define sc second
#define ll long long
#define dd double
#define all(v) (v).begin(), (v).end()
#define PI acos(-1.0)
#define mem(ara, val) memset(ara, val, sizeof(ara))
#define paii pair<int, int>
#define pall pair<ll, ll>
#define read(nm) freopen(nm, "r", stdin)
#define write(nm) freopen(nm, "w", stdout)
#define vdump(x) cerr<<#x<<" = "<<x<<endl;
//#define dump(args...) cerr,args; cerr<<endl
#define dump(args...) cerr<<"("<<#args<<") = (* ",args,"*)\n";
#define pbp(a,b) pb(MP(a,b))

template<typename T>
ostream& operator<<(ostream& out, vector<T> v)
{
    out<<"[ ";

    loop(i, SZ(v))
    {
        if(i) out<<", ";
        out<<v[i];
    }

    out<<" ]";
    return out;
}

template<typename T1, typename T2>
ostream& operator<<(ostream &out, pair<T1, T2> p)
{
    out<<"( "<<p.fr<<", "<<p.sc<<")";
    return out;
}

template<typename T>
ostream& operator,(ostream &out, T x)
{
    out<<x<<" ";
    return out;
}

/**********Hasib Templates Ends Here**************/

/**
 *  WARTNING for me:
 *     Never use    FOR
 *     Never use    pii, pll, vi, vi
 *     Never use    ff, ss, phl, sp, nl
 */

int main ()
{
    #ifdef hasibpc
        //read("input.txt");
        //write("output.txt");
    #endif // hasibpc

    int mp[12];

    mem(mp, -1);

    mp[2] = 1;
    mp[3] = 7;
    mp[4] = 4;
    mp[5] = 3;
    mp[6] = 9;
    mp[7] = 8;

    int N;

    vector<int>v;

    sf("%d", &N);

    while(N > 1)
    {
            v.pb(1);
            N -= 2;
    }

    if(N == 1)
    {
            v[0] = 7;
    }

    loop(i, SZ(v))
    {
            pf("%d", v[i]);
    }

    pf("\n");

    return 0;
}


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

int main()
{
    int n;
    cin>>n;
    if(n%2==0)
    {
        double m=n;
        while (m>1)
        {
            m= ceil (m/2);
            cout<<1;
        }
    }
    else
    {
        cout<<7;
        n-=3;
        double m = n;
        while (m>1)
        {
            m= ceil (m/2);
            cout<<1;
        }
    }
    return 0;
}


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

int main()
{
    int n;
    cin>>n;
    int m = n;
    while (m>=5)
    {
        m-=5;
        cout<<"9";
    }
    if (m==4) cout<<"71";
    else if (m==3) cout<<"7";
    else if (m==2) cout<<"1";
    return 0;
}


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

int main()
{
    int n;
    cin>>n;
    int m = n;
    while (m>=5)
    {
        m-=5;
        cout<<"9";
    }
    if (m==4) cout<<"11";
    else if (m==3) cout<<"7";
    else if (m==2) cout<<"1";
    return 0;
}


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

int main()
{
    int n;
    cin>>n;
    if(n%2==0)
    {
        int m=n/2;
        for (int i=0;i<m;i++)
        cout<<1;
    }
    else
    {
        cout<<7;
        n-=3;
        int m = n/2;
        for (int i=0;i<m;i++) cout<<1;
    }
    return 0;
}


#include <bits/stdc++.h>
#define Write freopen("out.txt","w",stdout)
#define Read freopen("in.txt","r",stdin)
#define sf(a) scanf("%d",&a)
#define sff(a,b) scanf("%d %d",&a,&b)
#define sfff(a,b,c) scanf("%d %d %d",&a,&b,&c)
#define ll long long
#define mod 100000007
#define MAXX 10
using namespace std;
string mp[100010];
int main()
{
    mp[2]="1";
    mp[3]="7";
    mp[4]="11";
    mp[5]="71";
    mp[6]="111";
    mp[7]="711";
    mp[8]="1111";
    int a;
    cin>>a;
    if(a<=8){
        cout<<mp[a]<<endl;
      return 0;
    }
    if(a==9){
        cout<<mp[7]+mp[2]<<endl;
        return 0;
    }
    mp[9]="7222";

    string k1,k2,k3;
    ///k1=mp[7]+mp[2];
    k1=mp[8]+mp[2];
    k2=mp[9]+mp[2];
    for(int i=10;i<=100003;i+=2)
    {
       k1=k1+mp[2];
       if(a==i) {
            cout<<k1<<endl;
       return 0;
       }
       k2=k2+mp[2];
       if(a==i+1){
        cout<<k2<<endl;
        return 0;
       }

    }

}


#include <bits/stdc++.h>
#define Write freopen("out.txt","w",stdout)
#define Read freopen("in.txt","r",stdin)
#define sf(a) scanf("%d",&a)
#define sff(a,b) scanf("%d %d",&a,&b)
#define sfff(a,b,c) scanf("%d %d %d",&a,&b,&c)
#define ll long long
#define mod 100000007
#define MAXX 10
using namespace std;
string mp[100010];
int main()
{
    mp[2]="1";
    mp[3]="7";
    mp[4]="11";
    mp[5]="71";
    mp[6]="111";
    mp[7]="711";
    mp[8]="1111";
    int a;
    cin>>a;
    if(a<=8)
    {
        cout<<mp[a]<<endl;
        return 0;
    }
    if(a==9)
    {
        cout<<mp[7]+mp[2]<<endl;
        return 0;
    }
    mp[9]="7111";

    string k1,k2,k3;
    k1=mp[8];
    k2=mp[9];
    for(int i=10; i<=100003; i+=2)
    {
        k1=k1+mp[2];
       // cout<<k1<<endl;
        if(a==i)
        {
            cout<<k1<<endl;
            return 0;
        }
        k2=k2+mp[2];
        ///cout<<k2<<endl;
        if(a==i+1)
        {
            cout<<k2<<endl;
            return 0;
        }

    }

}


#include <bits/stdc++.h>
#define Write freopen("out.txt","w",stdout)
#define Read freopen("in.txt","r",stdin)
#define sf(a) scanf("%d",&a)
#define sff(a,b) scanf("%d %d",&a,&b)
#define sfff(a,b,c) scanf("%d %d %d",&a,&b,&c)
#define ll long long
#define mod 100000007
#define MAXX 10
using namespace std;
string mp[100010];
int main()
{
    mp[2]="2";
    mp[3]="7";
    mp[4]="22";
    mp[5]="72";
    mp[6]="222";
    mp[7]="722";
    mp[8]="2222";
    int a;
    cin>>a;
    if(a<=8){
        cout<<mp[a]<<endl;
      return 0;
    }
    if(a==9){
        cout<<mp[7]+mp[2]<<endl;
        return 0;
    }
    mp[9]="7222";

    string k1,k2,k3;
    ///k1=mp[7]+mp[2];
    k1=mp[8]+mp[2];
    k2=mp[9]+mp[2];
    for(int i=10;i<=100003;i+=2)
    {
       k1=k1+mp[2];
       if(a==i) {
            cout<<k1<<endl;
       return 0;
       }
       k2=k2+mp[2];
       if(a==i+1){
        cout<<k2<<endl;
        return 0;
       }

    }

}


#include <bits/stdc++.h>
#define Write freopen("out.txt","w",stdout)
#define Read freopen("in.txt","r",stdin)
#define sf(a) scanf("%d",&a)
#define sff(a,b) scanf("%d %d",&a,&b)
#define sfff(a,b,c) scanf("%d %d %d",&a,&b,&c)
#define ll long long
#define mod 100000007
#define MAXX 10
using namespace std;
string mp[100010];
int main()
{
    mp[2]="1";
    mp[3]="7";
    mp[4]="22";
    mp[5]="72";
    mp[6]="222";
    mp[7]="722";
    mp[8]="2222";
    int a;
    cin>>a;
    if(a<=8){
        cout<<mp[a]<<endl;
      return 0;
    }
    if(a==9){
        cout<<mp[7]+mp[2]<<endl;
        return 0;
    }
    mp[9]="7222";

    string k1,k2,k3;
    ///k1=mp[7]+mp[2];
    k1=mp[8]+mp[2];
    k2=mp[9]+mp[2];
    for(int i=10;i<=100003;i+=2)
    {
       k1=k1+mp[2];
       if(a==i) {
            cout<<k1<<endl;
       return 0;
       }
       k2=k2+mp[2];
       if(a==i+1){
        cout<<k2<<endl;
        return 0;
       }

    }

}


#include <bits/stdc++.h>
#define Write freopen("out.txt","w",stdout)
#define Read freopen("in.txt","r",stdin)
#define sf(a) scanf("%d",&a)
#define sff(a,b) scanf("%d %d",&a,&b)
#define sfff(a,b,c) scanf("%d %d %d",&a,&b,&c)
#define ll long long
#define mod 100000007
#define MAXX 10
using namespace std;
string mp[100010];
int main()
{
    mp[2]="1";
    mp[3]="7";
    mp[4]="1";
    mp[5]="71";
    mp[6]="111";
    mp[7]="711";
    mp[8]="1111";
    int a;
    cin>>a;
    if(a<=8){
        cout<<mp[a]<<endl;
      return 0;
    }
    if(a==9){
        cout<<mp[7]+mp[2]<<endl;
        return 0;
    }
    mp[9]="7222";

    string k1,k2,k3;
    ///k1=mp[7]+mp[2];
    k1=mp[8]+mp[2];
    k2=mp[9]+mp[2];
    for(int i=10;i<=100003;i+=2)
    {
       k1=k1+mp[2];
       if(a==i) {
            cout<<k1<<endl;
       return 0;
       }
       k2=k2+mp[2];
       if(a==i+1){
        cout<<k2<<endl;
        return 0;
       }

    }

}


#include <bits/stdc++.h>
#define Write freopen("out.txt","w",stdout)
#define Read freopen("in.txt","r",stdin)
#define sf(a) scanf("%d",&a)
#define sff(a,b) scanf("%d %d",&a,&b)
#define sfff(a,b,c) scanf("%d %d %d",&a,&b,&c)
#define ll long long
#define mod 100000007
#define MAXX 10
using namespace std;
string mp[100010];
int main()
{
    mp[2]="1";
    mp[3]="7";
    mp[4]="11";
    mp[5]="71";
    mp[6]="111";
    mp[7]="711";
    mp[8]="1111";
    int a;
    cin>>a;
    if(a<=8){
        cout<<mp[a]<<endl;
      return 0;
    }
    if(a==9){
        cout<<mp[7]+mp[2]<<endl;
        return 0;
    }
    mp[9]="7111";

    string k1,k2,k3;
    ///k1=mp[7]+mp[2];
    k1=mp[8]+mp[2];
    k2=mp[9]+mp[2];
    for(int i=10;i<=100003;i+=2)
    {
       k1=k1+mp[2];
       if(a==i) {
            cout<<k1<<endl;
       return 0;
       }
       k2=k2+mp[2];
       if(a==i+1){
        cout<<k2<<endl;
        return 0;
       }

    }

}


#include <iostream>
#include <cstdio>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <ctime>
#include <cmath>
#include <string>
#include <iomanip>
#include <vector>
#include <set>
#include <iomanip>
#include <map>
#include <cassert>
#include <queue>
#include <bitset>
#include <math.h>
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
    int n;
    cin >>n;
    if(n == 2)
    {
        cout <<1;
        return 0;
    }
    if(n == 3)
    {
        cout <<7;
        return 0;
    }
    if(n % 2)
    {
        cout <<7;
        n = n  - 3;
        int k = n / 2;
        for(int i = 0;i < k;i++)
        {
            cout <<1;
        }
    }
    else
    {

        int k = n / 2;
        for(int i = 1;i <= k;i++)
        {
            cout <<1;
        }

    }

}


#include <iostream>
#include <cstdio>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <ctime>
#include <cmath>
#include <string>
#include <iomanip>
#include <vector>
#include <set>
#include <iomanip>
#include <map>
#include <cassert>
#include <queue>
#include <bitset>
#include <math.h>
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
    int n;
    cin >>n;
    if(n == 2)
    {
        cout <<1;
        return 0;
    }
    if(n == 3)
    {
        cout <<7;
        return 0;
    }
    if(n % 2)
    {
        cout <<7;
        int k = n / 2;
        for(int i = 0;i < k;i++)
        {
            cout <<1;
        }
    }
    else
    {
        int k = n / 2;
        for(int i = 0;i < k;i++)
        {
            cout <<1;
        }

    }

}


#include <bits/stdc++.h>
int main() {int n;scanf("%d", &n);if(n&1) n -= 3, printf("7");for(int i = 0; i < n/2; i++) printf("1");return 0;}


#include <bits/stdc++.h>
int n;
int main() {
    scanf("%d", &n);
    if(n&1) n -= 3, printf("7");
    for(int i = 0; i < n/2; i++) printf("1");
    return 0;
}


#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
typedef long long int lli;

int main()
{
	int n;
	cin >> n;
	if (n % 2 == 0)
		for (int i = 0; i < n / 2; i++)
			cout << 1;
	else
	{
		for (int i = 0; i < (n - 3) / 2; i++)
			cout << 1;
		cout << 7;
	}
	return 0;
}


#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
typedef long long int lli;

int main()
{
	int n;
	cin >> n;
	if (n % 2 == 0)
		for (int i = 0; i < n / 2; i++)
			cout << 1;
	else
	{
		cout << 7;
		for (int i = 0; i < (n - 3) / 2; i++)
			cout << 1;
	}
	return 0;
}


#include <bits/stdc++.h>

#define pii              pair <int,int>
#define pll              pair <long long,long long>
#define sc               scanf
#define pf               printf
#define Pi               2*acos(0.0)
#define ms(a,b)          memset(a, b, sizeof(a))
#define pb(a)            push_back(a)
#define MP               make_pair
#define db               double
#define ll               long long
#define EPS              10E-10
#define ff               first
#define ss               second
#define sqr(x)           (x)*(x)
#define D(x)             cout<<#x " = "<<(x)<<endl
#define VI               vector <int>
#define DBG              pf("Hi\n")
#define MOD              1000000007
#define CIN              ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define SZ(a)            (int)a.size()
#define sf(a)            scanf("%d",&a)
#define sfl(a)           scanf("%lld",&a)
#define sff(a,b)         scanf("%d %d",&a,&b)
#define sffl(a,b)        scanf("%lld %lld",&a,&b)
#define sfff(a,b,c)      scanf("%d %d %d",&a,&b,&c)
#define sfffl(a,b,c)     scanf("%lld %lld %lld",&a,&b,&c)
#define stlloop(v)       for(__typeof(v.begin()) it=v.begin();it!=v.end();it++)
#define loop(i,n)        for(int i=0;i<n;i++)
#define loop1(i,n)       for(int i=1;i<=n;i++)
#define REP(i,a,b)       for(int i=a;i<b;i++)
#define RREP(i,a,b)      for(int i=a;i>=b;i--)
#define TEST_CASE(t)     for(int z=1;z<=t;z++)
#define PRINT_CASE       printf("Case %d: ",z)
#define LINE_PRINT_CASE  printf("Case %d:\n",z)
#define CASE_PRINT       cout<<"Case "<<z<<": "
#define all(a)           a.begin(),a.end()
#define intlim           2147483648
#define infinity         (1<<28)
#define ull              unsigned long long
#define gcd(a, b)        __gcd(a, b)
#define lcm(a, b)        ((a)*((b)/gcd(a,b)))

using namespace std;

/*----------------------Graph Moves----------------*/
//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*------------------------------------------------*/

/*-----------------------Bitmask------------------*/
//int Set(int N,int pos){return N=N | (1<<pos);}
//int reset(int N,int pos){return N= N & ~(1<<pos);}
//bool check(int N,int pos){return (bool)(N & (1<<pos));}
/*------------------------------------------------*/

int main()
{

//    freopen("in.txt","r",stdin);
//	  freopen("out.txt","w",stdout);

    int n;
    cin>>n;

    int ans=n/2;
    if(n==3)
    {
        cout<<7<<endl;
        return 0;
    }
    for(int i=0;i<ans;i++) cout<<1;

    return 0;
}


#include <bits/stdc++.h>

#define pii              pair <int,int>
#define pll              pair <long long,long long>
#define sc               scanf
#define pf               printf
#define Pi               2*acos(0.0)
#define ms(a,b)          memset(a, b, sizeof(a))
#define pb(a)            push_back(a)
#define MP               make_pair
#define db               double
#define ll               long long
#define EPS              10E-10
#define ff               first
#define ss               second
#define sqr(x)           (x)*(x)
#define D(x)             cout<<#x " = "<<(x)<<endl
#define VI               vector <int>
#define DBG              pf("Hi\n")
#define MOD              1000000007
#define CIN              ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define SZ(a)            (int)a.size()
#define sf(a)            scanf("%d",&a)
#define sfl(a)           scanf("%lld",&a)
#define sff(a,b)         scanf("%d %d",&a,&b)
#define sffl(a,b)        scanf("%lld %lld",&a,&b)
#define sfff(a,b,c)      scanf("%d %d %d",&a,&b,&c)
#define sfffl(a,b,c)     scanf("%lld %lld %lld",&a,&b,&c)
#define stlloop(v)       for(__typeof(v.begin()) it=v.begin();it!=v.end();it++)
#define loop(i,n)        for(int i=0;i<n;i++)
#define loop1(i,n)       for(int i=1;i<=n;i++)
#define REP(i,a,b)       for(int i=a;i<b;i++)
#define RREP(i,a,b)      for(int i=a;i>=b;i--)
#define TEST_CASE(t)     for(int z=1;z<=t;z++)
#define PRINT_CASE       printf("Case %d: ",z)
#define LINE_PRINT_CASE  printf("Case %d:\n",z)
#define CASE_PRINT       cout<<"Case "<<z<<": "
#define all(a)           a.begin(),a.end()
#define intlim           2147483648
#define infinity         (1<<28)
#define ull              unsigned long long
#define gcd(a, b)        __gcd(a, b)
#define lcm(a, b)        ((a)*((b)/gcd(a,b)))

using namespace std;

/*----------------------Graph Moves----------------*/
//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*------------------------------------------------*/

/*-----------------------Bitmask------------------*/
//int Set(int N,int pos){return N=N | (1<<pos);}
//int reset(int N,int pos){return N= N & ~(1<<pos);}
//bool check(int N,int pos){return (bool)(N & (1<<pos));}
/*------------------------------------------------*/

int main()
{

//    freopen("in.txt","r",stdin);
//	  freopen("out.txt","w",stdout);

    int n;
    cin>>n;

    int ans=n/2;
    if(n==3)
    {
        cout<<7<<endl;
        return 0;
    }
    for(int i=0;i<ans;i++) cout<<1<<endl;

    return 0;
}


#include <bits/stdc++.h>

#define pii              pair <int,int>
#define pll              pair <long long,long long>
#define sc               scanf
#define pf               printf
#define Pi               2*acos(0.0)
#define ms(a,b)          memset(a, b, sizeof(a))
#define pb(a)            push_back(a)
#define MP               make_pair
#define db               double
#define ll               long long
#define EPS              10E-10
#define ff               first
#define ss               second
#define sqr(x)           (x)*(x)
#define D(x)             cout<<#x " = "<<(x)<<endl
#define VI               vector <int>
#define DBG              pf("Hi\n")
#define MOD              1000000007
#define CIN              ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define SZ(a)            (int)a.size()
#define sf(a)            scanf("%d",&a)
#define sfl(a)           scanf("%lld",&a)
#define sff(a,b)         scanf("%d %d",&a,&b)
#define sffl(a,b)        scanf("%lld %lld",&a,&b)
#define sfff(a,b,c)      scanf("%d %d %d",&a,&b,&c)
#define sfffl(a,b,c)     scanf("%lld %lld %lld",&a,&b,&c)
#define stlloop(v)       for(__typeof(v.begin()) it=v.begin();it!=v.end();it++)
#define loop(i,n)        for(int i=0;i<n;i++)
#define loop1(i,n)       for(int i=1;i<=n;i++)
#define REP(i,a,b)       for(int i=a;i<b;i++)
#define RREP(i,a,b)      for(int i=a;i>=b;i--)
#define TEST_CASE(t)     for(int z=1;z<=t;z++)
#define PRINT_CASE       printf("Case %d: ",z)
#define LINE_PRINT_CASE  printf("Case %d:\n",z)
#define CASE_PRINT       cout<<"Case "<<z<<": "
#define all(a)           a.begin(),a.end()
#define intlim           2147483648
#define infinity         (1<<28)
#define ull              unsigned long long
#define gcd(a, b)        __gcd(a, b)
#define lcm(a, b)        ((a)*((b)/gcd(a,b)))

using namespace std;

/*----------------------Graph Moves----------------*/
//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*------------------------------------------------*/

/*-----------------------Bitmask------------------*/
//int Set(int N,int pos){return N=N | (1<<pos);}
//int reset(int N,int pos){return N= N & ~(1<<pos);}
//bool check(int N,int pos){return (bool)(N & (1<<pos));}
/*------------------------------------------------*/

int main()
{

//    freopen("in.txt","r",stdin);
//	  freopen("out.txt","w",stdout);

    int n;
    cin>>n;

    int ans=n/2;

    if(n%2) ans--;

    for(int i=0;i<ans;i++) cout<<1;
    if(n%2) cout<<7<<endl;

    return 0;
}


#include <bits/stdc++.h>

#define pii              pair <int,int>
#define pll              pair <long long,long long>
#define sc               scanf
#define pf               printf
#define Pi               2*acos(0.0)
#define ms(a,b)          memset(a, b, sizeof(a))
#define pb(a)            push_back(a)
#define MP               make_pair
#define db               double
#define ll               long long
#define EPS              10E-10
#define ff               first
#define ss               second
#define sqr(x)           (x)*(x)
#define D(x)             cout<<#x " = "<<(x)<<endl
#define VI               vector <int>
#define DBG              pf("Hi\n")
#define MOD              1000000007
#define CIN              ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define SZ(a)            (int)a.size()
#define sf(a)            scanf("%d",&a)
#define sfl(a)           scanf("%lld",&a)
#define sff(a,b)         scanf("%d %d",&a,&b)
#define sffl(a,b)        scanf("%lld %lld",&a,&b)
#define sfff(a,b,c)      scanf("%d %d %d",&a,&b,&c)
#define sfffl(a,b,c)     scanf("%lld %lld %lld",&a,&b,&c)
#define stlloop(v)       for(__typeof(v.begin()) it=v.begin();it!=v.end();it++)
#define loop(i,n)        for(int i=0;i<n;i++)
#define loop1(i,n)       for(int i=1;i<=n;i++)
#define REP(i,a,b)       for(int i=a;i<b;i++)
#define RREP(i,a,b)      for(int i=a;i>=b;i--)
#define TEST_CASE(t)     for(int z=1;z<=t;z++)
#define PRINT_CASE       printf("Case %d: ",z)
#define LINE_PRINT_CASE  printf("Case %d:\n",z)
#define CASE_PRINT       cout<<"Case "<<z<<": "
#define all(a)           a.begin(),a.end()
#define intlim           2147483648
#define infinity         (1<<28)
#define ull              unsigned long long
#define gcd(a, b)        __gcd(a, b)
#define lcm(a, b)        ((a)*((b)/gcd(a,b)))

using namespace std;

/*----------------------Graph Moves----------------*/
//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*------------------------------------------------*/

/*-----------------------Bitmask------------------*/
//int Set(int N,int pos){return N=N | (1<<pos);}
//int reset(int N,int pos){return N= N & ~(1<<pos);}
//bool check(int N,int pos){return (bool)(N & (1<<pos));}
/*------------------------------------------------*/

int main()
{

//    freopen("in.txt","r",stdin);
//	  freopen("out.txt","w",stdout);

    int n;
    cin>>n;

    int ans=n/2;

    if(n%2) ans--;
    if(n%2) cout<<7;
    for(int i=0;i<ans;i++) cout<<1;

    return 0;
}


#include<cstdio>
int main(){
	int n;
	while(scanf("%d",&n)!=EOF){
		while(n>0){
			if(n>=3){
				printf("7");
				n-=3;
			}else if(n>=2){
				printf("1");
				n-=2;
			}
		}
		printf("\n");;
	}
}


#include<iostream>
using namespace std;
int main(){
	int n;
	while(cin>>n){
		while(n>0){
			if(n>=3){
				cout<<7;
				n-=3;
			}else if(n>=2){
				cout<<1;
				n-=2;
			}
		}
		cout<<endl;
	}
}


#include<cstdio>
int main(){
	int n;
	while(scanf("%d",&n)){
		while(n>0){
			if(n>=3){
				printf("7");
				n-=3;
			}else if(n>=2){
				printf("1");
				n-=2;
			}
		}
		printf("\n");;
	}
}


#include<cstdio>
int main(){
	int n;
	while(scanf("%d",&n)!=EOF){
		if(n%2==1){
			printf("7");
			n-=3;
		}
		while(n>=2){
			printf("1");
			n-=2;
		}
		printf("\n");
	}
}


#include<iostream>
using namespace std;
int main(){
	ios::sync_with_stdio(false);
	int n;
	while(cin>>n){
		while(n>0){
			if(n>=3){
				cout<<7;
				n-=3;
			}else if(n>=2){
				cout<<1;
				n-=2;
			}
		}
		cout<<endl;
	}
}


#include<cstdio>
int main(){
	int n;
	while(scanf("%d",&n)!=EOF){
		while(n>4){
			if(n>=3){
				printf("7");
				n-=3;
			}else if(n>=2){
				printf("1");
				n-=2;
			}
		}
		if(n==4){
			printf("11");
		}else if(n==3){
			printf("7");
		}else if(n==2){
			printf("1");
		}
		printf("\n");;
	}
}


#include<cstdio>
int main(){
	int n;
	while(scanf("%d",&n)!=EOF){
		while(n>=2){
			if(n>=3){
				printf("7");
				n-=3;
			}else if(n>=2){
				printf("1");
				n-=2;
			}
		}
		printf("\n");;
	}
}


#include<iostream>
using namespace std;
int main()
{
	int n;
	cin>>n;
	while(1)
    {
    	 int n1=n/6;
    	int r=n%6;
        for(int i=0;i<n1;i++)
        cout<<9;

		if(r!=0)
		{
			int x=r;
			while(1)
			{
				int n2=x/3;
				int y=x%3;
				for(int i=0;i<n2;i++)
                 cout<<7;
				 if(y!=0)
				{
				   cout<<1;
				}
				break;
			}
			break;
		}
	}
}


#include<iostream>
using namespace std;
int main()
{
	int n;
	cin>>n;
	int x=n/3;
	for(int i=0;i<x;i++)
	cout<<7;
	  int y=n%3;
	   if(y!=0&&y>1)
		{
           cout<<1;
		}
}


#include<iostream>
using namespace std;
int main()
{
	  int n;
	  cin>>n;
	  if(n%2==0)
	  {
	  	int n1=n/2;
	  	for(int i=0;i<n1;i++)
	  	cout<<1;
	  }
	  else
	  {
	  	int n2=n-3;
	  	cout<<7;
	  	int n3=n2/2;
	  	for(int i=0;i<n3;i++)
	  	cout<<1;

      }
}


#include<iostream>
using namespace std;
int main()
{
	int n;
	cin>>n;
	while(1)
    {
    	int n1=n/6;

    	int r=n%6;
        for(int i=0;i<n1;i++)
        cout<<9;
		if(r!=0)
		{
			int x=r;
			while(1)
			{
				int n2=x/3;
				int y=x%3;
				for(int i=0;i<n2;i++)
                 cout<<7;
				 if(y!=0&&y>1)
				{
				   cout<<1;
				}
				break;
			}
			break;
		}
		if(r==0)
		break;
	}
}


#include<iostream>
using namespace std;
int main()
{
	int n;
	cin>>n;
	while(1)
    {
    	 int n1=n/6;
    	int r=n%6;
        for(int i=0;i<n1;i++)
        cout<<9;

		if(r!=0)
		{
			int x=r;
			while(1)
			{
				int n2=x/3;
				int y=x%3;
				for(int i=0;i<n2;i++)
                 cout<<7;
				 if(y!=0&&y>1)
				{
				   cout<<1;
				}
				break;
			}
			break;
		}
	}
}


#include<cstdio>
int main() {
	int n; scanf("%d", &n);
	if (n % 2 == 0) {
		for (int i = 0; i < n / 2; i++) printf("1");
	}
	else {
		printf("7");
		for (int i = 0; i < n / 2-1; i++)printf("1");
	}
}


#include<cstdio>
bool check[10] = { false };
int main() {
	int a[10] = { 6,2,5,5,4,5,6,3,7,6 };
	int n; scanf("%d", &n);
	while (n > 0) {
		int Max = 0;
		for (int i = 0; i < 10; i++) {
			if (a[i] <= n && check[i]==false) Max = i;
		}
		printf("%d", Max);
		n -= a[Max];
	}
}


#include<cstdio>
bool check[10] = { false };
int main() {
	int a[10] = { 6,2,5,5,4,5,6,3,7,6 };
	int n; scanf("%d", &n);
	while (n > 0) {
		int Max = 0;
		for (int i = 0; i < 10; i++) {
			if (a[i] <= n && check[i]==false) Max = i;
		}
		check[Max] = true;
		n -= a[Max];
	}
	for (int i = 1; i < 10; i++) {
		if (check[i] == true) printf("%d", i);
	}
}


#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

#ifdef RUBICK
#include "dbg.h"
#else
#define dbg(exp) /* nop; */
#endif

// F cin/cout
#define cin nullptr
#define cout nullptr

using namespace std;
using namespace __gnu_pbds;

template<class T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

using ll = long long;
using ld = long double;

int main() {
    int n;
    scanf("%d", &n);

    string ans;

    if (n & 1) {
        ans += '7';
        n -= 3;
    }

    while (n > 2) {
        ans += '1';
        n -= 2;
    }

    puts(ans.c_str());

    return 0;
}


#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

#ifdef RUBICK
#include "dbg.h"
#else
#define dbg(exp) /* nop; */
#endif

// F cin/cout
#define cin nullptr
#define cout nullptr

using namespace std;
using namespace __gnu_pbds;

template<class T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

using ll = long long;
using ld = long double;

int main() {
    int n;
    scanf("%d", &n);

    string ans;

    if (n & 1) {
        ans += '7';
        n -= 3;
    }

    while (n > 0) {
        ans += '1';
        n -= 2;
    }

    puts(ans.c_str());

    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    switch(n)
    {
    case 3 :
        cout<<7;
        break;
    default :
        int m=n/2;
        n-=(m*2);
        if (n==1)
            m--;
        for(int i=0; i<m; i++)
            cout<<1;
    }
    cout<<7;

    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    switch(n)
    {
    case 3 :
        cout<<7;
        break;
    default :
        int m=n/2;
        n-=(m*2);
        if (n==1)
            m--;
        for(int i=0; i<m; i++)
            cout<<1;
    }
    if(n==1)
    cout<<7;

    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    switch(n)
    {
    case 2 :
        cout<<1;
        break;
    case 3 :
    case 4 :
    case 5 :
        cout<<7;
        break;
    default :
        cout<<9;
    }
    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int m=n/6;
    for(int i=0; i<m; i++)
        cout<<9;
    n-=(m*6);
    m=n/3;
    for(int i=0; i<m; i++)
        cout<<7;
    n-=(m*3);
    m=n/2;
    for(int i=0; i<m; i++)
        cout<<1;

    return 0;
}


#include <iostream>

using namespace std;

int main()
{
    int n;
    cin>>n;
    switch(n)
    {
    case 3 :
        cout<<7;
        break;
    default :
        int m=n/2;
        n-=(m*2);
        if (n==1)
        {cout<<7;
            m--;}
        for(int i=0; i<m; i++)
            cout<<1;
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int N;
    cin>>N;
    if(N==2){
        cout<<"1"<<endl;
        return 0;
    }
    if(N==3)
    {
        cout<<"7"<<endl;
        return 0;
    }

    if(N%2==0)
    {
        int X=N/2;
        for(int i=1; i<=X; i++)
            cout<<"1";
        return 0;
    }
    else
    {
        int X=N/2;
        for(int i=1; i<X; i++)
            cout<<"1";
            cout<<"7";
        return 0;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
    int N;
    cin>>N;
    if(N==2){
        cout<<"1"<<endl;
        return 0;
    }
    if(N==3)
    {
        cout<<"7"<<endl;
        return 0;
    }

    if(N%2==0)
    {
        int X=N/2;
        for(int i=1; i<=X; i++)
            cout<<"1";
        return 0;
    }
    else
    {
        int X=N/2;
        cout<<"7";
        for(int i=1; i<X; i++)
            cout<<"1";
        return 0;
    }
}


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

typedef long long ll;
typedef unsigned long long ull;
const int mx = 100010;

int main() {
    int arr[] = {6,2,5,5,4,5,6,3,7,6},n;
    scanf("%d",&n);
    if(n%2) {
        printf("7");
        n -= 3;
    }
    for(int i=0;i<n/2;i++) printf("1");
 }


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

typedef long long ll;
typedef unsigned long long ull;
const int mx = 100010;

int main() {
    int arr[] = {6,2,5,5,4,5,6,3,7,6},n;
    scanf("%d",&n);
    if(n%2) {
        printf("3");
        n -= 3;
    }
    else {
        for(int i=0;i<n/2;i++) printf("1");
    }
 }


///HEADER FILES///

#include <cstdio>
#include <cstring>
#include <cmath>
#include <cctype>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <complex>
#include <iomanip>
#include <utility>
#include <bitset>
#include <list>
#include <assert.h>
#include <numeric>
#include <fstream>
using namespace std;

///DEFINES///

///ALWAYS USEFUL
#define     caseprint(case)     printf("Case %d: ", case ++)
#define     caseprintnl(case)   printf("Case %d:\n", case ++)
#define     clr(a)              memset(a, 0, sizeof(a))
#define     mem(a, b)           memset(a, b, sizeof(a))
#define     pb                  push_back
#define     pp                  pop_back
#define     full(v)             v.begin(), v.end()
#define     sort_vec(v)         sort(full(v))
#define     sf                  scanf
#define     pf                  printf
#define     NL                  pf("\n")
#define     sz(a)               (int)a.size()
#define     bitcheck(n, pos)    (n & (1<<(pos)))
#define     biton(n, pos)       (n | (1<<(pos)))
#define     bitoff(n, pos)      (n & ~(1<<(pos)))
#define     sqr(a)              ((a)*(a))

///SCAN
#define     sfs(a)              scanf("%s", &a)
#define     sfi1(a)             scanf("%d", &a)
#define     sfi2(a, b)          scanf("%d %d", &a, &b)
#define     sfi3(a, b, c)       scanf("%d %d %d", &a, &b, &c)
#define     sfi4(a, b, c, d)    scanf("%d %d %d %d", &a, &b, &c, &d)
#define     sfd1(a)             scanf("%lf", &a)
#define     sfd2(a, b)          scanf("%lf %lf", &a, &b)
#define     sfd3(a, b, c)       scanf("%lf %lf %lf", &a, &b, &c)
#define     sfd4(a, b, c, d)    scanf("%lf %lf %lf %lf", &a, &b, &c, &d)
#define     sfll1(a)            scanf("%lld", &a)
#define     sfll2(a, b)         scanf("%lld %lld", &a, &b)
#define     sfll3(a, b, c)      scanf("%lld %lld %lld", &a, &b, &c)
#define     sfll4(a, b, c, d)   scanf("%lld %lld %lld %lld", &a, &b, &c, &d)
#define     sfull1(a)           scanf("%llu", &a)
#define     sfull2(a, b)        scanf("%llu %llu", &a, &b)
#define     sfull3(a, b, c)     scanf("%llu %llu %llu", &a, &b, &c)
#define     sfull4(a, b, c, d)  scanf("%llu %llu %llu %llu", &a, &b, &c, &d)

///GEOMETRY
#define     ang(a, b, c)            acos((sqr(b)+sqr(c)-sqr(a))/(2.0*b*c))
#define     dist(x1, y1, x2, y2)    sqrt(sqr(x1-x2)+sqr(y1-y2))

///TYPES///
typedef     long long ll;
typedef     unsigned long long ull;
typedef     pair<int, int>      pii;
typedef     pair<ll, ll>        pll;

struct debugger
{
    template<typename T> debugger& operator, (const T& v)
    {
        cerr<<v<<" ";
        return *this;
    }
} dbg;
#define deb(args ...){dbg, args; cerr<<endl;}

//ll extGcd(ll a, ll b, ll& x, ll& y){if (b == 0){x = 1;y = 0;return a;}else{int g = extGcd(b, a % b, y, x);y -= a / b * x;return g;}}
//ll modInv(ll a, ll m){ll x, y; extGcd(a, m, x, y); x %= m; while (x < 0){x += m;} return x;}
//ll BigMod(ll b, ll p, ll m) {if(!p) return 1; ll x=BigMod(b,p/2,m); x=(x*x)%m; if(p&1) x=(x*b)%m; return x;}
//ll bigmod(ll B,ll P,ll M){ ll R=1%M; while(P>0) {if(P%2==1){R=(R*B)%M;}P/=2;B=(B*B)%M;} ret urn R;} /// (B^P)%M

//int x[] = {0,0,-1,1};//4-ways
//int y[] = {1,-1,0,0};//4-ways
//int x[] = {-1,-1,-1,0,0,1,1,1};//8-ways
//int y[] = {-1,0,1,-1,1,-1,0,1};//8-ways
//int x[] = {-2,-2,2,2,1,1,-1,-1};//knight moves
//int y[] = {1,-1,1,-1,2,-2,2,-2};//knight moves

///CONSTANTS
#define     pi                  acos(-1.0)
#define     ex                  exp(1)

///OTHERS
#define     READ                freopen("input.txt","r",stdin);
#define     WRITE               freopen("out.txt","w",stdout);
#define     accelerate          ios_base::sync_with_stdio(false); cin.tie(NULL)
#define     debug               printf("Ok\n")
#define     MOD                 1000000007
#define     M                   500000

int main()
{
    accelerate;

    int n;
    string s;

    while(cin>>n>>s)
    {
        int depth = 0, cnt=0;

        int d[n+5];

        for(int i=0; i<n; i++)
        {
            if(s[i]=='(')
            {
                cnt++;
                depth = max(depth, cnt);
            }
            else cnt--;
            d[i]=cnt;
        }

        int make = (depth+1)/2;

        int ans[n+5];
        clr(ans);

        for(int i=0; i<n; i++)
        {
            if(s[i]==')') d[i]++;
            if(d[i]<=make) ans[i]=1;
        }

        for(int i=0; i<n; i++) cout<<ans[i];
        cout<<endl;
    }

    return 0;
}


#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define print(v,r) f(i,0,r) cout<<v[i]<<" "; cout<<endl;
#define Get(x,y) scanf("%I64d%I64d",&x,&y);
#define f_(i,a,b) for(int i=a;i>=b;i--)
#define Gett(x,y) scanf("%d%d",&x,&y);
#define f(i,a,b) for(ll i=a;i<b;i++)
#define get(x) scanf("%I64d",&x);
#define gett(x) scanf("%d",&x);
#define ops(x) cout<<x<<" !"<<endl;
#define maxm(a,b) a=max(a,b);
#define minm(a,b) a=min(a,b);
#define bit(x) (1ll<<(x*1ll))
#define mp make_pair
#define ll long long
#define pb push_back
#define S second
#define F first

const int N=3e5+9;

int n,t,ans[N],mark[N],p,b[N];
string s;

void solve(int l,int r,bool col){
	if(l>r) return ;
	//cout<<l<<" "<<r<<endl;
	if(b[l]==r){
		ans[l]=col,ans[r]=col;
		solve(l+1,r-1,1-col);
	}
	else{
		solve(l,b[l],col);
		solve(b[l]+1,r,col);
	}
}
int main(){
	mark[0]=-1;
	cin>>n>>s;
	f(i,0,n){
		p+=(s[i]==')');
		p-=(s[i]=='(');
		if(s[i]==')');
			b[i]=mark[p]+1,b[mark[p]+1]=i;
		mark[p]=i;
	}
	solve(0,n-1,0);
	f(i,0,n) cout<<ans[i];
}


#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define print(v,r) f(i,0,r) cout<<v[i]<<" "; cout<<endl;
#define Get(x,y) scanf("%I64d%I64d",&x,&y);
#define f_(i,a,b) for(int i=a;i>=b;i--)
#define Gett(x,y) scanf("%d%d",&x,&y);
#define f(i,a,b) for(ll i=a;i<b;i++)
#define get(x) scanf("%I64d",&x);
#define gett(x) scanf("%d",&x);
#define ops(x) cout<<x<<" !"<<endl;
#define maxm(a,b) a=max(a,b);
#define minm(a,b) a=min(a,b);
#define bit(x) (1ll<<(x*1ll))
#define mp make_pair
#define ll long long
#define pb push_back
#define S second
#define F first

const int N=5e5+9;

int n,t,ans[N],mark[N],p,b[N];
string s;

void solve(int l,int r,bool col){
	if(l>r) return ;
	if(b[l]==r){
		ans[l]=col,ans[r]=col;
		solve(l+1,r-1,1-col);
	}
	else{
		if(s[b[l]+1]==')')
			cout<<l<<" "<<r<<" !"<<b[l]+1<<endl;
		if(b[l]+1==')') cout<<l<<" "<<r<<endl;
		solve(l,b[l],col);
		solve(b[l]+1,r,col);
	}
}
int main(){
	mark[0]=-1;
	cin>>n>>s;
	f(i,0,n){
		p+=(s[i]=='(');
		p-=(s[i]==')');
		if(s[i]==')')
			b[i]=mark[p]+1,b[mark[p]+1]=i;
			mark[p]=i;
		//cout<<p<<" ";
	}
	cout<<endl;
	//print(b,n);
	solve(0,n-1,0);
	f(i,0,n) cout<<ans[i];
}


#include <bits/stdc++.h>
#include <iostream>
using namespace std;
#define print(v,r) f(i,0,r) cout<<v[i]<<" "; cout<<endl;
#define Get(x,y) scanf("%I64d%I64d",&x,&y);
#define f_(i,a,b) for(int i=a;i>=b;i--)
#define Gett(x,y) scanf("%d%d",&x,&y);
#define f(i,a,b) for(ll i=a;i<b;i++)
#define get(x) scanf("%I64d",&x);
#define gett(x) scanf("%d",&x);
#define ops(x) cout<<x<<" !"<<endl;
#define maxm(a,b) a=max(a,b);
#define minm(a,b) a=min(a,b);
#define bit(x) (1ll<<(x*1ll))
#define mp make_pair
#define ll long long
#define pb push_back
#define S second
#define F first

const int N=5e5+9;

int n,t,ans[N],mark[N],p,b[N];
string s;

void solve(int l,int r,bool col){
	if(l>r) return ;
	if(b[l]==r){
		ans[l]=col,ans[r]=col;
		solve(l+1,r-1,1-col);
	}
	else{
		if(s[b[l]+1]==')')
			cout<<l<<" "<<r<<" !"<<b[l]+1<<endl;
		//if(b[l]+1==')') cout<<l<<" "<<r<<endl;
		solve(l,b[l],col);
		solve(b[l]+1,r,col);
	}
}
int main(){
	mark[0]=-1;
	cin>>n>>s;
	f(i,0,n){
		p+=(s[i]=='(');
		p-=(s[i]==')');
		if(s[i]==')')
			b[i]=mark[p]+1,b[mark[p]+1]=i;
			mark[p]=i;
		//cout<<p<<" ";
	}
	cout<<endl;
	//print(b,n);
	solve(0,n-1,0);
	f(i,0,n) cout<<ans[i];
}


#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define loop(i,a,b) for(int (i) = (a); (i) < (b); (i)++)
#define len(a) (int)a.size()
#define allv(a) (a).begin(),(a).end()
using ll = long long;
using ii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
const double err = 1e-9;
const int mod = 1e9 + 7;
const int N = 2e5 + 10;

bool ans[N];

int main()
{
	ios::sync_with_stdio(0);cin.tie(NULL);

	int n;
	string s;
	cin>>n>>s;

	bool op = true;
	bool cl = true;

	loop(i,0,n)
	{
		if(s[i] == ')')
		{
			ans[i] = cl;
			cl = !cl;
		}
		else
		{
			ans[i] = op;
			op = !op;
		}
	}

	loop(i,0,n)
		cout<<ans[i]<<' ';
	cout<<endl;

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define loop(i,a,b) for(int (i) = (a); (i) < (b); (i)++)
#define len(a) (int)a.size()
#define allv(a) (a).begin(),(a).end()
using ll = long long;
using ii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
const double err = 1e-9;
const int mod = 1e9 + 7;
const int N = 1e5 + 10;

int main()
{
	ios::sync_with_stdio(0);cin.tie(NULL);

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define loop(i,a,b) for(int (i) = (a); (i) < (b); (i)++)
#define len(a) (int)a.size()
#define allv(a) (a).begin(),(a).end()
using ll = long long;
using ii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
const double err = 1e-9;
const int mod = 1e9 + 7;
const int N = 2e5 + 10;

bool ans[N];

int main()
{
	ios::sync_with_stdio(0);cin.tie(NULL);

	int n;
	string s;
	cin>>n>>s;

	bool op = true;
	bool cl = true;

	loop(i,0,n)
	{
		if(s[i] == ')')
		{
			ans[i] = cl;
			cl = !cl;
		}
		else
		{
			ans[i] = op;
			op = !op;
		}
	}

	loop(i,0,n)
		cout<<ans[i];
	cout<<endl;

	return 0;
}


/*************************************************************************
    > File Name: d.cpp
    > Author: Wqr_
    > Mail: xueduanwei@126.com
    > Created Time: 2019年05月16日 星期四 00时04分24秒
 ************************************************************************/

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<queue>
#include<cmath>
using namespace std;
typedef long long ll;
int n;
string in;
bool ans[200200];
bool br = 1;
void dfs(int l, int r){
    if(in[l] == '(' && in[r] == ')'){
        if(in[r + 1] == '('){
            dfs(r + 1, r + 2);
        }
        br = ~br;
        ans[l] = br;
        ans[r] = br;
    }
    else{
        dfs(l, r + 1);
    }
}
int main(){
    cin >> n >> in;
    dfs(0, 1);
    for(int i = 0; i < n; i++){
        cout << ans[i];
    }
    cout << endl;
    return 0;
}


/*************************************************************************
    > File Name: b.cpp
    > Author: Wqr_ddddddddddddddddddd
    > Mail: xueduanwei@126.com
    > Created Time: 2019年05月16日 星期四 10时18分14秒
 ************************************************************************/

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<queue>
#include<cmath>
using namespace std;
typedef long long ll;
int sum12, sum23, sum34, sum45;
int ans[6];
int nums[6] = {4, 8, 15, 16, 23, 42};
int book[6];
int main(){
    cout << "? 1 2" << endl;
    cin >> sum12;
    cout << "? 2 3" << endl;
    cin >> sum23;
    cout << "? 3 4" << endl;
    cin >> sum34;
    cout << "? 4 5" << endl;
    cin >> sum45;
    for(int i = 0; i < 6; i++){
        bool flag = 0;
        for(int j = 0; j < 6; j++){
            if(nums[i] * nums[j] == sum12){
                flag = 1;
                book[i]++;
                book[j]++;
                break;
            }
        }
        if(flag) break;
    }
    for(int i = 0; i < 6; i++){
        bool flag = 0;
        for(int j = 0; j < 6; j++){
            if(nums[i] * nums[j] == sum23){
                flag = 1;
                book[i]++;
                book[j]++;
                break;
            }
        }
        if(flag) break;
    }
    for(int i = 0; i < 6; i++){
        if(book[i] == 2){
            ans[1] = nums[i];
        }
    }
    ans[0] = sum12 / ans[1];
    ans[2] = sum23 / ans[1];
    ans[3] = sum34 / ans[2];
    ans[4] = sum45 / ans[3];
    ans[5] = 4 + 8 + 15 + 16 + 23 + 42 - ans[0] - ans[1] - ans[2] - ans[3] - ans[4];
    cout << "! ";
    for(int i = 0; i < 6; i++){
        cout << ans[i] <<  " ";
    }
    cout << endl;
    return 0;
}


/*************************************************************************
    > File Name: d.cpp
    > Author: Wqr_saaadddddffffffffffffffffffffffffff
    > Mail: xueduanwei@126.com
    > Created Time: 2019年05月16日 星期四 00时04分24秒
 ************************************************************************/

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<queue>
#include<cmath>
using namespace std;
typedef long long ll;
int n;
string in;
bool ans[200200];
bool br = 0;
int minl = 0;
void syn(){
    for(int i = minl; i < n; i++){
        if(in[i] == '('){
            minl = i;
            return ;
        }
    }
}
void dfs(int l, int r){
    if(r >= n || l >= n) return ;
    if(in[l] == '(' && in[r] == ')'){
        if(l == minl) br = !br;
        ans[l] = br;
        ans[r] = br;
        in[l] = '*';
        in[r] = '*';
        /*
        for(int i = 0; i < n; i++)
            cout << ans[i];
        cout << endl;
        cout << in << endl;
        */
        if(in[r + 1] == '(')
            dfs(r + 1, r + 2);
        if(l >= minl){
            syn();
            //cout << minl << endl;
        }
        dfs(l + 1, l + 2);
    }else{
        dfs(l, r + 1);
    }
}
int main(){
    cin >> n >> in;
    dfs(0, 1);
    for(int i = 0; i < n; i++)
        cout << ans[i];
    cout << endl;
    return 0;
}


/*************************************************************************
    > File Name: d.cpp
    > Author: Wqr_
    > Mail: xueduanwei@126.com
    > Created Time: 2019年05月16日 星期四 00时04分24秒
 ************************************************************************/

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<queue>
#include<cmath>
using namespace std;
typedef long long ll;
int n;
string in;
bool ans[200200];
bool br = 0;
int minl = 0;
void syn(){
    for(int i = minl; i < n; i++){
        if(in[i] == '('){
            minl = i;
            return ;
        }
    }
}
void dfs(int l, int r){
    if(r >= n || l >= n) return ;
    if(in[l] == '(' && in[r] == ')'){
        if(l == minl) br = !br;
        ans[l] = br;
        ans[r] = br;
        in[l] = '*';
        in[r] = '*';
        /*
        for(int i = 0; i < n; i++)
            cout << ans[i];
        cout << endl;
        cout << in << endl;
        */
        if(in[r + 1] == '(')
            dfs(r + 1, r + 2);
        if(l >= minl){
            syn();
            //cout << minl << endl;
        }
        dfs(minl, minl + 1);
    }else{
        dfs(l, r + 1);
    }
}
int main(){
    cin >> n >> in;
    dfs(0, 1);
    for(int i = 0; i < n; i++)
        cout << ans[i];
    cout << endl;
    return 0;
}


/*************************************************************************
    > File Name: d.cpp
    > Author: Wqr_
    > Mail: xueduanwei@126.com
    > Created Time: 2019年05月16日 星期四 00时04分24秒
 ************************************************************************/

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<queue>
#include<cmath>
using namespace std;
typedef long long ll;
int n;
string in;
bool ans[200200];
bool br = 0;
int now = 0;
void dfs(int l, int r){
    if(l == now){
        now++;
        br = !br;
    }
    if(r >= n || l >= n) return ;
    if(in[l] == '(' && in[r] == ')'){
        ans[l] = br;
        ans[r] = br;
        in[l] = '*';
        in[r] = '*';
        /*
        for(int i = 0; i < n; i++)
            cout << ans[i];
        cout << endl;
        cout << in << endl;
        */
        if(in[r + 1] == '(')
            dfs(r + 1, r + 2);
        dfs(l + 1, l + 2);
    }else{
        dfs(l, r + 1);
    }
}
int main(){
    cin >> n >> in;
    dfs(0, 1);
    for(int i = 0; i < n; i++)
        cout << ans[i];
    cout << endl;
    return 0;
}


/*************************************************************************
    > File Name: d2.cpp
    > Author: Wqr_
    > Mail: xueduanwei@126.com
    > Created Time: 2019年05月16日 星期四 09时57分33秒
 ************************************************************************/

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<queue>
#include<cmath>
#define MAXN 200100
using namespace std;
typedef long long ll;
int n;
string in;
bool ans[MAXN];
int main(){
    cin >> n >> in;
    bool cr = 0;
    ans[0] = cr;
    for(int i = 1; i < n; i++){
        if(in[i] == in[i - 1]) cr = !cr;
        ans[i] = cr;
    }
    for(int i = 0; i < n; i++){
        cout << ans[i];
    }
    cout << endl;
    return 0;
}


/*************************************************************************
    > File Name: d2.cppsaaaaddf
    > Author: Wqr_
    > Mail: xueduanwei@126.com
    > Created Time: 2019年05月16日 星期四 09时57分33秒
 ************************************************************************/

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<queue>
#include<cmath>
#define MAXN 200100
using namespace std;
typedef long long ll;
int n;
string in;
bool ans[MAXN];
int main(){
    cin >> n >> in;
    bool cr = 0;
    ans[0] = cr;
    for(int i = 1; i < n; i++){
        if(in[i] == in[i - 1]) cr = !cr;
        ans[i] = cr;
    }
    for(int i = 0; i < n; i++){
        cout << ans[i];
    }
    cout << endl;
    return 0;
}


/*************************************************************************
    > File Name: d.cpp
    > Author: Wqr_
    > Mail: xueduanwei@126.com
    > Created Time: 2019年05月16日 星期四 00时04分24秒
 ************************************************************************/

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<queue>
#include<cmath>
using namespace std;
typedef long long ll;
int n;
string in;
bool ans[200200];
bool br = 0;
int minl = 0;
void syn(){
    for(int i = minl; i < n; i++){
        if(in[i] == '('){
            minl = i;
            return ;
        }
    }
}
void dfs(int l, int r){
    if(r >= n || l >= n) return ;
    if(in[l] == '(' && in[r] == ')'){
        if(l == minl) br = !br;
        ans[l] = br;
        ans[r] = br;
        in[l] = '*';
        in[r] = '*';
        /*
        for(int i = 0; i < n; i++)
            cout << ans[i];
        cout << endl;
        cout << in << endl;
        */
        if(in[r + 1] == '(')
            dfs(r + 1, r + 2);
        if(l >= minl){
            syn();
            //cout << minl << endl;
        }
        dfs(l + 1, l + 2);
    }else{
        dfs(l, r + 1);
    }
}
int main(){
    cin >> n >> in;
    dfs(0, 1);
    for(int i = 0; i < n; i++)
        cout << ans[i];
    cout << endl;
    return 0;
}


#include <iostream>
#include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <stack>
using namespace std;
const int maxn = 200005;
char s[maxn];
int main()
{
    int n;
    scanf("%d",&n);
    getchar();
    bool res[maxn];
    int k=0;
    int num=0;
    stack<char> st;
    while(!st.empty())
        st.pop();
    for(int i=1;i<=n;i++)
    {
        s[i]=getchar();
        if(s[i]=='(')
            st.push(s[i]),num=max(num,(int)st.size());
        else st.pop();
    }
    stack<bool> stt;
    while(!stt.empty())
        stt.pop();
    for(int i=1;i<=n;i++)
    {
        if(s[i]=='(')
        {
            k++;
            if(k<=num/2)
                res[i]=1;
            else res[i]=0;
            stt.push(res[i]);
        }
        else
        {
            k--;
            res[i]=stt.top();
            stt.pop();
        }
    }
    for(int i=1;i<=n;i++)
        printf("%d",res[i]);
    printf("\n");
    return 0;
}


#include <iostream>
#include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <stack>
using namespace std;
const int maxn = 20005;
char s[maxn];
int main()
{
    int n;
    scanf("%d",&n);
    getchar();
    int res[maxn];
    int k=0;
    memset(s,0,sizeof(s));
    int num=0;
    stack<char> st;
    while(!st.empty())
        st.pop();
    for(int i=1;i<=n;i++)
    {
        s[i]=getchar();
        if(s[i]=='(')
            st.push(s[i]),num=max(num,(int)st.size());
        else st.pop();
    }
    cout<<num<<endl;
    for(int i=1;i<=n;i++)
    {
        if(s[i]=='(')
        {
            k++;
            if(k<=num/2)
                res[i]=1;
            else res[i]=0;
        }
        else k--;
    }
    stack<int> stt;
    while(!stt.empty())
        stt.pop();
    for(int i=1;i<=n;i++)
    {
        if(s[i]=='(')
            stt.push(res[i]);
        else res[i]=stt.top(),stt.pop();
    }
    for(int i=1;i<=n;i++)
        printf("%d",res[i]);
    printf("\n");
    return 0;
}


#include <iostream>
#include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <stack>
using namespace std;
const int maxn = 20005;
char s[maxn];
int main()
{
    int n;
    scanf("%d",&n);
    getchar();
    int res[maxn];
    int k=0;
    memset(s,0,sizeof(s));
    int num=0;
    stack<char> st;
    while(!st.empty())
        st.pop();
    for(int i=1;i<=n;i++)
    {
        s[i]=getchar();
        if(s[i]=='(')
            st.push(s[i]),num=max(num,(int)st.size());
        else st.pop();
    }
    for(int i=1;i<=n;i++)
    {
        if(s[i]=='(')
        {
            k++;
            if(k<=num/2)
                res[i]=1;
            else res[i]=0;
        }
        else k--;
    }
    stack<int> stt;
    while(!stt.empty())
        stt.pop();
    for(int i=1;i<=n;i++)
    {
        if(s[i]=='(')
            stt.push(res[i]);
        else res[i]=stt.top(),stt.pop();
    }
    for(int i=1;i<=n;i++)
        printf("%d",res[i]);
    printf("\n");
    return 0;
}


#include <iostream>
#include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <stack>
using namespace std;
const int maxn = 20005;
char s[maxn];
int main()
{
    int n;
    scanf("%d",&n);
    getchar();
    int res[maxn];
    int k1=0,k2=0;
    memset(s,0,sizeof(s));
    int num=0;
    stack<char> st;
    for(int i=1;i<=n;i++)
    {
        s[i]=getchar();
        if(s[i]=='(')
            st.push(s[i]),num=max(num,(int)st.size());
        else st.pop();
    }
    for(int i=1;i<=n;i++)
    {
        if(s[i]=='(')
        {
            k2=0;
            if(k1<num/2)
                res[i]=1;
            else res[i]=0;
            k1++;
        }
        else
        {
            k1=0;
            if(k2<num/2)
                res[i]=1;
            else res[i]=0;
            k2++;
        }
    }
    for(int i=1;i<=n;i++)
        printf("%d",res[i]);
    printf("\n");
    return 0;
}


#include <iostream>
#include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <stack>
using namespace std;
const int maxn = 20005;
char s[maxn];
int main()
{
    int n;
    scanf("%d",&n);
    getchar();
    int res[maxn];
    int k=0;
    memset(s,0,sizeof(s));
    int num=0;
    stack<char> st;
    while(!st.empty())
        st.pop();
    for(int i=1;i<=n;i++)
    {
        s[i]=getchar();
        if(s[i]=='(')
            st.push(s[i]),num=max(num,(int)st.size());
        else st.pop();
    }
    stack<int> stt;
    while(!stt.empty())
        stt.pop();
    for(int i=1;i<=n;i++)
    {
        if(s[i]=='(')
        {
            k++;
            if(k<=num/2)
                res[i]=1;
            else res[i]=0;
            stt.push(res[i]);
        }
        else
        {
            k--;
            res[i]=stt.top();
            stt.pop();
        }
    }
    for(int i=1;i<=n;i++)
        printf("%d",res[i]);
    printf("\n");
    return 0;
}


#include <iostream>
#include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <stack>
using namespace std;
const int maxn = 20005;
int main()
{
    int n;
    scanf("%d",&n);
    getchar();
    int res[maxn];
    char temp;
    int k1=0,k2=0;
    int num=n/2;
    num=num/2;
    for(int i=1;i<=n;i++)
    {
        temp = getchar();
        if(temp=='(')
        {
            if(k1<num)
                res[i]=1;
            else res[i]=0;
            k1++;
        }
        else
        {
            if(k2<num)
                res[i]=1;
            else res[i]=0;
            k2++;
        }
    }
    for(int i=1;i<=n;i++)
        printf("%d",res[i]);
    printf("\n");
    return 0;
}


#include <iostream>
#include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <stack>
using namespace std;
const int maxn = 20005;
char s[maxn];
int main()
{
    int n;
    scanf("%d",&n);
    getchar();
    bool res[maxn];
    int k=0;
    int num=0;
    stack<char> st;
    while(!st.empty())
        st.pop();
    for(int i=1;i<=n;i++)
    {
        s[i]=getchar();
        if(s[i]=='(')
            st.push(s[i]),num=max(num,(int)st.size());
        else st.pop();
    }
    stack<bool> stt;
    while(!stt.empty())
        stt.pop();
    for(int i=1;i<=n;i++)
    {
        if(s[i]=='(')
        {
            k++;
            if(k<=num/2)
                res[i]=1;
            else res[i]=0;
            stt.push(res[i]);
        }
        else
        {
            k--;
            res[i]=stt.top();
            stt.pop();
        }
    }
    for(int i=1;i<=n;i++)
        printf("%d",res[i]);
    printf("\n");
    return 0;
}


#include<iostream>
#include<cstring>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#define inf 0x3f3f3f3f
using namespace std;
typedef long long LL;
const int maxn=1e5+10;
int ans[maxn];
int main()
{
    ios::sync_with_stdio(false);
    int n;
    cin>>n;
    string s;
    cin>>s;
    int cnta=0,cntb=0,la=-1,lb=-1;
    for(int i=0;i<n;i++)
    {
        if(s[i]=='(')
        {
            if(la!=0)
            {
                la=0;
                ans[i]=0;
            }
            else if(lb!=0)lb=0,ans[i]=1;
            else
            {
                if(cnta<cntb)cnta++,ans[i]=0;
                else cntb++,ans[i]=1;
            }
        }
        else
        {
            if(la!=1)
            {
                la=1;
                ans[i]=0;
            }
            else if(lb!=1)lb=1,ans[i]=1;
            else
            {
                if(cnta<cntb)cnta++,ans[i]=0;
                else cntb++,ans[i]=1;
            }
        }

    }
    for(int i=0;i<n;i++)cout<<ans[i];
    return 0;
}


#include<iostream>
#include<cstring>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#define inf 0x3f3f3f3f
using namespace std;
typedef long long LL;
const int maxn=1e5+10;
int ans[maxn];
int main()
{
    ios::sync_with_stdio(false);
    int n;
    cin>>n;
    string s;
    cin>>s;
    int cnta=0,cntb=0,la=-1,lb=-1;
    for(int i=0;i<s.length();i++)
    {
        if(s[i]=='(')
        {
            if(la!=0)
            {
                la=0;
                ans[i]=0;
            }
            else if(lb!=0)cntb++,lb=0,ans[i]=1;
            else
            {
                if(cnta>cntb)cnta++,ans[i]=0;
                else cntb++,ans[i]=1;
            }
        }
        else
        {
            if(la!=1)
            {
                la=1;
                ans[i]=0;
            }
            else if(lb!=1)cntb++,lb=1,ans[i]=1;
            else
            {
                if(cnta>cntb)cnta++,ans[i]=0;
                else cntb++,ans[i]=1;
            }
        }

    }
    for(int i=0;i<n;i++)cout<<ans[i];
    return 0;
}


#include<iostream>
#include<cstring>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#define inf 0x3f3f3f3f
using namespace std;
typedef long long LL;
const int maxn=1e5+10;
int ans[maxn];
int main()
{
    ios::sync_with_stdio(false);
    int n;
    cin>>n;
    string s;
    cin>>s;
    int deep=0,t=0;
    memset(ans,0,sizeof(ans));
    for(int i=0;i<n;i++)
    {
        if(s[i]=='(')
        {
            t++;
            deep=max(deep,t);
        }
        else t--;
    }
    deep=(deep+1)/2;
    t=0;
    int la=0,lb=0;
    for(int i=0;i<n;i++)
    {
        if(s[i]=='(')
        {
            t++;
            if(t>deep)lb++,ans[i]=1;
            else la++;
        }
        else
        {
            t--;
            if(t>=deep)ans[i]=1;
        }

    }
    for(int i=0;i<n;i++)cout<<ans[i];
    return 0;
}


#include<iostream>
#include<cstring>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#define inf 0x3f3f3f3f
using namespace std;
typedef long long LL;
const int maxn=1e5+10;
int ans[maxn];
int main()
{
    ios::sync_with_stdio(false);
    int n;
    cin>>n;
    string s;
    cin>>s;
    int cnta=0,cntb=0,la=-1,lb=-1;
    for(int i=0;i<n;i++)
    {
        if(s[i]=='(')
        {
            if(la!=0)
            {
                la=0;
                ans[i]=0;
            }
            else if(lb!=0)cntb++,lb=0,ans[i]=1;
            else
            {
                if(cnta<cntb)cnta++,ans[i]=0;
                else cntb++,ans[i]=1;
            }
        }
        else
        {
            if(la!=1)
            {
                la=1;
                ans[i]=0;
            }
            else if(lb!=1)cntb++,lb=1,ans[i]=1;
            else
            {
                if(cnta<cntb)cnta++,ans[i]=0;
                else cntb++,ans[i]=1;
            }
        }

    }
    for(int i=0;i<n;i++)cout<<ans[i];
    return 0;
}


#include<iostream>
#include<cstring>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#define inf 0x3f3f3f3f
using namespace std;
typedef long long LL;
const int maxn=2e5+10;
int ans[maxn];
int main()
{
    ios::sync_with_stdio(false);
    int n;
    cin>>n;
    string s;
    cin>>s;
    int deep=0,t=0;
    memset(ans,0,sizeof(ans));
    for(int i=0;i<n;i++)
    {
        if(s[i]=='(')
        {
            t++;
            deep=max(deep,t);
        }
        else t--;
    }
    deep=(deep+1)/2;
    t=0;
    int la=0,lb=0;
    for(int i=0;i<n;i++)
    {
        if(s[i]=='(')
        {
            t++;
            if(t>deep)lb++,ans[i]=1;
            else la++;
        }
        else
        {
            t--;
            if(t>=deep)ans[i]=1;
        }

    }
    for(int i=0;i<n;i++)cout<<ans[i];
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn=1e6+10;
const double inf=1e9;
typedef long long ll;
typedef pair<int,int>pr;
const ll mod=998244353;
ll _pow(ll  a,ll b) {
    ll ans=1;
    while(b) {
        if(b&1)
            ans=ans*a%mod;
        a=a*a%mod;
        b>>=1;
    }
    return ans;
}
ll cmp(ll x,ll y){
  return x>y;
}
char s[maxn];
int ans[maxn];
int main(){
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin>>n;
  cin>>(s+1);
  int s1=0,s2=0;
  for(int i=1;i<=n;i++){
    if(s[i]=='('){
      if(s1%2==0){
        s1++;
        ans[i]=1;
        //cout<<"???"<<endl;
      }
      else{
        s2++;
        ans[i]=0;
      }
    }
    else if(s[i]==')'){
      if(s1>=s2){
        s1--;
        ans[i]=1;
        //cout<<"???"<<endl;
      }
      else{
        s2--;
        ans[i]=0;
      }
    }
  }
  for(int i=1;i<=n;i++)
     cout<<ans[i];
  cout<<endl;
  return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn=1e6+10;
const double inf=1e9;
typedef long long ll;
typedef pair<int,int>pr;
const ll mod=998244353;
ll _pow(ll  a,ll b) {
    ll ans=1;
    while(b) {
        if(b&1)
            ans=ans*a%mod;
        a=a*a%mod;
        b>>=1;
    }
    return ans;
}
ll cmp(ll x,ll y){
  return x>y;
}
char s[maxn];
int ans[maxn];
int main(){
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin>>n;
  cin>>(s+1);
  int s1=0,s2=0;
  for(int i=1;i<=n;i++){
    if(s[i]=='('){
      if(s1==s2){
        s1++;
        ans[i]=1;
        //cout<<"???"<<endl;
      }
      else{
        s2++;
        ans[i]=0;
      }
    }
    else if(s[i]==')'){
      if(s1>=s2){
        s1--;
        ans[i]=1;
        //cout<<"???"<<endl;
      }
      else{
        s2--;
        ans[i]=0;
      }
    }
  }
  for(int i=1;i<=n;i++)
     cout<<ans[i];
  cout<<endl;
  return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn=1e6+10;
const double inf=1e9;
typedef long long ll;
typedef pair<int,int>pr;
const ll mod=998244353;
ll _pow(ll  a,ll b) {
    ll ans=1;
    while(b) {
        if(b&1)
            ans=ans*a%mod;
        a=a*a%mod;
        b>>=1;
    }
    return ans;
}
ll cmp(ll x,ll y){
  return x>y;
}
char s[maxn];
int ans[maxn];
int main(){
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  cin>>n;
  cin>>(s+1);
  int s1=0,s2=0,s3=0;
  for(int i=1;i<=n;i++){
    if(s[i]=='('){
      int num=0;
      while(s[i]=='('){
        if(num%2==0) s2++,ans[i]=1;
        else s3++,ans[i]=0;
        i++;
        num++;
      }
      i--;
    }
    else if(s[i]==')'){
      //cout<<i<<" "<<s2<<" "<<s3<<endl;
      if(s2>=s3){
        s2--;
        ans[i]=1;
        //cout<<"???"<<endl;
      }
      else{
        s3--;
        ans[i]=0;
      }
    }
  }
  for(int i=1;i<=n;i++)
     cout<<ans[i];
  cout<<endl;
  return 0;
}


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

int n, K;
int L, R, mid;
int redDepth, blueDepth, nowR, nowB;
string s, ans, output;

int main() {
  cin >> n >> s;
  L = 1, R = n/2;
  for (int i = 0; i < n; i++) ans += '0';
  while (R > L) {
    mid = (L + R) / 2;
    nowR = nowB = 0;
    redDepth = blueDepth = 0;
    for (int i = 0; i < n; i++) {
      if (nowR < mid && s[i] == '(') {
        nowR++;
        ans[i] = '0';
      } else if (nowB && s[i] == ')') {
        nowB--;
        ans[i] = '1';
      } else if (nowR && s[i] == ')') {
        nowR--;
        ans[i] = '0';
      } else if (s[i] == '(') {
        nowB++;
        ans[i] = '1';
      }
      redDepth = max(redDepth, nowR);
      blueDepth = max(blueDepth, nowB);
    }
    if (max(redDepth, blueDepth) > mid) L = mid+1;
    else R = mid;
  }
  K = 12412312;
  for (int j = mid-2; j <= mid+2; j++) {
    for (int i = 0; i < n; i++) {
      if (nowR < mid && s[i] == '(') {
        nowR++;
        ans[i] = '0';
      } else if (nowB && s[i] == ')') {
        nowB--;
        ans[i] = '1';
      } else if (nowR && s[i] == ')') {
        nowR--;
        ans[i] = '0';
      } else if (s[i] == '(') {
        nowB++;
        ans[i] = '1';
      }
      redDepth = max(redDepth, nowR);
      blueDepth = max(blueDepth, nowB);
    }
    if (max(redDepth, blueDepth) < K) {
      output = ans;
      K = max(redDepth, blueDepth);
    }
  }
  cout << output << endl;
}


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

int n;
int L, R, mid;
int redDepth, blueDepth, nowR, nowB;
string s, ans;

int main() {
  cin >> n >> s;
  L = 1, R = n/2;
  for (int i = 0; i < n; i++) ans += '0';
  while (R > L) {
    mid = (L + R) / 2;
    nowR = nowB = 0;
    redDepth = blueDepth = 0;
    for (int i = 0; i < n; i++) {
      if (nowR < mid && s[i] == '(') {
        nowR++;
        ans[i] = '0';
      } else if (nowB && s[i] == ')') {
        nowB--;
        ans[i] = '1';
      } else if (nowR && s[i] == ')') {
        nowR--;
        ans[i] = '0';
      } else if (s[i] == '(') {
        nowB++;
        ans[i] = '1';
      }
      redDepth = max(redDepth, nowR);
      blueDepth = max(blueDepth, nowB);
    }
    if (max(redDepth, blueDepth) > mid) L = mid+1;
    else R = mid;
  }
  for (int i = 0; i < n; i++) {
    if (nowR < mid && s[i] == '(') {
      nowR++;
      ans[i] = '0';
    } else if (nowB && s[i] == ')') {
      nowB--;
      ans[i] = '1';
    } else if (nowR && s[i] == ')') {
      nowR--;
      ans[i] = '0';
    } else if (s[i] == '(') {
      nowB++;
      ans[i] = '1';
    }
    redDepth = max(redDepth, nowR);
    blueDepth = max(blueDepth, nowB);
  }
  cout << ans << endl;
}


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

int n, K;
int L, R, mid;
int redDepth, blueDepth, nowR, nowB;
string s, ans, output;

int main() {
  cin >> n >> s;
  L = 1, R = n/2+1;
  for (int i = 0; i < n; i++) ans += '0';
  while (R > L) {
    mid = (L + R) / 2;
    nowR = nowB = 0;
    redDepth = blueDepth = 0;
    for (int i = 0; i < n; i++) {
      if (nowR < mid && s[i] == '(') {
        nowR++;
        ans[i] = '0';
      } else if (nowB && s[i] == ')') {
        nowB--;
        ans[i] = '1';
      } else if (nowR && s[i] == ')') {
        nowR--;
        ans[i] = '0';
      } else if (s[i] == '(') {
        nowB++;
        ans[i] = '1';
      }
      redDepth = max(redDepth, nowR);
      blueDepth = max(blueDepth, nowB);
    }
    if (max(redDepth, blueDepth) > mid) L = mid+1;
    else R = mid;
  }
  K = 12412312;
  for (int j = max(0, mid-3); j <= min(mid+3, n/2); j++) {
    for (int i = 0; i < n; i++) {
      if (nowR < mid && s[i] == '(') {
        nowR++;
        ans[i] = '0';
      } else if (nowB && s[i] == ')') {
        nowB--;
        ans[i] = '1';
      } else if (nowR && s[i] == ')') {
        nowR--;
        ans[i] = '0';
      } else if (s[i] == '(') {
        nowB++;
        ans[i] = '1';
      }
      redDepth = max(redDepth, nowR);
      blueDepth = max(blueDepth, nowB);
    }
    if (max(redDepth, blueDepth) < K) {
      output = ans;
      K = max(redDepth, blueDepth);
    }
  }
  cout << output << endl;
}


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

int n, K;
int L, R, mid;
int redDepth, blueDepth, nowR, nowB;
string s, ans, output;

int main() {
  cin >> n >> s;
  L = 1, R = n/2;
  for (int i = 0; i < n; i++) ans += '0';
  while (R > L) {
    mid = (L + R) / 2;
    nowR = nowB = 0;
    redDepth = blueDepth = 0;
    for (int i = 0; i < n; i++) {
      if (nowR < mid && s[i] == '(') {
        nowR++;
        ans[i] = '0';
      } else if (nowB && s[i] == ')') {
        nowB--;
        ans[i] = '1';
      } else if (nowR && s[i] == ')') {
        nowR--;
        ans[i] = '0';
      } else if (s[i] == '(') {
        nowB++;
        ans[i] = '1';
      }
      redDepth = max(redDepth, nowR);
      blueDepth = max(blueDepth, nowB);
    }
    if (max(redDepth, blueDepth) > mid) L = mid+1;
    else R = mid;
  }
  K = 12412312;
  for (int j = max(0, mid-3); j <= min(mid+3, n/2); j++) {
    nowR = nowB = 0;
    redDepth = blueDepth = 0;
    for (int i = 0; i < n; i++) {
      if (nowR < j && s[i] == '(') {
        nowR++;
        ans[i] = '0';
      } else if (nowB && s[i] == ')') {
        nowB--;
        ans[i] = '1';
      } else if (nowR && s[i] == ')') {
        nowR--;
        ans[i] = '0';
      } else if (s[i] == '(') {
        nowB++;
        ans[i] = '1';
      }
      redDepth = max(redDepth, nowR);
      blueDepth = max(blueDepth, nowB);
    }
    if (max(redDepth, blueDepth) < K) {
      output = ans;
      K = max(redDepth, blueDepth);
    }
  }
  cout << output << endl;
}


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

int n, K;
int L, R, mid;
int redDepth, blueDepth, nowR, nowB;
string s, ans, output;

int main() {
  cin >> n >> s;
  L = 1, R = n/2;
  for (int i = 0; i < n; i++) ans += '0';
  while (R > L) {
    mid = (L + R) / 2;
    nowR = nowB = 0;
    redDepth = blueDepth = 0;
    for (int i = 0; i < n; i++) {
      if (nowR < mid && s[i] == '(') {
        nowR++;
        ans[i] = '0';
      } else if (nowB && s[i] == ')') {
        nowB--;
        ans[i] = '1';
      } else if (nowR && s[i] == ')') {
        nowR--;
        ans[i] = '0';
      } else if (s[i] == '(') {
        nowB++;
        ans[i] = '1';
      }
      redDepth = max(redDepth, nowR);
      blueDepth = max(blueDepth, nowB);
    }
    if (max(redDepth, blueDepth) > mid) L = mid+1;
    else R = mid;
  }
  K = 12412312;
  for (int j = max(0, mid-3); j <= min(mid+3, n/2); j++) {
    nowR = nowB = 0;
    redDepth = blueDepth = 0;
    for (int i = 0; i < n; i++) {
      if (nowR < mid && s[i] == '(') {
        nowR++;
        ans[i] = '0';
      } else if (nowB && s[i] == ')') {
        nowB--;
        ans[i] = '1';
      } else if (nowR && s[i] == ')') {
        nowR--;
        ans[i] = '0';
      } else if (s[i] == '(') {
        nowB++;
        ans[i] = '1';
      }
      redDepth = max(redDepth, nowR);
      blueDepth = max(blueDepth, nowB);
    }
    if (max(redDepth, blueDepth) < K) {
      output = ans;
      K = max(redDepth, blueDepth);
    }
  }
  cout << output << endl;
}


#include <bits/stdc++.h>

using namespace std;

const int N = 1000 * 100 * 2 + 7;

int ancest[N];
vector <int> ladj[N];
int cor[N];

void dfs(int node){
    int cores[2];
    memset(cores, 0, sizeof cores);
    int filhos = 0;
    for(int neigh : ladj[node]){
        if(neigh == ancest[node])continue;
        dfs(neigh);
        cores[cor[neigh]]++;
        filhos++;
    }

    if(filhos == 0){
        cor[node] = 0;
    }else if(filhos == 1){
        if(cores[0] > 0){
            cor[node] = 1;
        }else{
            cor[node] = 0;
        }
    }else{
        if(cores[0] > cores[1]){
            cor[node] = 1;
        }else{
            cor[node] = 0;
        }
    }
}

int main(){
    int n;
    scanf("%d", &n);
    string s;
    cin >> s;
    int idx = 1;
    int curr = 0;
    ancest[0] = -1;
    for(int i = 1; i < s.size(); i++ ){
        if(s[i] == '('){
            ancest[idx] = curr;
            ladj[curr].push_back(idx);
            ladj[idx].push_back(curr);
            curr = idx;
            idx++;
        }else{
            curr = ancest[curr];
        }
    }
    dfs(0);
    idx = 0;
    for(int i = 0; i < n; i++){
        if(s[i] == '('){
            curr = idx;
            printf("%d", cor[curr]);
            idx++;
        }else{
            printf("%d", cor[curr]);
            curr = ancest[curr];
        }
    }
    printf("\n");
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int N = 1000 * 100 * 2 + 7;

int ancest[N];
vector <int> ladj[N];
int cor[N];

void dfs(int node){
    int cores[2];
    memset(cores, 0, sizeof cores);
    int filhos = 0;
    for(int neigh : ladj[node]){
        if(neigh == ancest[node])continue;
        dfs(neigh);
        cores[cor[neigh]]++;
        filhos++;
    }

    if(filhos == 0){
        cor[node] = 0;
    }else if(filhos == 1){
        if(cores[0] > 0){
            cor[node] = 1;
        }else{
            cor[node] = 0;
        }
    }else{
        if(cores[0] > cores[1]){
            cor[node] = 1;
        }else{
            cor[node] = 0;
        }
    }
}

int main(){
    int n;
    scanf("%d", &n);
    string s;
    cin >> s;
    int idx = 1;
    int curr = 0;
    ancest[0] = -1;
    for(int i = 0; i < s.size(); i++ ){
        if(s[i] == '('){
            ancest[idx] = curr;
            ladj[curr].push_back(idx);
            ladj[idx].push_back(curr);
            curr = idx;
            idx++;
        }else{
            curr = ancest[curr];
        }
    }
    dfs(0);
    idx = 1;
    for(int i = 0; i < n; i++){
        if(s[i] == '('){
            curr = idx;
            printf("%d", cor[curr]);
            idx++;
        }else{
            printf("%d", cor[curr]);
            curr = ancest[curr];
        }
    }
    printf("\n");
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int N = 1000 * 100 * 2 + 7;

int ancest[N];
vector <int> ladj[N];
int cor[N];

void dfs(int node){
    if(node != 0)
        if(cor[ancest[node]] == 1){
            cor[node] = 0;
        }else{
            cor[node] = 1;
        }

    for(int neigh : ladj[node]){
        if(neigh == ancest[node])continue;
        dfs(neigh);
    }
}

int main(){
    int n;
    scanf("%d", &n);
    string s;
    cin >> s;
    int idx = 1;
    int curr = 0;
    ancest[0] = -1;
    cor[0] = 0;
    for(int i = 0; i < s.size(); i++ ){
        if(s[i] == '('){
            ancest[idx] = curr;
            ladj[curr].push_back(idx);
            ladj[idx].push_back(curr);
            curr = idx;
            idx++;
        }else{
            curr = ancest[curr];
        }
    }
    dfs(0);
    idx = 1;
    curr = 0;
    for(int i = 0; i < n; i++){
        if(s[i] == '('){
            curr = idx;
            printf("%d", cor[curr]);
            idx++;
        }else{
            printf("%d", cor[curr]);
            curr = ancest[curr];
        }
    }
    printf("\n");
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=1e6+5;
int n,x,y,ans[N];
char a[N];
/*char buf[1<<21],*p1=buf,*p2=buf;
inline int gc(){return p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++;}*/
#define gc getchar
inline int read()
{
	int ret=0,f=0;char c=gc();
	while(!isdigit(c)){if(c=='-')f=1;c=gc();}
	while(isdigit(c)){ret=ret*10+c-48;c=gc();}
	if(f)return -ret;return ret;
}
int main()
{
	n=read();
	scanf("%s",a+1);
	for(int i=1;i<=n;i++)
	{
		if(a[i]=='(')
		{
			if(x<=y)
			{
				ans[i]=0;
				x++;
			}
			else{
				ans[i]=1;
				y++;
			}
		}
		else{
			if(x<=y)
			{
				ans[i]=1;
				y--;
			}
			else
			{
				ans[i]=0;
				x--;
			}
		}
	}
	for(int i=1;i<=n;i++)printf("%d",ans[i]);
	return 0;
}
/*
20
()((())((()))())(())
00010010100100000110
*/


#include<bits/stdc++.h>
using namespace std;
const int N=1e6+5;
int n,top,x,zhan[N],ans[N];
char a[N];
/*char buf[1<<21],*p1=buf,*p2=buf;
inline int gc(){return p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++;}*/
#define gc getchar
inline int read()
{
	int ret=0,f=0;char c=gc();
	while(!isdigit(c)){if(c=='-')f=1;c=gc();}
	while(isdigit(c)){ret=ret*10+c-48;c=gc();}
	if(f)return -ret;return ret;
}
int main()
{
	n=read();
	scanf("%s",a+1);
	for(int i=1;i<=n;i++)
	{
		if(a[i]=='(')
		{
			if(i>1&&a[i-1]==')')x^=1;
			ans[i]=x;
			zhan[++top]=x;
			x^=1;

		}
		else{
			ans[i]=zhan[top];
			top--;
		}
	}
	for(int i=1;i<=n;i++)printf("%d",ans[i]);
	return 0;
}
/*
20
(())(()()())(())()()
01100
*/


#include<bits/stdc++.h>
using namespace std;
const int N=1e6+5;
int n,top,x,zhan[N],ans[N];
char a[N];
/*char buf[1<<21],*p1=buf,*p2=buf;
inline int gc(){return p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++;}*/
#define gc getchar
inline int read()
{
	int ret=0,f=0;char c=gc();
	while(!isdigit(c)){if(c=='-')f=1;c=gc();}
	while(isdigit(c)){ret=ret*10+c-48;c=gc();}
	if(f)return -ret;return ret;
}
int main()
{
	n=read();
	scanf("%s",a+1);
	for(int i=1;i<=n;i++)
	{
		if(a[i]=='(')
		{
			ans[i]=x;
			zhan[++top]=x;
			x^=1;
		}
		else{
			ans[i]=zhan[top];
			top--;
		}
	}
	for(int i=1;i<=n;i++)printf("%d",ans[i]);
	return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define mod 998244353
using namespace std;
const int maxn = 100000+5;
int n;
string s;
int a[2*maxn];
void solve(){
	int color=0;
	for(int i=0;i<n;i++){
		if(color==0){
           if(s[i]=='('){
            	a[i]=1;
            	color=color^1;
            }
        }
        else{
             if(s[i]=='(')
            	color=color^1;
        }
	}
	color=1;
	for(int i=0;i<n;i++){
		if(color==1){
            if(s[i]==')'){
            	a[i]=1;
            	color=color^1;
            }
        }
        else{
            if(s[i]==')'){
            	color=color^1;
            }
        }
	}
	for(int i=0;i<n;i++){
		cout<<a[i];
	}
}
int main(){
	cin>>n;
	cin>>s;
	solve();
	return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define mod 998244353
using namespace std;
const int maxn = 100000+5;
int n;
string s;
int a[2*maxn];
void solve(){
	int color=0;
	for(int i=0;i<n;i++){
		if(color==1){
            if(s[i]=='(')
            	color=color^1;
        }
        else{
            if(s[i]=='('){
            	a[i]=1;
            	color=color^1;
            }
        }
	}
	color=1;
	for(int i=0;i<n;i++){
		if(color==1){
            if(s[i]=='('){
            	color=color^1;
            }
        }
        else{
            if(s[i]==')'){
            	a[i]=1;
            	color=color^1;
            }
        }
	}
	for(int i=0;i<n;i++){
		cout<<a[i];
	}
}
int main(){
	cin>>n;
	cin>>s;
	solve();
	return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define mod 998244353
using namespace std;
const int maxn = 100000+5;
int n;
string s;
int a[2*maxn];
void solve(){
	int color=1;
	for(int i=0;i<n;i++){
		if(color==1){
            if(s[i]=='('){
            	a[i]=1;color=3-color;
            }
        }
        else{
            if(s[i]=='(')
            	color=3-color;
        }
	}
	color=1;
	for(int i=0;i<n;i++){
		if(color==1){
            if(s[i]==')'){
            	a[i]=1;color=3-color;
            }
        }
        else{
            if(s[i]=='(')
            	color=3-color;
        }
	}
	for(int i=0;i<n;i++){
		if(a[i]==1)
			cout<<1;
		else cout<<0;
	}
}
int main(){
	cin>>n;
	cin>>s;
	solve();
	return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define mod 998244353
using namespace std;
const int maxn = 100000+5;
int n;
string s;
int a[2*maxn];
void solve(){
	int color=0;
	for(int i=0;i<n;i++){
		if(color==1){
            if(s[i]=='(')
            	color=color^1;
        }
        else{
            if(s[i]=='('){
            	a[i]=1;
            	color=color^1;
            }
        }
	}
	color=1;
	for(int i=0;i<n;i++){
		if(color==1){
            if(s[i]==')'){
            	color=color^1;
            }
        }
        else{
            if(s[i]==')'){
            	a[i]=1;
            	color=color^1;
            }
        }
	}
	for(int i=0;i<n;i++){
		cout<<a[i];
	}
}
int main(){
	cin>>n;
	cin>>s;
	solve();
	return 0;
}


#include <cstdio>
#include <algorithm>
using namespace std;
#define N 200005

int n;
char s[N];
int c1; int c2;

int main(){
    scanf("%d",&n);
    scanf("%s",s+1);
    for(int i=1;i<=n;++i){
        if(s[i]=='('){
            ++c1;
            printf("%d",c1&1);
        }
        else{
            ++c2;
            printf("%d",c2&1);
        }
    }
    printf("\n");
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define rg register
const int N=2e5+5;
int n,ans,sum;
char s[N];
int main()
{
    scanf("%d%s",&n,s+1);
    for(rg int i=1;i<=n;++i){
        if(s[i]=='(') ++sum;
        else ans=max(ans,sum),--sum;
    }
    printf("%d",ans+1>>1);
}


#include<bits/stdc++.h>
#define ll long long
#define N 200020
using namespace std;

ll l,r,n,ans[N];
string s;

int main(){
	cin>>n;
	cin>>s;
	for(int i=0;i<n;++i){
		if(s[i]==')')
			if(r>l) --r, ans[i]=0;
			else --l, ans[i]=1;
		else if(s[i]=='(')
			if(r<l) ++r, ans[i]=0;
			else ++l, ans[i]=1;
	}
	for(int i=0;i<n;++i) cout<<ans[i];
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int l, r, a[200001], n;
char t[200001];
int main() {
    cin >> n;
    for (int i = 1; i <= n; i++) {
        scanf("%d", &t[i]);
        if (t[i] == '(') {
            if (l > r) a[i] = 0, r++;
            else a[i] = 1, l++;
        } else {
            if (l < r) a[i] = 0, r--;
            else a[i] = 1, l--;
        }
        printf("%d", a[i]);
    }
    return 0;
}