#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    int n;
    cin>>n;
    vector<long long> a(n);
    for(int i=0; i<n; i++){
        cin>>a[i];
    }
    long long acc=accumulate(a.begin(), a.end(), 0ll);
    if(a[0]<=(acc-a[0])){
        cout<<a[0]<<"\n1\n1\n0";
    }
    else{
        cout<<acc-a[0]<<"\n"<<n-1<<"\n";
        for(int j=1; j<n; j++) cout<<j+1<<' ';
        cout<<"\n0";
    }
    return 0;
}