lcs, rabin-karp and kmp from files