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

#define int long long
#define mod 1000000007
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define fst first
#define snd second
#define ff first
#define st second
#define endl "\n"
#define pow2(x) (x*1LL*x)

void I_LOVE_PEREKOPSKA() {
    int n;
    cin>>n;
    vector<int> a(n);
    for (auto &x:a)
        cin>>x;
    int x=0,y=0,z=0;
    if (n==3) {
        sort(all(a));
        cout<<a[2]-a[0]<<endl;
        cout<<"1 2 3\n";
    }
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    int t = 1;
    // cin>>t;
    while (t--) {
        I_LOVE_PEREKOPSKA();
    }
}