#include <bits/stdc++.h>
using namespace std;

int main() {
    int n;
    cin >> n;
    int a[n];
    for(int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    cout << max(a[0],max(a[1],a[2])) - min(a[0],min(a[1],a[2])) << "\n";
    cout << "1 2 3";
}