6 Wendi (文昌王) and Wudi (武帝)
Though mystical beings in their own right, this pair is best known for being the deities of civil and martial affairs. Wenchang Wang (文昌王; man4 coeng1 wong4), Wenchang Dijun (文昌帝君; man4 coeng1 dai3 gwan1), or simply Wendi (文帝; man4 dai3), is the deity of culture and literature. There is disparity as to who he was or where he might have lived, but legends agree that during his mortal life, Wendi was a scholar-bureaucrat who was uncorrupted, righteous, and just, blessing his jurisdictions with peace and stability. The Jade Emperor thus put him in charge of the elections of village elders.
The contrasting figure to Wendi is Wudi (武帝; mou5 dai3), also known as Guandi (關帝; gwaan1 dai3) or Guangong (關公; gwaan1 gung1), the deity of military and martial affairs. Non-scholars might better know him as Guanyu (關羽; gwaan1 jyu5), a military warlord during the Eastern Han dynasty. His war accomplishments and exploits with his sworn brothers Liu Bei and Zhang Fei have been widely popularised by the fourteenth-century historical novel Romance of the Three Kingdoms. A widely glorified fighter who was both loyal and righteous, Wudi is still worshipped by many today, particularly by those whose line of work involves fighting.
Together, these two patron deities of civil and martial affairs are known as Wen Wu (文武)—or Man Mo in Cantonese. During the Ming and Qing dynasties, those seeking success in the imperial examinations, which were divided into civil and military components, would patronise Man Mo temples to pray to the appropriate deity for blessings. To this day, civil servants or hopeful students make offerings to Wendi, while policemen venerate Wudi. In Hong Kong, there are three Ma Mo temples, in Tai Po, Mui Wo, and most famously in Sheung Wan.