Optimal Sequential Control