Match the names in A and the categories in B: