In this task, you are given two lists A,B. Find the longest common subsequence in the lists A and B.
[5697, 4051, 3701, 471, 5701, 'G', 'U', 'S', '1375', 'w', 'w', 3771, 'q', 'P'], [4577, 1641, 'G', 'U', 'S', '1375', 'w', 'T', 2805, 'q', 'c']