CSES - Aalto Competitive Programming 2024 - wk9 - Wed - Good grades
  • 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 nn students numbered 1,2,,n1,2,\dots,n and Uolevi has assessed that student ii has sis_i 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 nn students to kk nonempty groups so that the total amount of smarts will be maximized according to this rule.

Formally, if group SS of size xx contains students 1,2,,x1, 2,\dots,x, then each of the group's xx members will contribute mini=1xsimin_{i=1}^{x}{s_i} to the total sum of smarts. That is, group SS will contribute x×mini=1xsix \times min_{i=1}^{x}{s_i} smarts in total.

Input

The first line contains two integers nn and kk. The second line contains nn numbers s1,s2,,sns_1,\,s_2,\dots,\,s_n.

Output

Print nn numbers on a single. The ii-th number indicates the group student ii belongs to. If there are multiple ways to group the students optimally, print any.

Constraints

  • 1kn5001 \leq k \leq n \leq 500
  • 1si1091 \leq s_i \leq 10^9
  • 1gik1 \leq g_i \leq k

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