Finding fractions between given pairs of fractions