n, d = map(int, input().split())
a = list(map(int, input().split()))
a.sort()


p = 0
q = len(a)-1
count = 0
diff = a[q] - a[p]

for i in range(len(a)//2):
    if diff <= d:
        break
    if a[q-1]-a[p] < a[p+1]-a[q]:
        count += 1
        q -= 1
        diff = a[q]-a[p]
        print (str(a[q+1]) + "deleted")
    else:
        count += 1
        p += 1
        diff = a[q]-a[p]
        print (str(a[p-1]) + "deleted")

print (count)
