#include <bits/stdc++.h>

#define ll long long
#define loop(i, a, b) for (ll i = a; i < b; i++)

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    ll n, x, s = 0;
    cin >> n;
    vector<ll> a(n);
    loop(i, 0, n) {
        cin >> a[i];
        s += a[i];
    }
    loop(i, 0, n - 1) {
        cin >> x;
    }

    if (s - a[0] < a[0]) {
        cout << s - a[0] << '\n';
        cout << n - 1 << '\n';
        loop(i, 2, n + 1) {
            cout << i << ' ';
        }
        cout << '\n';
        cout << "0\n";
    } else {
        cout << a[0] << '\n';
        cout << "1\n";
        cout << "1\n";
        cout << "0\n";
    }

    return 0;
}