Sounds insane. Are your flights booked already? If not, post the cities and I'm sure a better option could be found.
I assume you do not hold a passport from HK, Macau or China? You should try to run off the boat first to get to the immigration lines quick in both HK and Macau.