poj 2955. DP. String. Brackets.