#include <iostream>
using namespace std;

int main(){
    int n, k;
    cin>>n;
    int niz[n];
    int zbir;

    for(int i = 0; i < n; i++){
        cin>>niz[i];
    }

    for(int i = 0; i < 2 * (n-1); i++){
        cin>>k;
    }

    for(int i = 1; i<n; i++){
        zbir+=niz[i];
    }
    int m = 1;
    int r = 0;
    if(niz[0] < zbir){
        cout<<niz[0]<<endl;
        cout<<m<<endl;
        cout<<m<<endl;
        cout<<r<<endl;
    } else{
        cout<<zbir<<endl;
        cout<<n-1<<endl;
        for(int i = 2; i <= n; i++){
            cout<<i<<" ";
        }
        cout<<endl;
        cout<<r<<endl;
    }


}