Given the task definition and input, reply with output. In this task, you are given two lists A,B. Find the longest common subsequence in the lists A and B.

[5031, 8709, 'R', 2257, 7977, 'v', 'Y', 'g', '6665', '2361', 'L', 'r', 'A', '4317', '1001', 'e', '6745', 'a', 'z', '3133', 'g', 5459, 4515, 3399, 'D', 'F', 'Z', 1275, 1967], ['J', 1631, 5083, 'X', 5749, 'M', 'F', 'P', 3831, 'C', 3793, 'g', '6665', '2361', 'L', 'r', 'A', '4317', '1001', 'e', '6745', 'a', 'z', '3133', 'W', 'W', 'Y', 'P', 'X', 597, 9867, 243, 983, 'O', 6345]

g, 6665, 2361, L, r, A, 4317, 1001, e, 6745, a, z, 3133