Give you a string X, only containing lowercase letters.
Give you m queries, each of which is : If the initial string is S, then add character to the end of S randomly(with equal probability per character for each of the 26 characters) and ask the expectation of the number(added characters) that will keep the string being a substring of the string X.