#P358. 练61.3 文体两开花

练61.3 文体两开花

Description

The school is holding an award ceremony where nn students received the Literature Excellence Award and mm students received the Sports Excellence Award. Given the student IDs of both award winners, where each student has a unique ID, please help count the list of students who received both awards (achieved excellence in both literature and sports).

Input Format

First line contains two integers nn and mm (1n,m1051 \le n, m \le 10^5), representing the number of Literature Excellence Award winners and Sports Excellence Award winners respectively.
Second line contains nn distinct integers, representing the IDs of students who won the Literature Excellence Award.
Third line contains mm distinct integers, representing the IDs of students who won the Sports Excellence Award.
All IDs are positive integers not exceeding 10910^9.

Output Format

Output one line containing space-separated integers representing the IDs of students who won both awards, in the order they appear in the Literature Excellence Award list.

Sample

4 4
5 1 7 3
2 3 4 1
1 3