In this task, you are given two lists A,B. Find the longest common subsequence in the lists A and B.
Q: ['n', 'g', 6109, 'i', 8881, 715, 'a', 5631, 623, '5417', 'p', '1129', 'U', 'Z', 'Y', 'O', 'a', 'F', 'v', '2247', '8545', '9117', 'h', 'E', '153', 'R', 'x', 'Z', 7459, 169, 507, 559, 9821, 'X', 'L', 'B', 3781, 'x'], ['M', 9199, 1137, 'C', 'K', 'n', 'd', 1001, 7109, 1397, 2487, 7241, 'X', 1943, 'b', '5417', 'p', '1129', 'U', 'Z', 'Y', 'O', 'a', 'F', 'v', '2247', '8545', '9117', 'h', 'E', '153', 'R', 'J', 'H', 'n', 'V', 5347, 'D']
A: 
5417, p, 1129, U, Z, Y, O, a, F, v, 2247, 8545, 9117, h, E, 153, R