- Time limit: 2.00 s
- Memory limit: 512 MB
Uolevi is working as a teacher's assistant on a software project course. His job is to divide the course's students into groups in which they will work. The course will have students numbered and Uolevi has assessed that student has smarts. When Uolevi was little, his mother told him that a group is as stupid as it's stupidest member. He took that advice to heart and is now going to divide the students to nonempty groups so that the total amount of smarts will be maximized according to this rule.
Formally, if group of size contains students , then each of the group's members will contribute to the total sum of smarts. That is, group will contribute smarts in total.
Input
The first line contains two integers and . The second line contains numbers .
Output
Print numbers on a single. The -th number indicates the group student belongs to. If there are multiple ways to group the students optimally, print any.
Constraints
Example 1
Input:
5 3 6 8 9 7 9
Output:
1 2 3 1 3
Example 2
Input:
10 5 10 8 10 1 2 4 10 2 3 1
Output:
5 4 5 1 2 3 5 2 2 1