Mali and Guinea will have to be separated by the drawing of lots after the two teams finished level in second place in Group D of the African Cup of Nations.