The pre-Qin theories of the three unities 三統說 and the cycle of five virtues 五德終始 說 continued to play a major role in the definition of political legitimacy. Although the Song saw itself throughout as ruling by virtue of fire, this did not preclude major debates on alternatives. The Jin hesitated between metal and earth and eventually settled for the latter, while the Yuan opted for water. Claims to the Heavenly Mandate were also based on “being in accord with Heaven’s intentions,” on legends of the divine origins of dynastic founders, and on the regular practice of the sacrifices to Heaven and the ancestors—sacrifices which also required ongoing research and redefinition. Shamanesses performed the Liao sacrifice on Mount Muye, where the temple of the Khitan’s first ancestor was located. The Song, Jin, and Yuan also sacrificed to the gods of earth and grains, to the gods of sacred mountains and rivers, and to Confucius. The Yuan added a sacrifice to the three sovereigns, Fuxi, Shennong, and Huangdi.