Notice that the memory limit is non-standard.

Recently Arthur and Sasha have studied correct bracket sequences. Arthur understood this topic perfectly and become so amazed about correct bracket sequences, so he even got himself a favorite correct bracket sequence of length 2n. Unlike Arthur, Sasha understood the topic very badly, and broke Arthur's favorite correct bracket sequence just to spite him.

All Arthur remembers about his favorite sequence is for each opening parenthesis ('(') the approximate distance to the corresponding closing one (')'). For the i-th opening bracket he remembers the segment [li, ri], containing the distance to the corresponding closing bracket.

Formally speaking, for the i-th opening bracket (in order from left to right) we know that the difference of its position and the position of the corresponding closing bracket belongs to the segment [li, ri].

Help Arthur restore his favorite correct bracket sequence!

Input

The first line contains integer n (1 ≤ n ≤ 600), the number of opening brackets in Arthur's favorite correct bracket sequence. 

Next n lines contain numbers li and ri (1 ≤ li ≤ ri < 2n), representing the segment where lies the distance from the i-th opening bracket and the corresponding closing one. 

The descriptions of the segments are given in the order in which the opening brackets occur in Arthur's favorite sequence if we list them from left to right.

Output

If it is possible to restore the correct bracket sequence by the given data, print any possible choice.

If Arthur got something wrong, and there are no sequences corresponding to the given information, print a single line "IMPOSSIBLE" (without the quotes).

Examples

Input

4
1 1
1 1
1 1
1 1


Output

()()()()


Input

3
5 5
3 3
1 1


Output

((()))


Input

3
5 5
3 3
2 2


Output

IMPOSSIBLE


Input

3
2 3
1 4
1 4


Output

(())()
import java.io.*;
import java.util.*;

public class E
{
    private static int [] left;
    private static int [] right;
    private static int MAXLEN;
    private static int [] next;
    private static byte [][] memo;

    public static void main(String[] args) throws Exception
    {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter writer = new PrintWriter(new OutputStreamWriter(System.out));

        int n = Integer.parseInt(reader.readLine());
        MAXLEN = n;

        left = new int[n];
        right = new int[n];
        next = new int[n];

        for(int i = 0 ; i < n ; i++)
        {
            StringTokenizer tokenizer = new StringTokenizer(reader.readLine());

            int l = Integer.parseInt(tokenizer.nextToken());
            int r = Integer.parseInt(tokenizer.nextToken());

            left[i] = l;
            right[i] = r;
        }

        memo = new byte[2*n+1][n];
        boolean res = rec(2*n, 0);
        if(!res)
        {
            writer.println("IMPOSSIBLE");
        }
        else
        {
            construct(2 * n, 0);

            char[] build = new char[2 * n];
            Arrays.fill(build, '-');
            int at = 0;

            for (int i = 0; i < build.length; i++)
            {
                if (build[i] == ')')
                    continue;
                build[i] = '(';
                build[i + next[at]] = ')';
                if(next[at] < left[at] || next[at] > right[at])
                    throw new Exception();

                at++;
            }

            int v = 0;
            for(int i = 0 ; i < build.length ; i++)
            {
                if(build[i] == '(')
                    v++;
                else if(build[i] == ')')
                    v--;
                else
                    throw new Exception();
                if(v < 0)
                    throw new Exception();
            }

            if(v != 0)
                throw new Exception();

            writer.println(new String(build));
        }

        writer.flush();
        writer.close();


    }

    private static void construct(int len, int at)
    {
        if(len == 0)
            return;

        for(int end = left[at] + (1-left[at]%2) ; end <= right[at] && end < len ; end += 2)
        {
            if(rec(end-1, at+1) && rec(len-end-1, at+(end+1)/2))
            {
                next[at] = end;
                construct(end-1, at+1);
                construct(len-end-1, at+(end+1)/2);

                return;
            }
        }
    }

    private static boolean rec(int len, int at)
    {
        if(len == 0)
            return true;
        if(at >= MAXLEN || at < 0)
            return false;

        if(memo[len][at] != 0)
            return memo[len][at] != 1;

        for(int end = left[at] + (1-left[at]%2) ; end <= right[at] && end < len ; end += 2)
        {
            if(rec(end-1, at+1) && rec(len-end-1, at+(end+1)/2))
            {
                memo[len][at] = 2;
                return true;
            }
        }

        memo[len][at] = 1;
        return false;

    }
}