def find_lcs(x, y):
    """Find longest common subsequence."""
    m, n = len(x), len(y)
    C = [([0] * (n + 1)) for _ in range(m + 1)]
    for i in range(1, m + 1):
        for j in range(1, n + 1):
            C[i][j] = C[i - 1][j - 1] + 1 if x[i - 1] == y[j - 1] else max(C
                [i][j - 1], C[i - 1][j])
    index = C[m][n]
    lcs = [None] * index
    while m > 0 and n > 0:
        if x[m - 1] == y[n - 1]:
            lcs[index - 1] = x[m - 1]
            m, n, index = m - 1, n - 1, index - 1
        elif C[m - 1][n] > C[m][n - 1]:
            m -= 1
        else:
            n -= 1
    return lcs
