Implement lattice paths.