In this task, you are given two lists A,B. Find the longest common subsequence in the lists A and B.
[5239, 'M', 'H', 'g', '9865', 'R', '8367', 'V', 'T', 4843], ['w', 'Z', 'K', 'g', '9865', 'R', '8367', 'z', 'D', 'T', 'g']