Input (grade 13): Hannibal occupied much of Italy for 15 years, however a Roman counter-invasion of North Africa forced Hannibal to return to Carthage, where he was decisively defeated by Scipio Africanus at the Battle of Zama.
Output (grade 5): A Roman invasion of North Africa made him return to Carthage.