#include <bits/stdc++.h>
using namespace std;

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

    int n;
    cin>>n;
    unsigned x,y,z;
    vector<unsigned> arr(n);
    vector<unsigned long> pref(n+1);
    vector<unsigned> res;
    pref[0] =  0;

    for(int i = 0;i<n;i++){
        int num;
        cin>>num;
        arr[i] = num;
        pref[i+1] = num + pref[i];
    }

    unsigned long m = pref[n]/3;
    res.push_back(1);

    for(int i = 1;i<n+1;i++){
        if(pref[i] >= m){
            if(-1*(pref[i] - m) < pref[i-1] - m){
                res.push_back(i+1);
            }else{
                res.push_back(i);
            }
            m *= 2;
        }
    }

    for(int i = 0;i<3;i++){
        cout<<res[i]<<" ";
    }
}
