def multi():
    inp = input().split(" ")
    k, d = int(inp[0]), int(inp[1])
    l = list(map(int, input().split(" ")))
    result = 0
    u = 0
    l.sort()
    print()
    while l[len(l) - 1] - l[0] > d:
        u = -1 if u == 0 else 0
        l.pop(u)
        result += 1
        
    print(l)
    print(result)
    return

multi()