solve 2 by python