#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <cmath>
using namespace std;

int main()
{
    int n;
    cin >> n;

    vector<int> A(n);

    int mx = 0;
    int mn = INT_MAX;

    for (int i=0; i<n; i++)
    {
        cin >> A[i];
        mx = max(mx, A[i]);
        mn = min(mn, A[i]);
    }

    if (n == 3)
    {
        long long delta = mx - mn;
        cout << delta << endl << "1 2 3\n";
        return 0;
    }



}