#include <iostream>
#include <vector>
#include <algorithm>
#define ll long long
#define pii std::pair<int, int>
int main() {
    std::cin.tie(nullptr)->sync_with_stdio(false);
    int n;
    std::cin >> n;
    std::vector<int> a(n), pref(n);
    for (int i = 0; i < n; ++i) {
        std::cin >> a[i];
        pref[i] = (i ? pref[i-1] : 0) + a[i];
    }
    int target = (pref[n-1] + 2)/ 3;
    int r = pref[n-1] % 3;
    int y = std::lower_bound(pref.begin(), pref.end(), target) - pref.begin() + 1;
    int z = std::lower_bound(pref.begin(), pref.end(), 2 * target + (r ? 1 : 0)) - pref.begin() + 1;
    std::cout << 1 << '\n';
    std::cout << 1 << ' ' << y << ' ' << z << '\n';
    return 0;
}