1 3 5 7 9 2 3 4 5 6
3 5
a = set(map(int, input().split())) b = set(map(int, input().split())) print(*sorted(a & b))