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

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int n;
    cin>>n;
    int a[n+1];

    for(int i=1; i<=n; i++)
    {
        cin>>a[i];
    }

    if(n==3)
    {
        sort(a+1, a+n+1);
        cout<<a[3]-a[1]<<"\n";
        cout<<1<<" "<<2<<" "<<3<<"\n";
    }
}
