In this task, you are given two lists A,B. Find the longest common subsequence in the lists A and B.
[9977, 2699, 'F', 1597, 'Y', 'Q', '3685', 'E', '2971', '981', '3761', 's', 'q'], ['p', 7847, 'Y', 'Q', '3685', 'E', '2971', '981', '3761', 'R', 'o', 'w']