#P1271. 【深基9.例1】选举学生会

【深基9.例1】选举学生会

Description

The school is electing student union members. There are nn (1n9991 \le n \le 999) candidates, and each candidate is numbered from 11 to nn. Now mm (1m20000001 \le m \le 2000000) ballots have been collected, and each ballot has a candidate number written on it. Now we want to sort this mountain of ballots in ascending order by the vote number. Let the number on the ii-th (1im1 \le i \le m) ballot be aia_i, and it is guaranteed that 1ain1 \le a_i \le n.

Input Format

Input nn and mm, followed by the numbers on the mm ballots.

Output Format

Output the ballot numbers after sorting.

5 10
2 5 2 2 5 2 2 2 1 2
1 2 2 2 2 2 2 2 5 5

Hint

Translated by ChatGPT 5