Two trains A and B