In this task, you are given two lists A,B. Find the longest common subsequence in the lists A and B.
['u', 'g', 'F', '3301', '3013', '4371', 'N', 3943, 'n'], [4987, 4139, 'X', 'P', 'F', '3301', '3013', '4371', 'S', 5045]