Modified coordinate system and takes input. Prints distance.