shortest distance by knight in python