solve 4 by py