The pope waved to the crowds as he left the hospital to return to the Vatican, appearing in public for the first time since his admission.