Time limit
2s
Memory limit
128 MB
World Elementary School chooses student council candidates from student recommendations. There are N photo frames where candidate photos can be displayed. Process each recommendation using the following rules.
Given the number of frames and the recommended student numbers in order, determine which students remain as candidates at the end.
The first line contains the number of photo frames N. (1 <= N <= 20)
The second line contains the total number of recommendations. The number of recommendations is at most 1,000.
The third line contains the recommended student numbers in recommendation order, separated by spaces. Each student number is a natural number from 1 to 100.
Print the student numbers that remain in the photo frames at the end, in increasing order.