# -*- coding: utf-8 -*-
n, d = map(int,raw_input().split())
x = map(int,raw_input().split())
n=len(x)
x=list(set(x))
x.sort(reverse=True)
m=len(x)+1
print(x)
for i in range(len(x)):
    for j in range(i, len(x)):
        if(x[i]-x[j]<=d) and (len(x)-(j-i)-1)<m:
            m=len(x)-j+i-1
        print(i,x[i],j,x[j])
print(m-len(x)+n)