
nexts = [0]*100
x = '<img class="ui image bqppsearch lazy" data-original="'

def KMPinit():
    i,j,m = 0,-1,len(x)
    nexts[0]=-1
    while i<m:
        while j!=-1 and x[i]!=x[j]: j=nexts[j]
        nexts[i+1]=j+1
        i,j=i+1,j+1

def findWord(y):
    i,j,ans,n,m=0,0,[],len(y),len(x)
    while i<n:
        while j!=-1 and y[i]!=x[j]: j=nexts[j]
        i,j=i+1,j+1
        if j==m:
            to = i+1
            while y[to:to+7]!='\" title': to=to+1
            if y[to-3:to]=='jpg' and y[i]=='h' :ans.append(y[i:to])
            j=nexts[j]
    return ans

