import sys

n = int(sys.stdin.readline())
nums = list(map(int, sys.stdin.readline().split()))

res = 100000

if n == 3:
    print(max(nums[0], nums[1], nums[2]) - min(nums[0], nums[1], nums[2]))
    print(1,2,3)
else:
    summation = sum(nums)
    for x in range(0, len(nums)-2):
        sum_x, sum_y = nums[x], nums[x+1]
        sum_z = summation - sum_x - sum_y
        for y in range(x+1, len(nums)-1):
            z = y + 1
            for z in range(y+1, len(nums)):
                yeah = max(sum_x, sum_y, sum_z) - min(sum_x, sum_y, sum_z)
                if yeah < res:
                    res = yeah
                    min_x, min_y, min_z = x+1, y+1, z+1
                sum_y, sum_z = sum_y + nums[z], sum_z - nums[z]

            sum_x, sum_y = sum_x + nums[y], nums[y+1]
            sum_z = summation - sum_x - sum_y

    print(res)
    print(min_x, min_y, min_z)