Write A Python Program To Implement Ao Algorithm