#include <iostream>
#include <vector>
using namespace std;

int main () {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    vector<int> v(n);
    for (int i = 0; i < n; i++) {
        cin >> v[i];
    }
    if (n==3) {
        int maxN = max(max(v[0],v[1]), v[2]);
        int minN = min(min(v[0],v[1]), v[2]);
        cout << maxN-minN << "\n1 2 3";
    } else {

    }
    return 0;
}
