solve 7 by py
solve 8 9 by py