Generate m of n from a path.