n=0 for(i in strtoi(charToRaw(scan("stdin",'')))-27){n=n+c(1,-1,0)[i] cat(c('(',')',n)[i])}