#include<bits/stdc++.h>
using namespace std;
const int maxN=200005;
int a[maxN];
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int n;
    cin>>n;
    long long suma=0;
    for(int i=1; i<=n; i++)
    {
        cin>>a[i];
        suma+=a[i];
    }
    if(suma-a[1]>=a[1])
    {
        cout<<a[1]<<endl;
        cout<<1<<endl;
        cout<<1<<endl;
        cout<<0<<endl;
    }
    else
    {
        cout<<suma-a[1]<<endl;
        cout<<n-1<<endl;
        for(int i=2; i<=n; i++)
            cout<<i<<' ';
        cout<<endl;
        cout<<0<<endl;
    }
    return 0;
}