t;char*p,*q;main(f,c){for(q=p;~-f?c--:gets(p=c);p+=*p<49)for(*p*f&&main(0,2),printf("(\n())"+2*f);*q;f=t)t=3-*q%2,*q++=*q+f%3*5+48>>1;}