A and B as shown in the figure