text: A is a pandas dataframe. A has columns of "X" and "Y". "X" and "Y" are integer. B is pandas dataframe. B has columns of "W" and "Z". "W" is integer. How to join A to B where "W" is between "X" and "Y"? Please think step-by-step. For each step, please test that your code works by testing it for concrete example.