Question: Where was the capital before the city where the Temple of Literature is located?

full_context: Document 1: Geography of Vietnam: Vietnam is located on the eastern margin of the Indochinese peninsula and occupies about 331,211.6 square kilometers, of which about 25% was under cultivation in 1987. It borders the Gulf of Thailand, Gulf of Tonkin, and Pacific Sea, alongside China, Laos, and Cambodia. The S - shaped country has a north - to - south distance of 1,650 kilometers and is about 50 kilometers wide at the narrowest point. With a coastline of 3,260 kilometers, excluding islands, Vietnam claims 12 nautical miles (22.2 km; 13.8 mi) as the limit of its territorial waters, an additional 12 nautical miles (22.2 km; 13.8 mi) as a contiguous customs and security zone, and 200 nautical miles (370.4 km; 230.2 mi) as an exclusive economic zone.
Document 2: Yuan dynasty: Due to the fact that the bureaucracy was dominated by El Temür, Tugh Temür is known for his cultural contribution instead. He adopted many measures honoring Confucianism and promoting Chinese cultural values. His most concrete effort to patronize Chinese learning was founding the Academy of the Pavilion of the Star of Literature (Chinese: 奎章閣學士院), first established in the spring of 1329 and designed to undertake "a number of tasks relating to the transmission of Confucian high culture to the Mongolian imperial establishment". The academy was responsible for compiling and publishing a number of books, but its most important achievement was its compilation of a vast institutional compendium named Jingshi Dadian (Chinese: 經世大典). Tugh Temür supported Zhu Xi's Neo-Confucianism and also devoted himself in Buddhism.
Document 3: Nanjing: Being one of the four ancient capitals of China, Nanjing has always been a cultural centre attracting intellectuals from all over the country. In the Tang and Song dynasties, Nanjing was a place where poets gathered and composed poems reminiscent of its luxurious past; during the Ming and Qing dynasties, the city was the official imperial examination centre (Jiangnan Examination Hall) for the Jiangnan region, again acting as a hub where different thoughts and opinions converged and thrived.
Document 4: Temple of Literature, Hanoi: The Temple of Literature or Temple of Culture (Vietnamese: "Văn Miếu", Hán-Nôm: 文廟)) is a Temple of Confucius in Hanoi, northern Vietnam. The temple hosts the Imperial Academy (, ), Vietnam's first national university. The temple was built in 1070 at the time of Emperor Lý Thánh Tông. It is one of several temples in Vietnam which is dedicated to Confucius, sages and scholars. The temple is located to the south of the Imperial Citadel of Thăng Long. The various pavilions, halls, statues and stelae of doctors are places where offering ceremonies, study sessions and the strict exams of the Đại Việt took place. The temple is featured on the back of the 100,000 Vietnamese đồng banknote. Just before the Vietnamese New Year celebration Tết, calligraphists will assemble outside the temple and write wishes in Hán characters. The art works are given away as gifts or are used as home decorations for special occasions.
Document 5: Quốc Học – Huế High School for the Gifted: Quốc Học – Huế High School for the Gifted or simply ""the Quốc Học of Huế"" is a national magnet and gifted high school in Thừa Thiên–Huế, Vietnam. Founded on October 23, 1896, Quốc Học - Huế is the second oldest high school in Vietnam. The school is recognized for its strong academic results, students' qualities and staffs' levels. For a long time, Quốc Học – Huế has always been ranked in the top three high schools in the nation in terms of the quality of education. Other schools include Chu Van An High School in Hanoi and Lê Hồng Phong High School in Ho Chi Minh City. The school is also famous for the notable political leaders who graduated from it, and Ho Chi Minh who was dismissed from it in 1908 for revolutionary activities.
Document 6: Chu Văn An High School (Ho Chi Minh City): Chu Van An High School is a high school in Sai Gon, Vietnam. The school is located at the intersection of Ngo Gia Tu Blvd. (formerly Minh Mang Blvd.) and Ngo Quyen St. (formerly Trieu Da St.), District 5, Ho Chi Minh City. Originally, the school was founded by teachers and students of Buoi High School who moved to Saigon from the north following the 1954 Geneva Conference. After a time of operation under the sponsorship of Petrus Ky High School, these people built a new high school at Minh Mang St. in 1961 and named it after Chu Van An, a famous Vietnamese Confucianism teacher of Tran Dynasty. After the end of the Vietnam War in 1975, the school continued operating under this name. In 1978, the school was dissolved and its students were transferred into nearby high schools. The school's building was transferred to a new school named Huấn Nghệ Phổ thông Lao động School ("Training of General Labor Skills School"). Later, the school was revived by the end of the 1990s under a new education program.
Document 7: Quốc Ân Temple: In the main hall is a banner, containing a verse of praise of the temple and its founder, written by Nguyễn Phúc Chu, one of the Nguyễn lords who once ruled central and southern Vietnam and the city of Huế. The temple is situated on a small hill in the ward of Trường An in the city of Huế. It is located about from the Phú Cam bridge that spans the Perfume River, which passes through Huế.
Document 8: France–Vietnam relations: French -- Vietnamese relations started as early as the 17th century with the mission of the Jesuit father Alexandre de Rhodes. Various traders would visit Vietnam during the 18th century, until the major involvement of French forces under Pigneau de Béhaine from 1787 to 1789 helped establish the Nguyễn Dynasty. France was heavily involved in Vietnam in the 19th century under the pretext of protecting the work of Catholic missionaries in the country. France progressively carved for itself a huge colony, which would form French Indochina in 1887. France continued to rule Vietnam as a colony until France's defeat in the First Indochina War and the proclamation of Vietnam's independence in 1954.
Document 9: Cố Trạch Temple: The Trần Temple of Nam Định (Đền Trần, Nam Định) is a temple complex of which the more recent middle section is dedicated to national hero Hưng Đạo Đại Vương (Prince Trần Quốc Tuấn) in Nam Định, Vietnam.
Document 10: Ho Chi Minh City: Ho Chi Minh City Thành phố Hồ Chí Minh Saigon or Sài Gòn Municipality Thành phố trực thuộc trung ương Clockwise, from left to right: Bến Thành Market, Ho Chi Minh City Hall, District 1 view from Saigon river, Municipal Theatre, Notre - Dame Cathedral Basilica of Saigon, Independence Palace Seal Nickname (s): Pearl of the Far East Location in Vietnam and Southern Vietnam Coordinates: 10 ° 46 ′ 36.8 ''N 106 ° 42 ′ 02.9'' E ﻿ / ﻿ 10.776889 ° N 106.700806 ° E ﻿ / 10.776889; 106.700806 Coordinates: 10 ° 46 ′ 36.8 ''N 106 ° 42 ′ 02.9'' E ﻿ / ﻿ 10.776889 ° N 106.700806 ° E ﻿ / 10.776889; 106.700806 Country Vietnam Central district District 1 Founded as Gia Định 1698 Renamed to Ho Chi Minh City 1976 Founded by Nguyễn Hữu Cảnh Divisions 19 Urban districts, 5 Suburban districts Government Type Special - class Secretary of Communist Party Nguyễn Thiện Nhân Chairman of People's Committee Nguyễn Thành Phong Chairman of People's Council Nguyễn Thị Quyết Tâm Area Total 2,096.56 km (809.23 sq mi) Elevation 19 m (63 ft) Population (2016) Total 8,426,100 Rank 1st Density 4,000 / km (10,000 / sq mi) GDP (PPP) (2015 estimate) Total US $127.8 billion Per capita US $15,977 GRDP (nominal) (2016) Total US $45.73 billion Per capita US $5,428 Time zone ICT (UTC + 07: 00) Area codes 8 (until 16 Jul 2017) 28 (from 17 Jun 2017) Website hochiminhcity.gov.vn
Document 11: North Vietnam: After about 300 years of partition by feudal dynasties, Vietnam was again under one single authority in 1802 when Gia Long founded the Nguyễn dynasty, but the country became a French protectorate after 1883 and under Japanese occupation after 1940 during World War II. Soon after Japan surrendered on September 2, 1945, the Việt Minh in the August Revolution entered Hanoi, and the Democratic Republic of Vietnam was proclaimed on September 2, 1945: a government for the entire country, replacing the Nguyễn dynasty. Hồ Chí Minh became leader of the Democratic Republic of Vietnam. U.S. President Franklin Roosevelt had spoken against French rule in Indochina, and U.S.A. was supportive of the Viet Minh at this time.
Document 12: Paris: The Pagode de Vincennes Buddhist temple, near Lake Daumesnil in the Bois de Vincennes, is the former Cameroon pavilion from the 1931 Paris Colonial Exposition. It hosts several different schools of Buddhism, and does not have a single leader. It shelters the biggest Buddha statue in Europe, more than nine metres high. There are two other small temples located in the Asian community in the 13th arrondissement. A Hindu temple, dedicated to Ganesh, on Rue Pajol in the 18th arrondissement, opened in 1985.
Document 13: Auguste Henri Vildieu: Auguste Henri Vildieu was the French architectural adjutant in Hanoi while that city was an administrative center for the French colony of Indochina. Vildieu constructed several grand European-style buildings for the colonial government, including:
Document 14: French Indochina: A grouping of the three Vietnamese regions of Tonkin (north), Annam (centre), and Cochinchina (south) with Cambodia was formed in 1887. Laos was added in 1893 and the leased Chinese territory of Guangzhouwan in 1898. The capital was moved from Saigon (in Cochinchina) to Hanoi (Tonkin) in 1902 and again to Da Lat (Annam) in 1939. In 1945 it was moved back to Hanoi.
Document 15: History of Vietnam: After Quang Trung's death, the Tây Sơn dynasty became unstable as the remaining brothers fought against each other and against the people who were loyal to Nguyễn Huệ's infant son. Nguyễn Ánh sailed north in 1799, capturing Tây Sơn's stronghold Qui Nhơn. In 1801, his force took Phú Xuân, the Tây Sơn capital. Nguyễn Ánh finally won the war in 1802, when he sieged Thăng Long (Hanoi) and executed Nguyễn Huệ's son, Nguyễn Quang Toản, along with many Tây Sơn generals and officials. Nguyễn Ánh ascended the throne and called himself Emperor Gia Long. Gia is for Gia Định, the old name of Saigon; Long is for Thăng Long, the old name of Hanoi. Hence Gia Long implied the unification of the country. The Nguyễn dynasty lasted until Bảo Đại's abdication in 1945. As China for centuries had referred to Đại Việt as Annam, Gia Long asked the Manchu Qing emperor to rename the country, from Annam to Nam Việt. To prevent any confusion of Gia Long's kingdom with Triệu Đà's ancient kingdom, the Manchu emperor reversed the order of the two words to Việt Nam. The name Vietnam is thus known to be used since Emperor Gia Long's reign. Recently historians have found that this name had existed in older books in which Vietnamese referred to their country as Vietnam.
ground_truth: Saigon
sub_queries: Temple of Literature >> located in the administrative territorial entity Answer: Hanoi
Where was the capital before Hanoi ? Answer: Saigon