Given numbers x, y, and target, return whichever of x and y is closer to the target. If they have the same distance, return the smaller of the two.