python program to solve the app Block x3