The correct sequence, moving from west to east, is Gandhara (E), Matsya (D), Koshala (A), Magadha (C), and Anga (B). This arrangement reflects the geographical and strategic locations of the Mahajanapadas, with Gandhara in the northwest and Anga in the east. Each of these kingdoms played a key role in the political and cultural landscape of ancient India.