Problem: This problem is the most boring one you've ever seen. 

Given a sequence of integers a1, a2, ..., an and a non-negative integer h, our goal is to partition the sequence into two subsequences (not necessarily consist of continuous elements). Each element of the original sequence should be contained in exactly one of the result subsequences. Note, that one of the result subsequences can be empty.

Let's define function f(ai, aj) on pairs of distinct elements (that is i ≠ j) in the original sequence. If ai and aj are in the same subsequence in the current partition then f(ai, aj) = ai + aj otherwise f(ai, aj) = ai + aj + h. 

Consider all possible values of the function f for some partition. We'll call the goodness of this partiotion the difference between the maximum value of function f and the minimum value of function f.

Your task is to find a partition of the given sequence a that have the minimal possible goodness among all possible partitions.

Input

The first line of input contains integers n and h (2 ≤ n ≤ 105, 0 ≤ h ≤ 108). In the second line there is a list of n space-separated integers representing a1, a2, ..., an (0 ≤ ai ≤ 108).

Output

The first line of output should contain the required minimum goodness. 

The second line describes the optimal partition. You should print n whitespace-separated integers in the second line. The i-th integer is 1 if ai is in the first subsequence otherwise it should be 2.

If there are several possible correct answers you are allowed to print any of them.

Examples

Input

3 2
1 2 3


Output

1
1 2 2 


Input

5 10
0 1 0 2 1


Output

3
2 2 2 2 2 

Note

In the first sample the values of f are as follows: f(1, 2) = 1 + 2 + 2 = 5, f(1, 3) = 1 + 3 + 2 = 6 and f(2, 3) = 2 + 3 = 5. So the difference between maximum and minimum values of f is 1.

In the second sample the value of h is large, so it's better for one of the sub-sequences to be empty.

Solution (in JAVA):

Solution:
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskD solver = new TaskD();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskD {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int n=in.nextInt();
        int h=in.nextInt();
        int arr[][]=new int[n][2];
        for(int i=0;i<n;i++){
            arr[i][0]=in.nextInt();
            arr[i][1]=i;
        }
        sort(arr);
        if(n<=2){
            out.println(0);
            for(int i=0;i<n;i++){
                out.print(1+" ");
            }
            return;
        }
        int goodness0=(arr[n-1][0]+arr[n-2][0])-(arr[0][0]+arr[1][0]);
        //System.out.println(goodness0);
        int goodness1=Integer.MAX_VALUE;
        int ind=-1;
        for(int i=0;i<n;i++){
            int m1=0;
            int m2=0;
            int l1=0;
            int l2=0;
            boolean found1=false;
            boolean found2=false;
            for(int j=0;j<n&&!found2;j++){
                if(i!=j){
                    if(!found1){
                        l1=arr[j][0];
                        found1=true;
                    }
                    else{
                        l2=arr[j][0];
                        found2=true;
                    }
                }
            }
            found1=false;
            found2=false;
            for(int j=n-1;j>=0&&!found2;j--){
                if(i!=j){
                    if(!found1){
                        m1=arr[j][0];
                        found1=true;
                    }
                    else{
                        m2=arr[j][0];
                        found2=true;
                    }
                }
            }
            //System.out.println("taking "+i);
            //System.out.println("Data: "+m1+" "+m2+" "+l1+" "+l2);
            int f1=m1+m2;
            int f2=l1+l2;
            int f3=arr[i][0]+m1+h;
            int f4=arr[i][0]+l1+h;
            int min=Math.min(f4,f2);
            int max=Math.max(f1,f3);
            int good=max-min;
            //System.out.println("Current good: "+good);
            if(good<goodness1){
                goodness1=good;
                ind=arr[i][1];
            }
        }
        if(goodness0<=goodness1){
            ind=-1;
        }
        out.println(Math.min(goodness0,goodness1));
        for(int i=0;i<n;i++){
            if(i==ind){
                out.print(1+" ");
            }
            else{
                out.print(2+" ");
            }
        }
    }

    private void sort(int[][] n){
        int len=n.length;
        int l1=len/2;
        int l2=len-l1;
        int[][] n1=new int[l1][2];
        int[][] n2=new int[l2][2];
        for(int i=0;i<l1;i++){
            n1[i]=n[i];
        }
        for(int i=0;i<l2;i++){
            n2[i]=n[i+l1];
        }
        if(l1!=0){
            sort(n1);
            sort(n2);
        }
        int ind1=0;
        int ind2=0;
        int ind=0;
        for(int i=0;i<len&&ind1<l1&&ind2<l2;i++){
            if(n1[ind1][0]<n2[ind2][0]){
                n[i]=n1[ind1];
                ind1++;
            }
            else{
                n[i]=n2[ind2];
                ind2++;
            }
            ind++;
        }
        if(ind1<l1){
            for(int i=ind1;i<l1;i++){
                n[ind]=n1[i];
                ind++;
            }
        }
        if(ind2<l2){
            for(int i=ind2;i<l2;i++){
                n[ind]=n2[i];
                ind++;
            }
        }
    }
}

class InputReader{
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    public InputReader(InputStream stream){
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }
    public String next(){
        while (tokenizer == null||!tokenizer.hasMoreTokens()){
            try{
                tokenizer = new StringTokenizer(reader.readLine());
            }
            catch (IOException e){
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt(){
        return Integer.parseInt(next());
    }

    }