#include <bits/stdc++.h>
using namespace std;
#define lol long long
#define forin for(int i = 1; i <= n; i++)
#define forjn for(int j = 1; j <= n; j++)
#define forch(j, k) for(int i = j; i <= k; i++)
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
const lol N = 3e5+10;
lol t, n, a[N];
void solve() {
    cin >> n;
    forin cin >> a[i];
    sort(a+1, a+1+n);
    cout << a[n]-a[1] << endl;
    cout << "1 2 3" << endl;
}
int main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    t = 1;
    //cin >> t;
    while(t--) solve();
}