n = int(input())
a = list(map(int, input().split()))
if n == 3:
    print(max(a) - min(a))
    print(1, 2, 3)
else:
    if n % 3 == 1 or n % 3 == 2:
        print(1)
    else:
        print(0)
    x = n // 2
    print(1, 1 + x, 1 + x + x)