Guinea are through to the quarter-finals of the Africa Cup of Nations after the drawing of lots in Malabo.