St Forty Martyrs Church in Veliko Tarnovo. Even before then, however, Bulgaria had only acknowledged the overlordship of the sultan formally. Since 1878, Bulgaria had had its constitution, flag, and anthem, and conducted a separate foreign policy. Ferdinand took the Bulgarian title "Tsar" in honor of the rulers of the First and Second Bulgarian Empires. However, while previous Bulgarian "tsars" were reckoned as emperors, Ferdinand and his successors were called "kings" outside Bulgaria. The Tarnovo Constitution was retained, with the word "tsar" replacing the word "prince" or ''knyaz''. The Balkan Wars First Balkan War In 1911 the Nationalist Prime Minister Ivan Geshov set about allying with Greece and Serbia, and the three allies agreed to put aside their rivalries to plan a joint attack on the Ottomans. In February 1912 a secret treaty was signed between Bulgaria and Serbia, which was firstly against Austria-Hungary, but also then redirected by Bulgaria to be against the Ottoman Empire and in May 1912 a similar treaty was signed with Greece. Montenegro was also brought into the pact. The treaties provided for the partition of Macedonia and Thrace between the allies, although the lines of partition were left dangerously vague. After the Ottomans refused to implement reforms in the disputed areas, the First Balkan War broke out in October 1912. The allies had astonishing success. The Bulgarian army inflicted several crushing defeats on the Ottoman forces and advanced threateningly against Constantinople, while the Serbs and the Greeks took control of Macedonia. The Ottomans sued for peace in December. Negotiations broke down, and fighting resumed in February 1913. The Ottomans lost Adrianople to a Bulgarian task force. A second armistice followed in March, with the Ottomans losing all their European possessions west of the Midia-Enos line, not far from Istanbul. Bulgaria gained possession of most of Thrace, including Adrianople and the Aegean port of Dedeagach (today Alexandroupoli). Bulgaria also gained a slice of Macedonia, north and east of Thessaloniki, but only some small areas along her western borders. Second Balkan War Bulgaria sustained the heaviest casualties of any of the allies, and on this basis felt entitled to the largest share of the spoils. The Serbs, in particular, did not see things this way and refused to vacate any of the territories they had seized in northern Macedonia (that is, the territory roughly corresponding to the modern Republic of North Macedonia), stating that the Bulgarian