#include <bits/stdc++.h>

#define maxn 200002

typedef long long ll;

ll a[maxn];

using namespace std;

int main() {
	ll n, u, v;
	cin >> n;
	ll suma = 0;
	for(ll i = 0; i < n; i++) {
		cin >> a[i];
		suma += a[i];
	} 
	suma -= a[0];
	
	if(suma < a[0]) {
		//bojimo ostale
		cout << suma << "\n" << n - 1 << "\n";
		for(int i = 2; i <= n; i++) cout << a[i] + " ";
		cout << "\n0";
	} else {
		//bojimo prvu
		cout << a[0] << "\n1\n1\n0"; 
	}
	
	return 0;
}