import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Task2 {
    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            StringTokenizer st = new StringTokenizer(br.readLine());
            int n = Integer.parseInt(st.nextToken());
            int[] a = new int[n];
            st = new StringTokenizer(br.readLine());
            for(int i = 0; i < n; i++) {
                a[i] = Integer.parseInt(st.nextToken());
            }
            if(n == 3) {
                int max = -1;
                int min = Integer.MAX_VALUE;
                for(int i = 0; i < 3; i++) {
                    if(a[i] > max) {
                        max = a[i];
                    }
                    if(a[i] < min) {
                        min = a[i];
                    }
                }
                System.out.println(max - min);
                System.out.println("1 2 3");
            }
        } catch (IOException ex) {}
    }
}
