Town A and Town B were located close to each other, and recently merged into one city. Town A had a population with 6% Hispanics. Town B had a population with 12% Hispanics. After the merge, the new city has a total of 4800 residents, with 10.5% Hispanics. How many residents did Town A and Town B used to have?