AC. DP solution.