There are n students at your university. The programming skill of the i-th student is a_i. As a coach, you want to divide them into teams to prepare them for the upcoming ICPC finals. Just imagine how good this university is if it has 2 ⋅ 10^5 students ready for the finals!

Each team should consist of at least three students. Each student should belong to exactly one team. The diversity of a team is the difference between the maximum programming skill of some student that belongs to this team and the minimum programming skill of some student that belongs to this team (in other words, if the team consists of k students with programming skills a[i_1], a[i_2], ..., a[i_k], then the diversity of this team is max_{j=1}^{k} a[i_j] - min_{j=1}^{k} a[i_j]).

The total diversity is the sum of diversities of all teams formed.

Your task is to minimize the total diversity of the division of students and find the optimal way to divide the students.

Input

The first line of the input contains one integer n (3 ≤ n ≤ 2 ⋅ 10^5) — the number of students.

The second line of the input contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 10^9), where a_i is the programming skill of the i-th student.

Output

In the first line print two integers res and k — the minimum total diversity of the division of students and the number of teams in your division, correspondingly.

In the second line print n integers t_1, t_2, ..., t_n (1 ≤ t_i ≤ k), where t_i is the number of team to which the i-th student belong.

If there are multiple answers, you can print any. Note that you don't need to minimize the number of teams. Each team should consist of at least three students.

Examples

Input


5
1 1 3 4 2


Output


3 1
1 1 1 1 1 


Input


6
1 5 12 13 2 15


Output


7 2
2 2 1 1 2 1 


Input


10
1 2 5 129 185 581 1041 1909 1580 8150


Output


7486 3
3 3 3 2 2 2 2 1 1 1 

Note

In the first example, there is only one team with skills [1, 1, 2, 3, 4] so the answer is 3. It can be shown that you cannot achieve a better answer.

In the second example, there are two teams with skills [1, 2, 5] and [12, 13, 15] so the answer is 4 + 3 = 7.

In the third example, there are three teams with skills [1, 2, 5], [129, 185, 581, 1041] and [1580, 1909, 8150] so the answer is 4 + 912 + 6570 = 7486.
import java.io.*; 
import java.math.*;
import java.util.*;
import java.awt.Point;
 
public class Main {
	//static final long MOD = 998244353;
	static final long MOD = 1000000007;
	static final int INF = 1000000007;
	
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		int N = sc.ni();
		int[][] skills = new int[N][2]; //{index,skill}
		for (int i = 0; i < N; i++) {
			skills[i][0] = i;
			skills[i][1] = sc.ni();
		}
		skills = sort(skills);
		int[] dp = new int[N];
		int[] sizes = new int[N];
		int minDiff = Integer.MAX_VALUE;
		int minIndex = -1;
		
