How do you choose between Mexico and Brazil when opening an HQ in Latin America?

Now in a post-pandemic business environment with a mostly work-from-home workforce, companies in North America began opening a business in Mexico and Canada to extend their Talent Pool and take advantage of lower costs.