Detailed Instructions: In this task, you are given two lists A,B. Find the longest common subsequence in the lists A and B.
Q: ['G', 9401, 'z', '7831', '4677', 'Z', '4099', '5131', 'w', '4877', 'm', 'L', 'z'], [195, 639, 'E', '7831', '4677', 'Z', '4099', '5131', 'w', '4877', 'Q', 'w']
A:
7831, 4677, Z, 4099, 5131, w, 4877