from re import M
#
# 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
#
# 
# @param cows int整型一维数组 
# @param k int整型 
# @return int整型一维数组
#
class Solution:
    def sortCowsIII(self , cows: List[int], k: int) -> List[int]:
        # write code here
        g = [0]*k
        for i in cows:
            g[i]=g[i]+1
        print(g)
        f=[]
        for i in range(k):
            cur = []
            cur = [i]*g[i]
            print(cur)
            f = f + cur
        return f