Armenian culture and civilization flourished in the early medieval Nagorno-Karabakh. In the 5th century, the first-ever Armenian school was opened on the territory of modern Nagorno-Karabakh—at the Amaras Monastery—by the efforts of St. Mesrop Mashtots, the inventor of the Armenian alphabet. St. Mesrop was very active in preaching the Gospel in Artsakh and Utik. Overall, Mesrop Mashtots made three trips to Artsakh and Utik, ultimately reaching pagan territories at the foothills of the Greater Caucasus. The 7th-century Armenian linguist and grammarian Stephanos Syunetsi stated in his work that Armenians of Artsakh had their own dialect, and encouraged his readers to learn it. In the same 7th century, Armenian poet Davtak Kertogh writes his "Elegy on the Death of Grand Prince Juansher", where each passage begins with a letter of Armenian script in alphabetical order. The only comprehensive history of Caucasian Albania was written in Armenian, by the 10th-century historian Movses Kaghankatvatsi.