Both leaders came to power at the head of army officers angered by failures to roll back Islamists linked to Al-Qaeda an