In this task, you are given two lists A,B. Find the longest common subsequence in the lists A and B.
[39, 'w', 'g', 'A', '2565', 'f', 'n', 'd', 'Z', '9843', 'A', 'e', 'E', 1523, 'B', 'N'], ['F', 'G', 'N', 6261, 7941, 'C', '2565', 'f', 'n', 'd', 'Z', '9843', 'p', 1331, 'z', 'p']