D - Least Cost Bracket Sequence