Solution for Walking on Grids