In this task, you are given two lists A,B. Find the longest common subsequence in the lists A and B.
[5739, 'P', 'd', '1717', 'g', '8587', 'a', 8947, 8973], ['p', 'x', 'd', '1717', 'g', '8587', 'p', 1849, 4297, 1503]