		//Precompute base cases
		dp[2] = skills[2][1]-skills[0][1];
		sizes[2] = 3;
		dp[3] = skills[3][1]-skills[0][1];
		sizes[3] = 4;
		dp[4] = skills[4][1]-skills[0][1];
		sizes[4] = 5;
		
		
		//The dynamic programming step
		for (int i = 5; i < N; i++) {
			dp[i] = skills[i][1]-skills[0][1];
			sizes[i] = i+1;
			if (dp[i-3]-skills[i-2][1] < minDiff) {
				minDiff = dp[i-3]-skills[i-2][1];
				minIndex = i-3;
			}
			if (skills[i][1]+minDiff < dp[i]) {
				dp[i] = skills[i][1]+minDiff;
				sizes[i] = i-minIndex;
			}
		}
		//System.out.println(Arrays.toString(dp));
		//System.out.println(Arrays.toString(sizes));
		ArrayList<Integer> teamSizes = new ArrayList<Integer>();
		int index = N-1;
		while (index > 0) {
			teamSizes.add(sizes[index]);
			index -= sizes[index];
		}
		Collections.reverse(teamSizes);
		//System.out.println(teamSizes);
		int[] teams = new int[N];
		index = 0;
		for (int i = 0; i < teamSizes.size(); i++) {
			for (int j = index; j < index+teamSizes.get(i); j++) {
				teams[skills[j][0]] = i+1;
			}
			index += teamSizes.get(i);
		}
		System.out.println(dp[N-1] + " " + teamSizes.size());
		StringBuilder ans = new StringBuilder();
		for (int team: teams)
			ans.append(team + " ");
		System.out.println(ans);
 	}
	
	static class DisjointSetUnion {
		  public int[] parent;
		  public int[] rank;
		  public int count;

		  public DisjointSetUnion(int nodes) {
			  count = nodes;
			  parent = new int[nodes];
			  rank = new int[nodes];
			  for (int i = 0; i < nodes; i++) {
				  parent[i] = i;
				  rank[i] = 0;
			  }
		  }
		  //"find"
		  public int root(int p) {
			  if (parent[p] != p)
				  parent[p] = root(parent[p]);
			  return parent[p];
		  }

		  //"union"
		  public void connect(int p, int q) {
			  int rootP = root(p);
			  int rootQ = root(q);
			  if (rootP == rootQ) return;
			  if (rank[rootP] < rank[rootQ]) {
				  parent[rootP] = rootQ;
			  } else if (rank[rootP] > rank[rootQ]) {
				  parent[rootQ] = rootP;
			  } else {
				  parent[rootP] = rootQ;
				  rank[rootQ] += 1;
			  }
			  count--;
		  }

		  public boolean connected(int p, int q) {
		    return root(p) == root(q);
		  }
	}
    
    public static long power(long x, long y, long p) { 
        // Initialize result
        long res = 1;
         
        // Update x if it is more   
        // than or equal to p 
        x = x % p;  
      
        while (y > 0) 
        { 
            // If y is odd, multiply x 
            // with result 
            if((y & 1)==1) 
                res = (res * x) % p; 
      
            // y must be even now 
            // y = y / 2 
            y = y >> 1;  
            x = (x * x) % p;  
        } 
        return res; 
    }
    
    public static long dist(int[] point, int[] point2) {
    	return (long)(Math.pow((point2[1]-point[1]),2)+Math.pow((point2[0]-point[0]),2));
    }
    
    public static long gcd(long a, long b) {
    	if (b == 0)
    		return a;
    	else
    		return gcd(b,a%b);
    }
    
    public static int[][] sort(int[][] array) {
    	//Sort an array (immune to quicksort TLE)
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    int[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		Arrays.sort(array, new Comparator<int[]>() {
			  @Override
        	  public int compare(int[] arr1, int[] arr2) {
				  return arr1[1]-arr2[1]; //ascending order
	          }
		});
		return array;
	}
    
    public static long[][] sort(long[][] array) {
    	//Sort an array (immune to quicksort TLE)
		Random rgen = new Random();
		for (int i = 0; i < array.length; i++) {
		    int randomPosition = rgen.nextInt(array.length);
		    long[] temp = array[i];
		    array[i] = array[randomPosition];
		    array[randomPosition] = temp;
		}
		Arrays.sort(array, new Comparator<long[]>() {
			  @Override
        	  public int compare(long[] arr1, long[] arr2) {
				  if (arr1[0] < arr2[0])
					  return -1;
				  if (arr1[0] > arr2[0])
					  return 1;
				  return 0;
	          }
		});
		return array;
	}
    
    static class FastScanner { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastScanner() { 
            br = new BufferedReader(new InputStreamReader(System.in)); 
        } 
  
        String next() { 
            while (st == null || !st.hasMoreElements()) { 
                try { 
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int ni() { 
            return Integer.parseInt(next()); 
        } 
  
        long nl() { 
            return Long.parseLong(next()); 
        } 
  
        double nd() { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() { 
            String str = ""; 
            try { 
                str = br.readLine(); 
            } catch (IOException e) {
                e.printStackTrace(); 
            } 
            return str; 
        }
    }
}