Question: What position was held by the defeater of the last Song emperor of the country Liang Ji was in?

full_context: Document 1: Liang Ji: Liang Ji (梁冀) (died 159), courtesy name Bozhuo (伯卓), was a politician and military commander of Han Dynasty China. As a powerful consort kin, he dominated government in the 150s together with his sister, Empress Liang Na. After his sister's death, Liang Ji was overthrown in a coup d'etat by Emperor Huan, with the support of the eunuch faction, in 159. The Liang clan and the clan of his wife, Sun Shou (孫壽), were slaughtered.
Document 2: Ji Ru: Ji Ru () was a trusted personal servant of Emperor Gaozu, the founder of China's Han Dynasty. Louis Crompton claims that Ji Ru was Gaozu's pillow companion, or homosexual lover, and that Ji Ru had more access to the emperor than did ministers. Ji Ru was documented by Sima Qian in the "Records of the Grand Historian":
Document 3: Yuan dynasty: After strengthening his government in northern China, Kublai pursued an expansionist policy in line with the tradition of Mongol and Chinese imperialism. He renewed a massive drive against the Song dynasty to the south. Kublai besieged Xiangyang between 1268 and 1273, the last obstacle in his way to capture the rich Yangzi River basin. An unsuccessful naval expedition was undertaken against Japan in 1274. Kublai captured the Song capital of Hangzhou in 1276, the wealthiest city of China. Song loyalists escaped from the capital and enthroned a young child as Emperor Bing of Song. The Mongols defeated the loyalists at the battle of Yamen in 1279. The last Song emperor drowned, bringing an end to the Song dynasty. The conquest of the Song reunited northern and southern China for the first time in three hundred years.
Document 4: Han dynasty: General Dong Zhuo (d. 192 AD) found the young emperor and his brother wandering in the countryside. He escorted them safely back to the capital and was made Minister of Works, taking control of Luoyang and forcing Yuan Shao to flee. After Dong Zhuo demoted Emperor Shao and promoted his brother Liu Xie as Emperor Xian, Yuan Shao led a coalition of former officials and officers against Dong, who burned Luoyang to the ground and resettled the court at Chang'an in May 191 AD. Dong Zhuo later poisoned Emperor Shao.
Document 5: Yuan dynasty: Kublai readied the move of the Mongol capital from Karakorum in Mongolia to Khanbaliq in 1264, constructing a new city near the former Jurchen capital Zhongdu, now modern Beijing, in 1266. In 1271, Kublai formally claimed the Mandate of Heaven and declared that 1272 was the first year of the Great Yuan (Chinese: 大元) in the style of a traditional Chinese dynasty. The name of the dynasty originated from the I Ching and describes the "origin of the universe" or a "primal force". Kublai proclaimed Khanbaliq the "Great Capital" or Daidu (Dadu, Chinese: 大都 in Chinese) of the dynasty. The era name was changed to Zhiyuan to herald a new era of Chinese history. The adoption of a dynastic name legitimized Mongol rule by integrating the government into the narrative of traditional Chinese political succession. Khublai evoked his public image as a sage emperor by following the rituals of Confucian propriety and ancestor veneration, while simultaneously retaining his roots as a leader from the steppes.
Document 6: Great Divergence: During the Song Dynasty (960 -- 1279), the country experienced a revolution in agriculture, water transport, finance, urbanization, science and technology, which made the Chinese economy the most advanced in the world from about 1100. Mastery of wet - field rice cultivation opened up the hitherto underdeveloped south of the country, while later northern China was devastated by Jur'chen and Mongol invasions, floods and epidemics. The result was a dramatic shift in the center of population and industry from the home of Chinese civilization around the Yellow River to the south of the country, a trend only partially reversed by the re-population of the north from the 15th century. By 1300, China had fallen behind Italy in living standards.
Document 7: Han dynasty: When Empress Dowager Deng died, Emperor An (r. 106–125 AD) was convinced by the accusations of the eunuchs Li Run (李閏) and Jiang Jing (江京) that Deng and her family had planned to depose him. An dismissed Deng's clan members from office, exiled them and forced many to commit suicide. After An's death, his wife, Empress Dowager Yan (d. 126 AD) placed the child Marquess of Beixiang on the throne in an attempt to retain power within her family. However, palace eunuch Sun Cheng (d. 132 AD) masterminded a successful overthrow of her regime to enthrone Emperor Shun of Han (r. 125–144 AD). Yan was placed under house arrest, her relatives were either killed or exiled, and her eunuch allies were slaughtered. The regent Liang Ji (d. 159 AD), brother of Empress Liang Na (d. 150 AD), had the brother-in-law of Consort Deng Mengnü (later empress) (d. 165 AD) killed after Deng Mengnü resisted Liang Ji's attempts to control her. Afterward, Emperor Huan employed eunuchs to depose Liang Ji, who was then forced to commit suicide.
Document 8: Sino-Tibetan relations during the Ming dynasty: The Columbia Encyclopedia distinguishes between the Yuan dynasty and the other Mongol Empire khanates of Ilkhanate, Chagatai Khanate and the Golden Horde. It describes the Yuan dynasty as "A Mongol dynasty of China that ruled from 1271 to 1368, and a division of the great empire conquered by the Mongols. Founded by Kublai Khan, who adopted the Chinese dynastic name of Yüan in 1271." The Encyclopedia Americana describes the Yuan dynasty as "the line of Mongol rulers in China" and adds that the Mongols "proclaimed a Chinese-style Yüan dynasty at Khanbaliq (Beijing)." The Metropolitan Museum of Art writes that the Mongol rulers of the Yuan dynasty "adopted Chinese political and cultural models; ruling from their capitals in Dadu, they assumed the role of Chinese emperors," although Tibetologist Thomas Laird dismissed the Yuan dynasty as a non-Chinese polity and plays down its Chinese characteristics. The Metropolitan Museum of Art also noted that in spite of the gradual assimilation of Yuan monarchs, the Mongol rulers largely ignored the literati and imposed harsh policies discriminating against southern Chinese. In his Kublai Khan: His Life and Times, Rossabi explains that Kublai "created government institutions that either resembled or were the same as the traditional Chinese ones", and he "wished to signal to the Chinese that he intended to adopt the trappings and style of a Chinese ruler".
Document 9: Jingnan: The Song Dynasty was formed in 960, ending the Five Dynasties period in the north, and though that is the date traditionally used to denote the end of the Five Dynasties and Ten Kingdoms period, many kingdoms in the south maintained their independence for nearly two decades after the rise of the Song Dynasty. However, due to its size and location, Jingnan was the first of the kingdoms to succumb to the Song Dynasty, surrendering when armies from the north invaded in 963, ending the kingdom.
Document 10: Kublai Khan: Kublai (; ; ) was the fifth Khagan (Great Khan) of the Mongol Empire ("Ikh Mongol Uls"), reigning from 1260 to 1294 (although due to the division of the empire this was a nominal position). He also founded the Yuan dynasty in China as a conquest dynasty in 1271, and ruled as the first Yuan emperor until his death in 1294.
Document 11: Yuan dynasty: The Yuan dynasty (Chinese: 元朝; pinyin: Yuán Cháo), officially the Great Yuan (Chinese: 大元; pinyin: Dà Yuán; Mongolian: Yehe Yuan Ulus[a]), was the empire or ruling dynasty of China established by Kublai Khan, leader of the Mongolian Borjigin clan. Although the Mongols had ruled territories including today's North China for decades, it was not until 1271 that Kublai Khan officially proclaimed the dynasty in the traditional Chinese style. His realm was, by this point, isolated from the other khanates and controlled most of present-day China and its surrounding areas, including modern Mongolia and Korea. It was the first foreign dynasty to rule all of China and lasted until 1368, after which its Genghisid rulers returned to their Mongolian homeland and continued to rule the Northern Yuan dynasty. Some of the Mongolian Emperors of the Yuan mastered the Chinese language, while others only used their native language (i.e. Mongolian) and the 'Phags-pa script.
Document 12: Yuan dynasty: The Yuan dynasty is considered both a successor to the Mongol Empire and an imperial Chinese dynasty. It was the khanate ruled by the successors of Möngke Khan after the division of the Mongol Empire. In official Chinese histories, the Yuan dynasty bore the Mandate of Heaven, following the Song dynasty and preceding the Ming dynasty. The dynasty was established by Kublai Khan, yet he placed his grandfather Genghis Khan on the imperial records as the official founder of the dynasty as Taizu.[b] In the Proclamation of the Dynastic Name (《建國號詔》), Kublai announced the name of the new dynasty as Great Yuan and claimed the succession of former Chinese dynasties from the Three Sovereigns and Five Emperors to the Tang dynasty.
Document 13: Song dynasty: The Song dynasty (Chinese: 宋朝; pinyin: Sòng cháo; 960 -- 1279) was an era of Chinese history that began in 960 and continued until 1279. It was founded by Emperor Taizu of Song following his usurpation of the throne of Later Zhou, ending the Five Dynasties and Ten Kingdoms period. The Song often came into conflict with the contemporary Liao and Western Xia dynasties in the north and was conquered by the Mongol - led Yuan dynasty. The Song government was the first in world history to issue banknotes or true paper money nationally and the first Chinese government to establish a permanent standing navy. This dynasty also saw the first known use of gunpowder, as well as the first discernment of true north using a compass.
Document 14: Song dynasty: The Song dynasty is divided into two distinct periods, Northern and Southern. During the Northern Song (Chinese: 北宋; 960 -- 1127), the Song capital was in the northern city of Bianjing (now Kaifeng) and the dynasty controlled most of what is now Eastern China. The Southern Song (Chinese: 南宋; 1127 -- 1279) refers to the period after the Song lost control of its northern half to the Jurchen Jin dynasty in the Jin -- Song Wars. During this time, the Song court retreated south of the Yangtze and established its capital at Lin'an (now Hangzhou). Although the Song dynasty had lost control of the traditional ``birthplace of Chinese civilization ''along the Yellow River, the Song economy was still strong, as the Southern Song Empire contained a large population and productive agricultural land. The Southern Song dynasty considerably bolstered its naval strength to defend its waters and land borders and to conduct maritime missions abroad. To repel the Jin, and later the Mongols, the Song developed revolutionary new military technology augmented by the use of gunpowder. In 1234, the Jin dynasty was conquered by the Mongols, who took control of northern China, maintaining uneasy relations with the Southern Song. Möngke Khan, the fourth Great Khan of the Mongol Empire, died in 1259 while besieging the city of Chongqing. His younger brother Kublai Khan was proclaimed the new Great Khan, though his claim was only partially recognized by the Mongols in the west. In 1271, Kublai Khan was proclaimed the Emperor of China. After two decades of sporadic warfare, Kublai Khan's armies conquered the Song dynasty in 1279. The Mongol invasion led to a reunification under the Yuan dynasty (1271 -- 1368).
Document 15: Han dynasty: Emperor Zhang's (r. 75–88 AD) reign came to be viewed by later Eastern Han scholars as the high point of the dynastic house. Subsequent reigns were increasingly marked by eunuch intervention in court politics and their involvement in the violent power struggles of the imperial consort clans. With the aid of the eunuch Zheng Zhong (d. 107 AD), Emperor He (r. 88–105 AD) had Empress Dowager Dou (d. 97 AD) put under house arrest and her clan stripped of power. This was in revenge for Dou's purging of the clan of his natural mother—Consort Liang—and then concealing her identity from him. After Emperor He's death, his wife Empress Deng Sui (d. 121 AD) managed state affairs as the regent empress dowager during a turbulent financial crisis and widespread Qiang rebellion that lasted from 107 to 118 AD.
ground_truth: Khagan
sub_queries: Which country was Liang Ji in? Answer: China
who defeated the last song emperor of China Answer: Kublai Khan
Kublai Khan >> position held Answer: Khagan