KMP
KMP code python