candidate: The Slavic , Avar , Bulgarian and Magyar invasions in the 6-7th centuries devastated both provinces with only parts of Macedonia Prima in the coastal areas and nearer Thrace remaining in Byzantine hands , while most of the hinterland was disputed between the Byzantium and Bulgaria .