Any one please help how to solve this problem.

### SPOJ.com - Problem SQRBR

...

I read the explanation here http://www.quora.com/Can-some-one-explain-how-to-solve-square-brackets-problem-on-spoj-SPOJ-SQRBR but i was not able to understand any one help me .Thanks :)