Weixing, or "surname guessing," was a highly organized lottery practice in China wherein money was bet on the surnames of which candidates would pass the civil and military examinations. For centuries, up until 1905, the examination system was the primary means by which the Chinese state selected new officials from all over the empire and a way for commoners to climb the social ladder.