#include <bits/stdc++.h>
using namespace std;
#define PII pair <int, int>
PII arr[1205];
string solve (int pos1, int pos2, int a, int b)
// pos1, pos2=positions allowed
// a, b=pairs to be used
{
if (pos1>=pos2) return "";
if (a>b) return "";
int lower=pos1+arr[a].first;
int upper=min(pos2, pos1+arr[a].second);
if (upper<lower) return "";
int start=((lower-1-pos1)&1)?lower+1:lower;
for (int z=start; z<=upper; z+=2)
{
int l=(z-1-pos1)/2;
string first=solve(pos1+1,z-1, a+1, a+l);
string second=solve(z+1, pos2, a+l+1, b);
if (pos2-pos1+1==first.length()+second.length()+2) return '('+first+')'+second;
}
return "";
}
main()
{
int a;scanf("%d", &a);
for (int g=0; g<a; g++)
{
int b,c; scanf("%d %d", &b, &c);
arr[g+1]=PII(b,c);
}
string l= solve(1, 2*a, 1, a);
if (2*a!=l.length()){cout << "IMPOSSIBLE"; return 0;}
cout << l;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7IAojZGVmaW5lIFBJSSBwYWlyIDxpbnQsIGludD4gClBJSSBhcnJbMTIwNV07IApzdHJpbmcgc29sdmUgKGludCBwb3MxLCBpbnQgcG9zMiwgaW50IGEsIGludCBiKSAKLy8gcG9zMSwgcG9zMj1wb3NpdGlvbnMgYWxsb3dlZAovLyBhLCBiPXBhaXJzIHRvIGJlIHVzZWQKewogICAgaWYgKHBvczE+PXBvczIpIHJldHVybiAiIjsgCiAgICBpZiAoYT5iKSByZXR1cm4gIiI7IAogICAgaW50IGxvd2VyPXBvczErYXJyW2FdLmZpcnN0OwogICAgaW50IHVwcGVyPW1pbihwb3MyLCBwb3MxK2FyclthXS5zZWNvbmQpOyAKICAgIGlmICh1cHBlcjxsb3dlcikgcmV0dXJuICIiOwogICAgaW50IHN0YXJ0PSgobG93ZXItMS1wb3MxKSYxKT9sb3dlcisxOmxvd2VyOyAKICAgIGZvciAoaW50IHo9c3RhcnQ7IHo8PXVwcGVyOyB6Kz0y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