#include<bits/stdc++.h>
using namespace std;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    int x, sum=0, p;
    cin>>p;
    for(int i=1;i<n; i++){
        cin>>x;
        sum+=x;
    }
    if(p<=sum){
        cout<<p<<endl;
        cout<<1<<endl;
        cout<<1<<endl;
        cout<<0;
    }
    else{
        cout<<sum<<endl;
        cout<<n-1<<endl;
        for(int i=2; i<=n; i++)cout<<i<<" ";
        cout<<endl<<0<<endl;
    }

}