1256_E. Yet Another Division Into Teams
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.
```python

def main():
    
    n=int(input())
    a=readIntArr()
    
    a2=[[x,i+1] for i,x in enumerate(a)] # [value, index]
    a2.sort(key=lambda x:x[0]) # sort by value asc
    
    dp=[inf for _ in range(n)] # dp[i] is the min diversity achievable at i
    #dp[i]=min(ai-aj+dp[j-1])=min(a[i]+(dp[j-1]-a[j]))=a[i]+dp2[i-2]
    dp2=[inf for _ in range(n)] # dp2[j] is the min dp[j-1]-a[j] so far (prefix min)
    dp2i=[-1 for _ in range(n)] # dp2i[i] stores the index where dp2[i] was previously minimised
    
    for i in range(2,min(n,5)):
        dp[i]=a2[i][0]-a2[0][0]
        
        dp2[i]=dp[i-1]-a2[i][0]
        dp2i[i]=i
        if dp2[i]>=dp2[i-1]:
            dp2i[i]=dp2i[i-1]
            dp2[i]=dp2[i-1]
    
    for i in range(5,n):
        dp2[i]=dp[i-1]-a2[i][0]
        dp2i[i]=i
        if dp2[i]>=dp2[i-1]:
            dp2i[i]=dp2i[i-1]
            dp2[i]=dp2[i-1]
        
        dp[i]=a2[i][0]+dp2[i-2]
        # print('i:{} a2[i][0]:{} dp2[i-2]:{}'.format(i,a2[i][0],dp2[i-2]))
    
    # print('a2:{}'.format(a2))
    # print('dp:{}'.format(dp))
    # print('dp2:{}'.format(dp2))
    # print('dp2i:{}'.format(dp2i))
    
    minDiversity=dp[n-1]
    
    groups=[]
    right=n-1
    while True:
        left=dp2i[right-2]
        if left==-1:
            left=0
        temp=[]
        for i in range(left,right+1):
            temp.append(a2[i][1])
        groups.append(temp)
        if left==0:
            break
        right=left-1
    
    nGroups=len(groups)
    
    grouping=[-1 for _ in range(n)]
    for i in range(nGroups):
        for student in groups[i]:
            grouping[student-1]=i+1
    
    print('{} {}'.format(minDiversity,nGroups))
    oneLineArrayPrint(grouping)
    
    return
    
import sys
# input=sys.stdin.buffer.readline #FOR READING PURE INTEGER INPUTS (space separation ok)
input=lambda: sys.stdin.readline().rstrip("\r\n") #FOR READING STRING/TEXT INPUTS.
 
def oneLineArrayPrint(arr):
    print(' '.join([str(x) for x in arr]))
def multiLineArrayPrint(arr):
    print('\n'.join([str(x) for x in arr]))
def multiLineArrayOfArraysPrint(arr):
    print('\n'.join([' '.join([str(x) for x in y]) for y in arr]))
 
def readIntArr():
    return [int(x) for x in input().split()]
# def readFloatArr():
#     return [float(x) for x in input().split()]

def makeArr(defaultVal,dimensionArr): # eg. makeArr(0,[n,m])
    dv=defaultVal;da=dimensionArr
    if len(da)==1:return [dv for _ in range(da[0])]
    else:return [makeArr(dv,da[1:]) for _ in range(da[0])]
 
def queryInteractive(x,y):
    print('? {} {}'.format(x,y))
    sys.stdout.flush()
    return int(input())
 
def answerInteractive(ans):
    print('! {}'.format(ans))
    sys.stdout.flush()
 
inf=float('inf')
MOD=10**9+7
 
 
for _abc in range(1):
    main()
```