



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

using ll= long long;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //cout << factorial(7);
    int n;
    cin>>n;
    vector<int> arr(n);
    int minn = 1000000000;
    int maxx = 0;
    for (int i = 0; i < n;i++) {
        cin>>arr[i];
        maxx = max(maxx, arr[i]);
        minn = min(minn, arr[i]);
    }
    if (n==3) {
        cout << maxx-minn << endl;
        cout << 1 << " " << 2 << " " << 3 << endl;
    }
    return 0;
}
