#P358. 练61.3 文体两开花
练61.3 文体两开花
Description
The school is holding an award ceremony where students received the Literature Excellence Award and 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 and (), representing the number of Literature Excellence Award winners and Sports Excellence Award winners respectively.
Second line contains distinct integers, representing the IDs of students who won the Literature Excellence Award.
Third line contains distinct integers, representing the IDs of students who won the Sports Excellence Award.
All IDs are positive integers not exceeding .
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 11 3
Related
In following homework: