Tag - dynamic programming python