Accepted version of WordBreakII