def LCSWithValues(S1, S2):
    'returns the longest common string'
    if ((S1 == '') or (S2 == '')):
        return (0, '')
    if (S1[0] == S2[0]):
        result = LCSWithValues(S1[1:], S2[1:])
        return ((1 + result[0]), (S1[0] + result[1]))
    useS1 = LCSWithValues(S1, S2[1:])
    useS2 = LCSWithValues(S1[1:], S2)
    if (useS1[0] > useS2[0]):
        return useS1
    return useS2
returns the longest common string
def LCSWithValues(S1, S2):
    
    if ((S1 == ) or (S2 == )):
        return (0, )
    if (S1[0] == S2[0]):
        result = LCSWithValues(S1[1:], S2[1:])
        return ((1 + result[0]), (S1[0] + result[1]))
    useS1 = LCSWithValues(S1, S2[1:])
    useS2 = LCSWithValues(S1[1:], S2)
    if (useS1[0] > useS2[0]):
        return useS1
    return useS2