#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <iomanip>
#include <sstream>
#include <stdlib.h>
#include <cstdlib>
#include <stdio.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <fstream>
#include <stack>
#include <queue>
#include <deque>
#include <list>
#include <vector>
#include <map>
#include <set>
//#include "String.h"
using namespace std;
const int O=2e9;
const double E=1e-9;
const double api = 3.1415926536;
int DX[]={1,-1,-1,1};
int DY[]={-1,1,1,-1};

/*bool valid(int x,int y)
{
    return ( (x>=0 && x<n) && (y>=0 && y<m) );
}
*/

int main()
{
	int b;
	cin>>b;
	if(b==1)
	{
		cout<<1<<" 0\n";
		return 0;
	}
	int arr[100002];
	int i=0,j=b-1,m=0,t1=0,t2=0;
	for (int i = 0; i < b; cin>>arr[i++]);
	//5
//2 9 8 2 7
	while (i<=j)
	{
		 if(t1<=t2)
			t1+=arr[i++];
		else if(t1>t2)
			t2+=arr[j--],m++;
	}

	cout<<i<<" "<<m<<endl;

}


#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <fstream>
#include <stack>

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REV(i,b,a) for(int i=(a);i>=(b);i--)
#define mp make_pair
#define pb push_back
#define SZ(v) (int)v.size()
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()

using namespace std;
double PI = 3.14159;
int dX[] = { 1, -1, 0, 0 };
int dY[] = { 0, 0, 1, -1 };
bool vis[100001];
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int n, arr[100001];
    cin >> n;
    FOR(i, 0, n)cin >> arr[i];
    int idx1 = 1, idx2 = n - 2, sum1 = arr[0], sum2 = arr[n - 1], c1 = 1, c2 = 1;
    while (idx2 > idx1)
    {
        while (sum1 < sum2 && !vis[idx1] && idx2 > idx1)
            sum1 += arr[idx1], vis[idx1] = 1, idx1++, c1++;
        while (sum2 < sum1 && !vis[idx2] && idx2 > idx1)
            sum2 += arr[idx2], vis[idx2] = 1, idx2--, c2++;
        while (sum1 == sum2 && idx2 > idx1)
        {
            if (!vis[idx1])
                sum1 += arr[idx1], c1++, idx1++;
            if (!vis[idx2])
                sum2 += arr[idx2], c2++, idx2--;
        }
    }
    if (idx2 == idx1)
    {
        if (sum1 > sum2)
            c2++;
        else
            c1++;
    }
    if (n == 1)
        return puts("1 0"), 0;
    cout << c1 << " " << c2 << "\n";
}


#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <fstream>
#include <stack>

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REV(i,b,a) for(int i=(a);i>=(b);i--)
#define mp make_pair
#define pb push_back
#define SZ(v) (int)v.size()
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()

using namespace std;
double PI = 3.14159;
int dX[] = { 1, -1, 0, 0 };
int dY[] = { 0, 0, 1, -1 };
bool vis[100001];
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int n, arr[100001];
    cin >> n;
    FOR(i, 0, n)cin >> arr[i];
    int idx1 = 1, idx2 = n - 2, sum1 = arr[0], sum2 = arr[n - 1], c1 = 1, c2 = 1;
    while (idx2 > idx1)
    {
        while (sum1 < sum2 && !vis[idx1] && idx2 > idx1)
            sum1 += arr[idx1], vis[idx1] = 1, idx1++, c1++;
        while (sum2 < sum1 && !vis[idx2] && idx2 > idx1)
            sum2 += arr[idx2], vis[idx2] = 1, idx2--, c2++;
        while (sum1 == sum2 && idx2 > idx1)
        {
            if (!vis[idx1])
                sum1 += arr[idx1], c1++, idx1++;
            if (!vis[idx2])
                sum2 += arr[idx2], c2++, idx2--;
        }
    }
    if (idx2 == idx1)
    {
        if (sum1 > sum2)
            c2++;
        else
            c1++;
    }
    cout << c1 << " " << c2 << "\n";
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string>
#include <fstream>

#define fs first
#define sc second
#define sz size()
#define pb push_back
#define mp make_pair
#define For(i,n) for(i=0;i<n;i++)

using namespace std;
ifstream fin("a.in");

/*
 *
 */

#define NMAX 100000
int n,fromLeft[NMAX],fromRight,bars[NMAX],sumBars;

int main(){
    cin>>n;
    int i;
    cin>>bars[0];
    fromLeft[0] = bars[0];
    sumBars = bars[0];
    For(i,n-1){
        cin>>bars[i+1];
        fromLeft[i+1] = fromLeft[i] + bars[i+1];
        sumBars += bars[i+1];
    }
    if(n == 1){
        cout<<1<<' '<<0;
        return 0;
    }
    if(n == 2){
        cout<<1<<' '<<1;
        return 0;
    }
    if(fromLeft[n-2] < bars[n-1]){
        cout<<n-1<<' '<<1;
        return 0;
    }
    if(bars[0] > fromLeft[n-1] - bars[0]){
        cout<<1<<' '<<n-1;
        return 0;
    }
    fromRight = bars[n-1];
    for(i=n-2;i>0;i--){
        if(abs(fromLeft[i-1] - fromRight) == 0){
            cout<<i+1<<' '<<n-i-1;
            return 0;
        }
        else if(abs(fromLeft[i-1] - fromRight) <= bars[i]){
            if(fromLeft[i-1] < fromRight)
                cout<<i+1<<' '<<n-i-1;
            else
                cout<<i<<' '<<n-i;
            return 0;
        }
        fromRight+=bars[i];
    }

    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string>
#include <fstream>

#define fs first
#define sc second
#define sz size()
#define pb push_back
#define mp make_pair
#define For(i,n) for(i=0;i<n;i++)

using namespace std;
ifstream fin("a.in");

/*
 *
 */

#define NMAX 100000
int n,fromLeft[NMAX],fromRight,bars[NMAX],sumBars;

int main(){
    cin>>n;
    int i;
    cin>>bars[0];
    fromLeft[0] = bars[0];
    sumBars = bars[0];
    For(i,n-1){
        cin>>bars[i+1];
        fromLeft[i+1] = fromLeft[i] + bars[i+1];
        sumBars += bars[i+1];
    }
    if(n == 1){
        cout<<1<<' '<<0;
        return 0;
    }
    if(n == 2){
        cout<<1<<' '<<1;
        return 0;
    }
    fromRight = bars[n-1];
    for(i=n-1;i>0;i--){
        if(abs(fromLeft[i-1] - fromRight) < bars[i]){
            if(fromLeft[i-1] < fromRight)
                cout<<i+1<<' '<<n-i-1;
            else
                cout<<i<<' '<<n-i;
            return 0;
        }
        else if(abs(fromLeft[i-1] - fromRight) == bars[i]){
            cout<<i+1<<' '<<n-i-1;
            return 0;
        }
    }

    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string>
#include <fstream>

#define fs first
#define sc second
#define sz size()
#define pb push_back
#define mp make_pair
#define For(i,n) for(i=0;i<n;i++)

using namespace std;
ifstream fin("a.in");

/*
 *
 */

#define NMAX 100000
int n,fromLeft[NMAX],fromRight,bars[NMAX],sumBars;

int main(){
    cin>>n;
    int i;
    cin>>bars[0];
    fromLeft[0] = bars[0];
    sumBars = bars[0];
    For(i,n-1){
        cin>>bars[i+1];
        fromLeft[i+1] = fromLeft[i] + bars[i+1];
        sumBars += bars[i+1];
    }
    if(n == 1){
        cout<<1<<' '<<0;
        return 0;
    }
    if(n == 2){
        cout<<1<<' '<<1;
        return 0;
    }
    if(fromLeft[n-2] < bars[n-1]){
        cout<<n-1<<' '<<1;
        return 0;
    }
    if(bars[0] > fromLeft[n-1] - bars[0]){
        cout<<1<<' '<<n-1;
        return 0;
    }
    fromRight = bars[n-1];
    for(i=n-2;i>0;i--){
        if(abs(fromLeft[i-1] - fromRight) == 0){
            cout<<i+1<<' '<<n-i-1;
            return 0;
        }
        else if(abs(fromLeft[i-1] - fromRight) < bars[i]){
            if(fromLeft[i-1] < fromRight)
                cout<<i+1<<' '<<n-i-1;
            else
                cout<<i<<' '<<n-i;
            return 0;
        }

    }

    return 0;
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string>
#include <fstream>

#define fs first
#define sc second
#define sz size()
#define pb push_back
#define mp make_pair
#define For(i,n) for(i=0;i<n;i++)

using namespace std;
ifstream fin("a.in");

/*
 *
 */

#define NMAX 100000
int n,fromLeft[NMAX],fromRight,bars[NMAX],sumBars;

int main(){
    cin>>n;
    int i;
    cin>>bars[0];
    fromLeft[0] = bars[0];
    sumBars = bars[0];
    For(i,n-1){
        cin>>bars[i+1];
        fromLeft[i+1] = fromLeft[i] + bars[i+1];
        sumBars += bars[i+1];
    }
    if(n == 1){
        cout<<1<<' '<<0;
        return 0;
    }
    if(n == 2){
        cout<<1<<' '<<1;
        return 0;
    }
    if(fromLeft[n-2] < bars[n-1]){
        cout<<n-1<<' '<<1;
        return 0;
    }
    if(bars[0] > fromLeft[n-1] - bars[0]){
        cout<<1<<' '<<n-1;
        return 0;
    }
    fromRight = bars[n-1];
    for(i=n-2;i>0;i--){
        if(abs(fromLeft[i-1] - fromRight) == 0){
            cout<<i+1<<' '<<n-i-1;
            return 0;
        }
        else if(abs(fromLeft[i-1] - fromRight) < bars[i]){
            if(fromLeft[i-1] < fromRight)
                cout<<i+1<<' '<<n-i-1;
            else
                cout<<i<<' '<<n-i;
            return 0;
        }
        fromRight+=bars[i];
    }

    return 0;
}


/**
 *
 *   Может быть грешно было убивать рыбу.
 *   Думаю, что грешно, хоть я и убил ее для того,
 *   чтобы не умереть с голоду и накормить еще уйму людей.
 *   В таком случае все, что ты делаешь грешно...
 *   Пусть грехами занимаются те, кому за это платят.
 *   Ты родился чтобы стать рыбаком, также
 *   как рыба родилась чтобы стать рыбой...
 *
 *   Эрнест Хэмингуэй, "Старик и море"
 *
 */

//#include <bits/stdc++.h>

#include <functional>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <cstdlib>
#include <utility>
#include <cstring>
#include <bitset>
#include <locale>
#include <cctype>
#include <time.h>
#include <vector>
#include <cstdio>
#include <string>
#include <deque>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>

#define sz(s) (int)((s).size())
#define ms(a) memset((a), 0, sizeof((a)))
#define tr(c, it) for(typeof(c.begin()) it = c.begin(); it != c.end(); it ++)
#define NAME ""
#define ALL(v) (v.begin(), v.end())

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

const double PI = 3.1415926535897932384626433832795;
const double EPS = 1e-9;
const int INF = (int)1e9;
const int N = 123456;

int a[N], b[N];
void solve(){
    int cntA = 0, cntB = 0;
    int n, i;

    scanf("%d", &n);
    for(i = 1; i <= n; i ++){
        scanf("%d", a + i);
        b[i] = a[i];
    }

    if(n == 1){
        printf("1 0");
        exit(0);
    }

    int A = 1, B = n;
    while(n > 0){
        a[A] --, a[B] --;

        if(a[A] <= 0){
            cntA ++;

            if(A + 1 == B){
                cntB ++;
                break;
            }

            A ++, n --;
        }

        if(a[B] <= 0){
            cntB ++;

            if(B - 1 == A){
                cntA ++;
                break;
            }

            B --, n --;
        }
    }

    printf("%d %d\n", cntA, cntB);
}

int main() {
    #ifdef ONLINE_JUDJE
        freopen(NAME".in", "r", stdin);
        freopen(NAME".out", "w", stdout);
    #endif

    #ifdef TESTER AND ACMP
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif

    int tests = 1;
    //scanf("%d", &tests);
    while(tests --){
        //gen();
        solve();
    }
    return 0;
}


/**
 *
 *   ����� ���� ������ ���� ������� ����.
 *   �����, ��� ������, ���� � � ���� �� ��� ����,
 *   ����� �� ������� � ������ � ��������� ��� ���� �����.
 *   � ����� ������ ���, ��� �� ������� ������...
 *   ����� ������� ���������� ��, ���� �� ��� ������.
 *   �� ������� ����� ����� �������, �����
 *   ��� ���� �������� ����� ����� �����...
 *
 *   ������ ���������, "������ � ����"
 *
 */

//#include <bits/stdc++.h>

#include <functional>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <cstdlib>
#include <utility>
#include <cstring>
#include <bitset>
#include <locale>
#include <cctype>
#include <time.h>
#include <vector>
#include <cstdio>
#include <string>
#include <deque>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>

#define sz(s) (int)((s).size())
#define ms(a) memset((a), 0, sizeof((a)))
#define tr(c, it) for(typeof(c.begin()) it = c.begin(); it != c.end(); it ++)
#define NAME ""
#define ALL(v) (v.begin(), v.end())

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

const double PI = 3.1415926535897932384626433832795;
const double EPS = 1e-9;
const int INF = (int)1e9;
const int N = 123456;

int a[N], b[N];
void solve(){
    int cntA = 0, cntB = 0;
    int n, i;

    scanf("%d", &n);
    for(i = 1; i <= n; i ++){
        scanf("%d", a + i);
        b[i] = a[i];
    }

    int A = 1, B = n;
    while(n > 0){
        a[A] --, a[B] --;
        if(!a[A]){
            cntA ++;

            if(A + 1 == B){
                cntB ++;
                break;
            }

            A ++, n --;
        }

        if(!a[B]){
            cntB ++;

            if(B - 1 == A){
                cntA ++;
                break;
            }

            B --, n --;
        }
    }

    printf("%d %d\n", cntA, cntB);
}

int main() {
    #ifdef ONLINE_JUDJE
    	freopen(NAME".in", "r", stdin);
    	freopen(NAME".out", "w", stdout);
    #endif

    #ifdef TESTER AND ACMP
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif

    int tests = 1;
    //scanf("%d", &tests);
    while(tests --){
        //gen();
        solve();
    }
    return 0;
}


#include <iostream>

using namespace std;

int main(int argc, char *argv[]) {
  int n;
  cin >> n;

  int vals[n];

  for (int i = 0; i < n; i++)
    cin >> vals[i];

  int first = 0, second = 0;
  int ind1 = 0, ind2 = n-1;

  if (n == 1) {
    cout << 1 << " " << 0 << endl;
    return 0;
  }

  while (true) {
    bool firstSwitched = false;
    bool secondSwitched = false;
    if (ind1 != ind2) {
      if (vals[ind1] == 0) {
	if (vals[ind2] != 0)
	  second++;
	break;
      }
      if (vals[ind2] == 0) {
	if (vals[ind1] != 0)
	  first++;
	break;
      }

      vals[ind1]--;
      vals[ind2]--;

      if (vals[ind1] == 0) {
	ind1++;
	first++;
	firstSwitched = true;
      }
      if (vals[ind2] == 0) {
	ind2--;
	second++;
	secondSwitched = true;
      }

      if (firstSwitched && secondSwitched &&
	  ind1 == ind2) {
	first++;
	break;
      }
      else if (firstSwitched && !secondSwitched &&
	       ind1 == ind2) {
	if (vals[ind2] != 0) {
	  second++;
	  break;
	}
      }
      else if (!firstSwitched && secondSwitched &&
	       ind1 == ind2) {
	if (vals[ind1] != 0) {
	  first++;
	  break;
	}
      }
    }
  }

  cout << first << " " << second << endl;
}


#include <iostream>

using namespace std;

int main(int argc, char *argv[]) {
  int n;
  cin >> n;

  int vals[n];

  for (int i = 0; i < n; i++)
    cin >> vals[i];

  int first = 0, second = 0;
  int ind1 = 0, ind2 = n-1;

  while (true) {
    bool firstSwitched = false;
    bool secondSwitched = false;
    if (ind1 != ind2) {
      vals[ind1]--;
      vals[ind2]--;

      if (vals[ind1] == 0) {
	ind1++;
	first++;
	firstSwitched = true;
      }
      if (vals[ind2] == 0) {
	ind2--;
	second++;
	secondSwitched = true;
      }

      if (firstSwitched && secondSwitched &&
	  ind1 == ind2) {
	first++;
	break;
      }
      else if (firstSwitched && !secondSwitched &&
	       ind1 == ind2) {
	if (vals[ind2] != 0) {
	  second++;
	  break;
	}
      }
      else if (!firstSwitched && secondSwitched &&
	       ind1 == ind2) {
	if (vals[ind1] != 0) {
	  first++;
	  break;
	}
      }
    }
  }

  cout << first << " " << second << endl;
}


#include <iostream>

using namespace std;

int main(int argc, char *argv[]) {
  int n;
  cin >> n;

  int vals[n];

  for (int i = 0; i < n; i++)
    cin >> vals[i];

  int first = 0, second = 0;
  int ind1 = 0, ind2 = n-1;

  if (n == 1) {
    cout << 1 << " " << 0 << endl;
    return 0;
  }

  while (true) {
    bool firstSwitched = false;
    bool secondSwitched = false;
    if (ind1 != ind2) {
      vals[ind1]--;
      vals[ind2]--;

      if (vals[ind1] == 0) {
	ind1++;
	first++;
	firstSwitched = true;
      }
      if (vals[ind2] == 0) {
	ind2--;
	second++;
	secondSwitched = true;
      }

      if (firstSwitched && secondSwitched &&
	  ind1 == ind2) {
	first++;
	break;
      }
      else if (firstSwitched && !secondSwitched &&
	       ind1 == ind2) {
	if (vals[ind2] != 0) {
	  second++;
	  break;
	}
      }
      else if (!firstSwitched && secondSwitched &&
	       ind1 == ind2) {
	if (vals[ind1] != 0) {
	  first++;
	  break;
	}
      }
    }
  }

  cout << first << " " << second << endl;
}


// #include <assert.h>
#include <iostream>

#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cstdlib>

using namespace std;

namespace detail {

const int maxn = 200001;

// Point

struct Point
{
    int x, y;
    Point* next;
};

typedef Point* PointPtr;

template<typename T>
void nullify(T* pointer)
{
    memset(static_cast<void*>(pointer), 0, sizeof(T));
}

// point stack interface //

PointPtr headPS;
Point points[maxn];

void absorbPS(PointPtr point)
{
    point->next = headPS;
    headPS = point;
}

PointPtr providePS(int x, int y)
{
    PointPtr result = headPS;
    headPS = headPS->next;

    nullify(result);
    result->x = x;
    result->y = y;

    return result;
}

void initPS()
{
    headPS = nullptr;
    for (int i = 0; i < maxn; i++)
        absorbPS(&points[i]);
}

// point problem related staff //

PointPtr insertP(PointPtr head, int x, int y)
{
    auto point = providePS(x, y);
    point->next = head;
    return point;
}

PointPtr removeP(PointPtr head, int x, int y)
{
    if (!head)
        return nullptr;

    if (head->x == x && head->y == y) {
        PointPtr temp = head->next;
        absorbPS(head);
        return temp;
    }

    head->next = removeP(head->next, x, y);
    return head;
}

// Node

struct Node
{
    int lowx;
    int lowy;

    int num;

    Point* point;
    Node* nodes[2][2];
};

typedef Node* NodePtr;

// node stack interface //

NodePtr headNS;
Node nodes[maxn];

void absorbN(NodePtr node)
{
    node->nodes[0][0] = headNS;
    headNS = node;
}

NodePtr provideN(int x, int y)
{
    NodePtr result = headNS;
    headNS = headNS->nodes[0][0];

    nullify(result);
    result->lowx = x;
    result->lowy = y;
    result->num = 0;

    return result;
}

void initNS()
{
    headNS = nullptr;
    for (int i = 0; i < maxn; i++)
        absorbN(&nodes[i]);
}

// bitmask-tree interface //

Node rootNT;

int findx, findy;

inline bool less(int xl, int yl, int xr, int yr)
{
    return xl < xr || (xl == xr && yl < yr);
}

void relax(int* x, int* y, int nx, int ny)
{
    if (less(nx, ny, *x, *y)) {
        *x = nx;
        *y = ny;
    }
}

const int maxSimple = 10;

void addNT(NodePtr root, int x, int y, int pow);

void addNTAsNode(NodePtr root, int x, int y, int pow)
{
    root->num++;

    int idx = (x & pow) ? 1 : 0;
    int idy = (y & pow) ? 1 : 0;

    NodePtr& dst = root->nodes[idx][idy];

    if (!dst)
        dst = provideN(x, y);

    addNT(dst, x, y, pow >> 1);
}

void addNT(NodePtr root, int x, int y, int pow)
{
    relax(&root->lowx, &root->lowy, x, y);

    if (root->num <= 0 && root->num > -maxSimple) {
        root->point = insertP(root->point, x, y);
        root->num--;
        return;
    }

    // assert(pow > 1);

    if (root->num == -maxSimple) {
        root->num = 0;
        for (int i = 0; i < maxSimple; i++) {
            int rx = root->point->x;
            int ry = root->point->y;
            root->point = removeP(root->point, rx, ry);
            addNTAsNode(root, rx, ry, pow);
        }
    }

    // assert(root->num > 0);
    addNTAsNode(root, x, y, pow);
}

void removeNT(NodePtr root, int x, int y, int pow)
{
    // assert(root->num != 0);

    root->lowx = 1 << 30;

    if (root->num < 0) {
        root->num++;
        root->point = removeP(root->point, x, y);

        if (root->num == 0)
            return;

        for (auto point = root->point; point; point = point->next)
            relax(&root->lowx, &root->lowy, point->x, point->y);

        return;
    }

    // assert(pow > 1);

    root->num--;

    int idx = (x & pow) ? 1 : 0;
    int idy = (y & pow) ? 1 : 0;

    NodePtr& dst = root->nodes[idx][idy];
    removeNT(dst, x, y, pow >> 1);

    if (dst->num == 0) {
        absorbN(dst);
        dst = nullptr;
    }

    for (int ix = 0; ix < 2; ix++)
        for (int iy = 0; iy < 2; iy++) {
            auto dst = root->nodes[ix][iy];
            if (dst)
                relax(&root->lowx, &root->lowy, dst->lowx, dst->lowy);
        }
}

void findNT(NodePtr root, int x, int y, int pow)
{
    if (root->num == 0)
        return;

    // cout << "pow=" << pow << " x=" << x << " y=" << y << " num=" << root->num << " ";
    // cout << "lx = " << root->lowx << " ly = " << root->lowy << " ";
    // cout << "fx = " << findx << " fy = " << findy << endl;

    if (less(findx, findy, root->lowx, root->lowy))
        return;

    if (x <= root->lowx && y <= root->lowy) {
        relax(&findx, &findy, root->lowx, root->lowy);
        return;
    }

    if (root->num > 0) {
        int idx = (x & pow) ? 1 : 0;
        int idy = (y & pow) ? 1 : 0;

        int restx = x & ((2 << pow) - 1);
        int resty = y & ((2 << pow) - 1);

        for (int ix = idx; ix < 2; ix++)
            for (int iy = idy; iy < 2; iy++) {
                int nx = ix == idx ? x : 0;
                int ny = iy == idy ? y : 0;
                if (root->nodes[ix][iy]) {
                    // cout << "ix = " << ix << " iy = " << iy << endl;
                    findNT(root->nodes[ix][iy], nx, ny, pow >> 1);
                }
            }

        return;
    }

    // assert(root->num < 0);

    for (auto point = root->point; point; point = point->next)
        if (x <= point->x && y <= point->y)
            relax(&findx, &findy, point->x, point->y);
}

// problem interface //

// void dfs(NodePtr rootNT, int x, int y, string xs, string ys)
// {
//     for (int ix = 0; ix < 2; ix++)
//         for (int iy = 0; iy < 2; iy++) {
//             int newx = x + ix * rootNT->pow;
//             int newy = y + iy * rootNT->pow;

//             string newxs = xs + to_string(ix);
//             string newys = ys + to_string(iy);

//             if (rootNT->child[ix][iy] && rootNT->pow > 1)
//                 dfs(rootNT->child[ix][iy], newx, newy, newxs, newys);

//             if (rootNT->child[ix][iy] && rootNT->pow == 1) {
//                 cout << "x=" << newx << ", ";
//                 cout << "y=" << newy << ", ";
//                 cout << "xs=" << newxs << ", ";
//                 cout << "ys=" << newys << "\n";
//             }

//         }
// }

// Node rootNT;

} // detail

void initialize()
{
    detail::nullify(&detail::rootNT);
    detail::initPS();
    detail::initNS();
}

void add(int x, int y)
{
    detail::addNT(&detail::rootNT, x, y, 1 << 29);
    // Nodes::dfs(&Nodes::rootNT, 0, 0, "", "");
}

void remove(int x, int y)
{
    detail::removeNT(&detail::rootNT, x, y, 1 << 29);
    // Nodes::dfs(&Nodes::rootNT, 0, 0, "", "");
}

void find(int x, int y)
{
    detail::findx = 1 << 30;
    detail::findNT(&detail::rootNT, x + 1, y + 1, 1 << 29);
    if (detail::findx == (1 << 30))
        printf("-1\n");
    else
        printf("%d %d\n", detail::findx, detail::findy);
}

int main()
{
    initialize();

    int n, x, y;
    char command[15];

    scanf("%d\n", &n);
    for (int i = 0; i < n; i++) {
        scanf("%s %d %d\n", command, &x, &y);

        if (command[0] == 'a')
            add(x, y);

        if (command[0] == 'r')
            remove(x, y);

        if (command[0] == 'f')
            find(x, y);
    }

    return 0;
}


#include <cstdio>
#include <algorithm>

using namespace std;

const size_t maxn = 100001;

int t[maxn];

int main()
{
    int n;
    scanf("%d", &n);

    for (int i = 0; i < n; i++)
        scanf("%d", &t[i]);

    if (n == 1) {
        printf("1 0\n");
        return 0;
    }

    int a = 0;
    int b = n-1;

    while (a + 1 < b) {
        int mt = min(t[a], t[b]);
        t[a] -= mt;
        t[b] -= mt;

        if (t[a] == 0)
            a++;

        if (a + 1 == b)
            break;

        if (t[b] == 0)
            b--;
    }

    printf("%d %d\n", a + 1, n - b);
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n;
int a = 0, b;
int main() {
  cin >> n;
  if (n==1) {
    cout << 1 << ' ' << 0 << endl;
    return 0;
  }
  b = n-1;
  vector<int> v(n);
  for (int i = 0; i < n; i++)
    cin >> v[i];

  while(true) {
    if (!v[a]) {
      if (a+1==b)
        break;
      a++;
    }
    if (!v[b]) {
      if (b-1==a)
        break;
      b--;
    }
    v[a]--;
    v[b]--;
  }
  cout << a+1 << ' ' << n-a-1 << endl;
}


#include <cstdio>
#include <algorithm>
using namespace std;

int a[100000];

int main(){
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++) scanf("%d",&a[i]);
    int lp=0,lt=0,rp=n-1,rt=0;
    while(lp<=rp) if(lt<=rt) lt+=a[lp++]; else rt+=a[rp--];
    printf("%d %d\n",lp,n-lp);
}


#include<bits/stdc++.h>
#define si(n)scanf("%d",&n)
#define sll(n)scanf("%I64d",&n)
#define pi(n)printf("%d\n",n)
#define pll(n)printf("%I64d\n",n)
//@author Jaydeep Maddipati
using namespace std;using ll=long long;
deque<int>dq;
int main(){
   int n,val;si(n);
   for(int i=0;i<n;i++){
    si(val);dq.push_back(val);
   }
   int await=0,bwait=0,aate=0,bate=0;
   while(!dq.empty()){
        if(await!=0)await--;
        if(bwait!=0)bwait--;
        if(await==0){
            await=dq[0];aate++;dq.pop_front();
        }
        if(bwait==0){
            if(!dq.empty()){
                bwait=dq[dq.size()-1];bate++;dq.pop_back();
            }
            else break;
        }

   }
   printf("%d %d\n",aate,bate);
    return 0;
}


#include <cstdio>
#include <cstring>

int n;
int cho[100100];

int main() {
	while (1 == scanf("%d", &n)) {
		for (int i = 0; i < n; ++i)
			scanf("%d", cho + i);
		int s1 = 0, s2 = 0;
		int las = 3;
		int a, b;
		for (a = 0, b = n-1; a < b; ) {
			if (cho[a] < cho[b]) {
				cho[b] -= cho[a];
				a++;
				s1++;
				las = 1;
			}
			else if (cho[a] > cho[b]) {
				cho[a] -= cho[b];
				b--;
				s2++;
				las = 2;
			}
			else if (cho[a] == cho[b]) {
				a++;
				b--;
				s1++;
				s2++;
				las = 3;
			}
		}
		if (a == b) {
			if (las == 2 || las == 3) s1++;
			else s2++;
		}
		printf("%d %d\n", s1, s2);
	}
}


# include <iostream>
# include <cstdio>
# include <cstdlib>
# include <vector>
# include <string>
# include <cmath>
# include <algorithm>
# include <iomanip>
# include <deque>
# include <queue>
# include <stack>
# include <numeric>
# include <ios>
# include <set>
# include <map>
# include <sstream>
# include <iterator>
# include <limits>
# include <cstring>
# include <string.h>
# include <list>
# include <bitset>
# include <climits>
# include <cassert>

# define INF numeric_limits<long double>::infinity()
# define Fi 1.6180339887
# define eps 1e-6
# define quadro __float128
# define abc() printf("\nUnexpected in \"%s\" at line %d\n", __func__, __LINE__)

# define startt clock_t start,end; start = clock()
# define endt end = clock(); printf("\nFunction \"%s\" executed in %.2f seconds\n", __func__, (float)(end-start)/CLOCKS_PER_SEC)
# define checktime() startt; init(); endt

using namespace std;

template <typename T> class Point { public: T x,y,pos;  Point<T>(const T& a, const T& b){x = a; y = b;} Point<T>(){ Point<T>(0,0);} };

template <typename T> void read(T& val) { cin >> val; }
template <typename T> void read(vector<T>& vec) { for(int i=0; i<vec.size(); ++i) read(vec[i]); }
template <typename T> void print(const T& val) { cout << val << " " ; }
template <typename T> void print(const vector<T>& vec) { for(int i=0; i<vec.size(); ++i) { print(vec[i]); } cout << endl; }
template <typename T> string toString(const T& val) { ostringstream ostr; ostr << val; return ostr.str(); }
long double fromString(const string& str) { long double res; istringstream(str) >> res; return res; }

inline bool isDigit(const char& ch) { return (ch >= '0' && ch <='9'); }
inline bool isAlpha(const char& ch) { return (ch >= 'a' && ch <='z' || ch >='A' && ch <= 'Z'); }
inline string trimString(string& str){ while(*str.begin()==' ') { str.erase(str.begin()); } while(*str.rbegin()==' ') {str.erase(str.end()-1); } return str;}
void skip() { while (cin.peek() == ' ' || cin.peek() == '\n' || cin.peek() == '\r' || cin.peek() == '\t') cin.get(); }

void init()
{
    int n; cin >> n;
    vector<int> vec(n);
    read(vec);

    long long Alice=0, Bob = 0;
    int apos = 0, bpos = vec.size()-1;

    while( apos != bpos)
    {
        if (Alice <= Bob)
        {
            Alice += vec[apos];
            ++apos;
        }
        else
        {
            Bob += vec[bpos];
            --bpos;
        }
    }

    cout << apos << " " << vec.size()-bpos;
}

void test()
{

}

int main()
{
    //freopen ("/home/idainet/code/in.txt", "r", stdin);
//    freopen ("/home/idainet/code/out.txt", "w", stdout);

    //checktime();
    init();

    //test();

    fflush(stdout);
    return 0;
}


# include <iostream>
# include <cstdio>
# include <cstdlib>
# include <vector>
# include <string>
# include <cmath>
# include <algorithm>
# include <iomanip>
# include <deque>
# include <queue>
# include <stack>
# include <numeric>
# include <ios>
# include <set>
# include <map>
# include <sstream>
# include <iterator>
# include <limits>
# include <cstring>
# include <string.h>
# include <list>
# include <bitset>
# include <climits>
# include <cassert>

# define INF numeric_limits<long double>::infinity()
# define Fi 1.6180339887
# define eps 1e-6
# define quadro __float128
# define abc() printf("\nUnexpected in \"%s\" at line %d\n", __func__, __LINE__)

# define startt clock_t start,end; start = clock()
# define endt end = clock(); printf("\nFunction \"%s\" executed in %.2f seconds\n", __func__, (float)(end-start)/CLOCKS_PER_SEC)
# define checktime() startt; init(); endt

using namespace std;

template <typename T> class Point { public: T x,y,pos;  Point<T>(const T& a, const T& b){x = a; y = b;} Point<T>(){ Point<T>(0,0);} };

template <typename T> void read(T& val) { cin >> val; }
template <typename T> void read(vector<T>& vec) { for(int i=0; i<vec.size(); ++i) read(vec[i]); }
template <typename T> void print(const T& val) { cout << val << " " ; }
template <typename T> void print(const vector<T>& vec) { for(int i=0; i<vec.size(); ++i) { print(vec[i]); } cout << endl; }
template <typename T> string toString(const T& val) { ostringstream ostr; ostr << val; return ostr.str(); }
long double fromString(const string& str) { long double res; istringstream(str) >> res; return res; }

inline bool isDigit(const char& ch) { return (ch >= '0' && ch <='9'); }
inline bool isAlpha(const char& ch) { return (ch >= 'a' && ch <='z' || ch >='A' && ch <= 'Z'); }
inline string trimString(string& str){ while(*str.begin()==' ') { str.erase(str.begin()); } while(*str.rbegin()==' ') {str.erase(str.end()-1); } return str;}
void skip() { while (cin.peek() == ' ' || cin.peek() == '\n' || cin.peek() == '\r' || cin.peek() == '\t') cin.get(); }

void check(int x, int y, queue<Point<int>>& que, char& cur, char p, map<char,bool>& sub)
{
    if (cur == p)
    {
        que.push( Point<int> (x,y) );
    }
    else if ( isAlpha(cur) )
    {
        sub[cur] = true;
    }

    cur = '.';
}

void init()
{
    int n;
    vector<int> vec(n);
    read(vec);

    long long Alice=0, Bob = 0;
    int apos = 0, bpos = vec.size()-1;

    while( apos != bpos)
    {
        if (Alice <= Bob)
        {
            Alice += vec[apos];
            ++apos;
        }
        else
        {
            Bob += vec[bpos];
            --bpos;
        }
    }

    cout << Alice << " " << Bob;
}

void test()
{

}

int main()
{
    //freopen ("/home/idainet/code/in.txt", "r", stdin);
//    freopen ("/home/idainet/code/out.txt", "w", stdout);

    //checktime();
    init();

    //test();

    fflush(stdout);
    return 0;
}


# include <iostream>
# include <cstdio>
# include <cstdlib>
# include <vector>
# include <string>
# include <cmath>
# include <algorithm>
# include <iomanip>
# include <deque>
# include <queue>
# include <stack>
# include <numeric>
# include <ios>
# include <set>
# include <map>
# include <sstream>
# include <iterator>
# include <limits>
# include <cstring>
# include <string.h>
# include <list>
# include <bitset>
# include <climits>
# include <cassert>

# define INF numeric_limits<long double>::infinity()
# define Fi 1.6180339887
# define eps 1e-6
# define quadro __float128
# define abc() printf("\nUnexpected in \"%s\" at line %d\n", __func__, __LINE__)

# define startt clock_t start,end; start = clock()
# define endt end = clock(); printf("\nFunction \"%s\" executed in %.2f seconds\n", __func__, (float)(end-start)/CLOCKS_PER_SEC)
# define checktime() startt; init(); endt

using namespace std;

template <typename T> class Point { public: T x,y,pos;  Point<T>(const T& a, const T& b){x = a; y = b;} Point<T>(){ Point<T>(0,0);} };

template <typename T> void read(T& val) { cin >> val; }
template <typename T> void read(vector<T>& vec) { for(int i=0; i<vec.size(); ++i) read(vec[i]); }
template <typename T> void print(const T& val) { cout << val << " " ; }
template <typename T> void print(const vector<T>& vec) { for(int i=0; i<vec.size(); ++i) { print(vec[i]); } cout << endl; }
template <typename T> string toString(const T& val) { ostringstream ostr; ostr << val; return ostr.str(); }
long double fromString(const string& str) { long double res; istringstream(str) >> res; return res; }

inline bool isDigit(const char& ch) { return (ch >= '0' && ch <='9'); }
inline bool isAlpha(const char& ch) { return (ch >= 'a' && ch <='z' || ch >='A' && ch <= 'Z'); }
inline string trimString(string& str){ while(*str.begin()==' ') { str.erase(str.begin()); } while(*str.rbegin()==' ') {str.erase(str.end()-1); } return str;}
void skip() { while (cin.peek() == ' ' || cin.peek() == '\n' || cin.peek() == '\r' || cin.peek() == '\t') cin.get(); }

void init()
{
    int n; cin >> n;
    vector<int> vec(n);
    read(vec);

    long long Alice=0, Bob = 0;
    int apos = 0, bpos = vec.size()-1;

    while( apos <= bpos)
    {
        if (Alice <= Bob)
        {
            Alice += vec[apos];
            ++apos;
        }
        else
        {
            Bob += vec[bpos];
            --bpos;
        }
    }

    cout << apos << " " << vec.size()-apos;
}

void test()
{

}

int main()
{
    //freopen ("/home/idainet/code/in.txt", "r", stdin);
//    freopen ("/home/idainet/code/out.txt", "w", stdout);

    //checktime();
    init();

    //test();

    fflush(stdout);
    return 0;
}


# include <iostream>
# include <cstdio>
# include <cstdlib>
# include <vector>
# include <string>
# include <cmath>
# include <algorithm>
# include <iomanip>
# include <deque>
# include <queue>
# include <stack>
# include <numeric>
# include <ios>
# include <set>
# include <map>
# include <sstream>
# include <iterator>
# include <limits>
# include <cstring>
# include <string.h>
# include <list>
# include <bitset>
# include <climits>
# include <cassert>

# define INF numeric_limits<long double>::infinity()
# define Fi 1.6180339887
# define eps 1e-6
# define quadro __float128
# define abc() printf("\nUnexpected in \"%s\" at line %d\n", __func__, __LINE__)

# define startt clock_t start,end; start = clock()
# define endt end = clock(); printf("\nFunction \"%s\" executed in %.2f seconds\n", __func__, (float)(end-start)/CLOCKS_PER_SEC)
# define checktime() startt; init(); endt

using namespace std;

template <typename T> class Point { public: T x,y,pos;  Point<T>(const T& a, const T& b){x = a; y = b;} Point<T>(){ Point<T>(0,0);} };

template <typename T> void read(T& val) { cin >> val; }
template <typename T> void read(vector<T>& vec) { for(int i=0; i<vec.size(); ++i) read(vec[i]); }
template <typename T> void print(const T& val) { cout << val << " " ; }
template <typename T> void print(const vector<T>& vec) { for(int i=0; i<vec.size(); ++i) { print(vec[i]); } cout << endl; }
template <typename T> string toString(const T& val) { ostringstream ostr; ostr << val; return ostr.str(); }
long double fromString(const string& str) { long double res; istringstream(str) >> res; return res; }

inline bool isDigit(const char& ch) { return (ch >= '0' && ch <='9'); }
inline bool isAlpha(const char& ch) { return (ch >= 'a' && ch <='z' || ch >='A' && ch <= 'Z'); }
inline string trimString(string& str){ while(*str.begin()==' ') { str.erase(str.begin()); } while(*str.rbegin()==' ') {str.erase(str.end()-1); } return str;}
void skip() { while (cin.peek() == ' ' || cin.peek() == '\n' || cin.peek() == '\r' || cin.peek() == '\t') cin.get(); }

void init()
{
    int n; cin >> n;
    vector<int> vec(n);
    read(vec);

    long long Alice=0, Bob = 0;
    int apos = 0, bpos = vec.size()-1;

    while( apos != bpos)
    {
        if (Alice <= Bob)
        {
            Alice += vec[apos];
            ++apos;
        }
        else
        {
            Bob += vec[bpos];
            --bpos;
        }
    }

    cout << Alice << " " << Bob;
}

void test()
{

}

int main()
{
    //freopen ("/home/idainet/code/in.txt", "r", stdin);
//    freopen ("/home/idainet/code/out.txt", "w", stdout);

    //checktime();
    init();

    //test();

    fflush(stdout);
    return 0;
}


# include <iostream>
# include <cstdio>
# include <cstdlib>
# include <vector>
# include <string>
# include <cmath>
# include <algorithm>
# include <iomanip>
# include <deque>
# include <queue>
# include <stack>
# include <numeric>
# include <ios>
# include <set>
# include <map>
# include <sstream>
# include <iterator>
# include <limits>
# include <cstring>
# include <string.h>
# include <list>
# include <bitset>
# include <climits>
# include <cassert>

# define INF numeric_limits<long double>::infinity()
# define Fi 1.6180339887
# define eps 1e-6
# define quadro __float128
# define abc() printf("\nUnexpected in \"%s\" at line %d\n", __func__, __LINE__)

# define startt clock_t start,end; start = clock()
# define endt end = clock(); printf("\nFunction \"%s\" executed in %.2f seconds\n", __func__, (float)(end-start)/CLOCKS_PER_SEC)
# define checktime() startt; init(); endt

using namespace std;

template <typename T> class Point { public: T x,y,pos;  Point<T>(const T& a, const T& b){x = a; y = b;} Point<T>(){ Point<T>(0,0);} };

template <typename T> void read(T& val) { cin >> val; }
template <typename T> void read(vector<T>& vec) { for(int i=0; i<vec.size(); ++i) read(vec[i]); }
template <typename T> void print(const T& val) { cout << val << " " ; }
template <typename T> void print(const vector<T>& vec) { for(int i=0; i<vec.size(); ++i) { print(vec[i]); } cout << endl; }
template <typename T> string toString(const T& val) { ostringstream ostr; ostr << val; return ostr.str(); }
long double fromString(const string& str) { long double res; istringstream(str) >> res; return res; }

inline bool isDigit(const char& ch) { return (ch >= '0' && ch <='9'); }
inline bool isAlpha(const char& ch) { return (ch >= 'a' && ch <='z' || ch >='A' && ch <= 'Z'); }
inline string trimString(string& str){ while(*str.begin()==' ') { str.erase(str.begin()); } while(*str.rbegin()==' ') {str.erase(str.end()-1); } return str;}
void skip() { while (cin.peek() == ' ' || cin.peek() == '\n' || cin.peek() == '\r' || cin.peek() == '\t') cin.get(); }

void init()
{
    int n; cin >> n;
    vector<int> vec(n);
    read(vec);

    long long Alice=0, Bob = 0;
    int apos = 0, bpos = vec.size()-1;

    while( apos <= bpos)
    {
        if (Alice <= Bob)
        {
            Alice += vec[apos];
            ++apos;
        }
        else
        {
            Bob += vec[bpos];
            --bpos;
        }
    }

    cout << apos << " " << vec.size()-bpos;
}

void test()
{

}

int main()
{
    //freopen ("/home/idainet/code/in.txt", "r", stdin);
//    freopen ("/home/idainet/code/out.txt", "w", stdout);

    //checktime();
    init();

    //test();

    fflush(stdout);
    return 0;
}


#include <bits/stdtr1c++.h>

using namespace std;

typedef long double ld;
typedef long long ll;
typedef pair<ll, ll> pii;
typedef complex<ld> pt;

int n, l, r, lt, rt;
int arr[100005];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  l = 0, r = n-1;
  while (r-l > 1) {
    if (lt+arr[l] < rt+arr[r]) {
      l++; lt+=arr[l];
    } else if (lt+arr[l] > rt+arr[r]) {
      r--; rt+=arr[r];
    } else {
      l++; r--;
    }
  }
  cout << l+1 << " " << n-r << endl;
    return 0;
}


#include <bits/stdtr1c++.h>

using namespace std;

typedef long double ld;
typedef long long ll;
typedef pair<ll, ll> pii;
typedef complex<ld> pt;

int n, l, r, lt, rt;
int arr[100005];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  l = 0, r = n-1;
  while (r-l > 1) {
    if (lt+arr[l] < rt+arr[r]) {
      l++; lt+=arr[l];
    } else if (lt+arr[l] > rt+arr[r]) {
      r--; rt+=arr[r];
    } else {
      if (r-l < 3) l++;
      else l++, r--;
    }
  }
  cout << l+1 << " " << (l == r ? 0 : n-r) << endl;
    return 0;
}


#include <bits/stdtr1c++.h>

using namespace std;

typedef long double ld;
typedef long long ll;
typedef pair<ll, ll> pii;
typedef complex<ld> pt;

int n, l, r, lt, rt;
vector<int> arr, for_res, rev_res;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x; cin >> x;
    arr.push_back(x);
  }
  for_res.resize(arr.size());
  rev_res.resize(arr.size());
  partial_sum(arr.begin(), arr.end(), for_res.begin());
  partial_sum(arr.rbegin(), arr.rend(), rev_res.begin());
  reverse(rev_res.begin(), rev_res.end());

  int mindiff = 100000000LL, idx;
  for (int k = 0; k < arr.size(); k++) {
    if (abs(rev_res[k]-for_res[k]) < mindiff) {
      mindiff = abs(rev_res[k]-for_res[k]);
      idx = k;
    }
  }
  if (rev_res[idx] < for_res[idx]) {
    cout << idx << " " << n-idx << endl;
  } else if (rev_res[idx] >= for_res[idx]) {
    cout << idx+1 << " " << n-idx-1 << endl;
  }

    return 0;
}


#include <bits/stdtr1c++.h>

using namespace std;

typedef long double ld;
typedef long long ll;
typedef pair<ll, ll> pii;
typedef complex<ld> pt;

int n, l, r, lt, rt;
vector<int> arr, for_res, rev_res;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x; cin >> x;
    arr.push_back(x);
  }
  for_res.resize(arr.size());
  rev_res.resize(arr.size());
  partial_sum(arr.begin(), arr.end(), for_res.begin());
  partial_sum(arr.rbegin(), arr.rend(), rev_res.begin());
  reverse(rev_res.begin(), rev_res.end());

  int mindiff = 100000000LL, idx;
  for (int k = 0; k < arr.size(); k++) {
    if (abs(rev_res[k]-for_res[k]) < mindiff) {
      mindiff = abs(rev_res[k]-for_res[k]);
      idx = k;
    }
  }
  if (rev_res[idx] <= for_res[idx]) {
    cout << idx << " " << n-idx << endl;
  } else if (rev_res[idx] > for_res[idx]) {
    cout << idx+1 << " " << n-idx-1 << endl;
  }

    return 0;
}


#include <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <iomanip>
#include <stdio.h>
#include <cstring>
#include <vector>
#include <math.h>
#include <queue>
#include <stack>
#include <set>
#include <map>

using namespace std;

#define all(p) (p).begin(), (p).end()
#define odd(x) ((x)&(1))
#define sqr(x) ((x)*(x))
#define fi first
#define se second

#define TASKNAME ""
#define DEBUG

typedef long long ll;

const int N = 111111;
const int INF = 1000000000, mod = 1000000007;
const ll LLINF = 1000000000000000000ll;

int a[N], pref[N], suff[N];

int main () {

    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; ++i) {
        scanf("%d", a + i);
    }

    for (int i = 0; i < n; ++i) {
        if (i > 0) pref[i] = pref[i - 1];
        pref[i] += a[i];
    }

    for (int i = n - 1; i >= 0; --i) {
        if (i < n - 1) suff[i] += suff[i + 1];
        suff[i] += a[i];
    }

    for (int i = 0; i < n; ++i) {

        if (pref[i] == suff[i]) {
            printf("%d %d\n", i + 1, n - i - 1);
            return 0;
        }

        if (pref[i] > suff[i]) {
            printf("%d %d\n", i, n - i);
            return 0;
        }

    }

    return 0;
}


/* <<< Marek Sommer >>> */

/* ====== HEADERS ====== */

#ifdef ONLINE_JUDGE
	#define MINIMAL
	#define NDEBUG
#endif

#include <bits/stdc++.h>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cassert>

#ifdef MINIMAL
	#define err(a) ;
	#define ASSERT(a) ;
#else
	void err(const char *format, ...)
	{
		va_list valist;
		va_start(valist, format);
		int ret = vfprintf(stderr, format, valist);
		va_end(valist);
	}
	#define ASSERT(a) a
#endif

using namespace std;

typedef long long int ll;
typedef long double ld;

char *_buffer = nullptr;
inline void make_buf(int a) { _buffer = new char[a]; }

#define TOSTRING_INNER(x) #x
#define TOSTRING(x) TOSTRING_INNER(x)

#ifndef PRECISION
	#define PRECISION 15
#endif
#define FLOAT_PRECISION "%." TOSTRING(PRECISION) "f"
#define DOUBLE_PRECISION "%." TOSTRING(PRECISION) "f"

inline void assert_buffer() { ASSERT( if(_buffer == nullptr) err("Use make_buf(int buffer_size); at the beginning\n"); ) }

inline void make(int &a) { if(scanf("%d", &a)); }
inline void make(float &a) { if(scanf("%f", &a)); }
inline void make(double &a) { if(scanf("%lf", &a)); }
inline void make(char *a) { if(scanf("%s", a)); }
inline void make(string &a) { assert_buffer(); if(scanf("%s", _buffer)); a = _buffer; }
inline void make(char &a) { if(scanf(" %c", &a)); }
inline void makec(char &a) { if(scanf("%c", &a)); }
#ifdef ONLINE_JUDGE
	inline void make(ll &a) { scanf("%I64d", &a); }
	inline void make(long double &a) { double _a; if(scanf("%lf", &_a)); a = _a; }
#else // NOT ONLINE_JUDGE
	inline void make(ll &a) { scanf("%lld", &a); }
	inline void make(long double &a) { if(scanf("%Lf", &a)); }
#endif
template<typename A>
inline void maketab(A *tab, int size) { for(int i = 0; i < size; i++) make(tab[i]); }
template<typename A>
inline void maketab(vector<A> &v, int size) { typedef typename vector<A>::iterator iter; v.resize(size); for(iter i = v.begin(); i != v.end(); i++) make(*i); }

template<typename A, typename B>
inline void make(A &a, B &b) { make(a); make(b); }
template<typename A, typename B, typename C>
inline void make(A &a, B &b, C &c) { make(a); make(b); make(c); }
template<typename A, typename B, typename C, typename D>
inline void make(A &a, B &b, C &c, D &d) { make(a); make(b); make(c); make(d); }
template<typename A, typename B, typename C, typename D, typename E>
inline void make(A &a, B &b, C &c, D &d, E &e) { make(a); make(b); make(c); make(d); make(e); }

bool line(char *s) { return scanf("%[^\n]\n", s) != EOF; }
bool line(string &s) { assert_buffer(); bool ret = line(_buffer); s = _buffer; return ret; }
bool wline(char *s) { char c; int i = 0; while(scanf("%c", &c) != EOF) { if(c == '\n') { s[i] = 0; return true; } s[i++] = c; } s[i] = 0; return false; }
bool wline(string &s) { assert_buffer(); bool ret = wline(_buffer); s = _buffer; return ret; }

// ====== OUTPUT ======

#define MAKE_OUT(arg_type, format, args...) \
inline void out(arg_type) { printf(format, args); }\
inline void outn(arg_type) { printf(format "\n", args); }\
inline void outs(arg_type) { printf(format " ", args); }

inline void outn() { printf("\n"); }
inline void outs() { printf(" "); }

MAKE_OUT(unsigned int a, "%u", a);
MAKE_OUT(int a, "%d", a);
MAKE_OUT(float a, FLOAT_PRECISION, a);
MAKE_OUT(double a, DOUBLE_PRECISION, a);
MAKE_OUT(long double a, DOUBLE_PRECISION, (double) a);
MAKE_OUT(const char *a, "%s", a);
MAKE_OUT(const string &a, "%s", a.c_str());
MAKE_OUT(char c, "%c", c);
typedef pair<int, int> pair_int_int;
MAKE_OUT(const pair_int_int &p, "%d %d", p.first, p.second);
#ifdef ONLINE_JUDGE
	MAKE_OUT(ll a, "%I64d", a);
#else // NOT ONLINE_JUDGE
	MAKE_OUT(ll a, "%lld", a);
	MAKE_OUT(size_t a, "%zu", a);
#endif

template<typename T, typename A> inline void out(const vector<T, A> &v)
{
	auto i = v.begin();
	if(i == v.end())
	{
		outn();
		return;
	}
	for(; i + 1 != v.end(); i++)
		outs(*i);
	outn(*i);
}
template<typename T, typename A> inline void outs(const vector<T, A> &v)
{
	auto i = v.begin();
	if(i == v.end())
	{
		outn();
		return;
	}
	for(; i + 1 != v.end(); i++)
		out(*i), out(", ");
	outn(*i);
}
template<typename T, typename A> inline void outn(const vector<T, A> &v)
{
	for(auto i = v.begin(); i != v.end(); i++)
		outn(*i);
}

#ifdef ONLINE_JUDGE
	#define M_PI (3.14159265358979323846l)
#else // NOT ONLINE_JUDGE
#endif

#define ter(a) { out(a); exit(0); }
#define tern(a) { outn(a); exit(0); }
#define ters(a) { outs(a); exit(0); }

/* ====== CODE ====== */

int tab[100005];

int main()
{
	int n;
	make(n);
	maketab(tab + 1, n);
	int ost = n + 1;
	ll suma = 0ll, sumb = 0ll;
	for(int i = 1; i <= n; i++)
	{
		if(i == ost)
			break;
		suma += tab[i];
		while(ost - 1 != i && sumb < suma)
			sumb += tab[--ost];
	}
	outs(ost - 1);
	outn(n - ost + 1);
	return 0;
}


#include <iostream>

using namespace std;

int a[100100];

int main(){
	int n;
	cin >> n;
	for ( int i = 0; i < n; i++ )
		cin >> a[i];
	int ansa = 0;
	int ansb = 0;
	int l = 0;
	int r = n - 1;
	bool fb = false;
	while ( r >= l ){
		if ( l == r ){
			if ( fb )
				ansb++;
			else
				ansa++;
			break;
		}
		int t = min(a[l],a[r]);
		a[l] -= t;
		a[r] -= t;
		fb = true;
		if ( !a[l] ){
			ansa++;
			l++;
		}
		if ( !a[r] ){
			ansb++;
			r--;
			fb = false;
		}
	}
	cout << ansa << ' ' << ansb;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int arr[100005];

int main()
{
    int n;
    cin >> n;
    for (int i = 0; i < n; i++)
        cin >> arr[i];
    if (n == 1)
        cout << "1 0";
    else
    {
        int ia = 0, ib = n - 1, a = 1, b = 1, sa = arr[ia], sb = arr[ib];
        while (ia <= ib)
        {
            if (sa > sb)
            {
                if(ib-ia==1)
                    break;
                while (sa > sb && ib > ia)
                {
                    ib--;
                    sb += arr[ib];
                    b++;
                }
            }
            else if(sb > sa)
            {
                if(ib-ia==1)
                    break;
                while(sb > sa && ia < ib)
                {
                    ia++;
                    sa += arr[ia];
                    a++;
                }
                if(ia == ib)break;
            }
            else if(ib - ia > 2)
            {
                ia++, ib--;
                sa += arr[ia];
                sb += arr[ib];
                a++, b++;
            }
            else if(ib - ia == 2)
            {
                a++;
                break;
            }
            else
                break;
        }
        cout << a << " " << b;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int arr[100005];

int main()
{
    int n;
    cin >> n;
    for (int i = 0; i < n; i++)
        cin >> arr[i];
    if (n == 1)
        cout << "1 0";
    else
    {
        int ia = 0, ib = n - 1, a = 1, b = 1, sa = arr[ia], sb = arr[ib];
        while (ib - ia > 1)
        {
            while (sa > sb && ib - ia >= 2)
            {
                ib--;
                sb += arr[ib];
                b++;
            }
            while (sb > sa && ib - ia >= 2)
            {
                ia++;
                sa += arr[ia];
                a++;
            }
            while (sa == sb && ib - ia > 2)
            {
                ia++, ib--;
                sa += arr[ia];
                sb += arr[ib];
                a++, b++;
            }
            if (ib - ia <= 2)
            {
                if (sa == sb && ib - ia == 2)
                    a++;
                break;
            }
        }
        cout << a << " " << b;
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int arr[100005];

int main()
{
    int n;
    cin >> n;
    for (int i = 0; i < n; i++)
        cin >> arr[i];
    if (n == 1)
        cout << "1 0";
    else{
        int ia = 0, ib = n - 1, a = 1, b = 1, sa = arr[ia], sb = arr[ib];
        while (ib - ia > 1){
            while (sa >= sb && ib - ia > 2){
                ib--;
                sb += arr[ib];
                b++;
            }
            while (sb >= sa && ib - ia > 2){
                ia++;
                sa += arr[ia];
                a++;
            }
            if (ib - ia <= 2){
                if (sa == sb && ib - ia == 2)
                    a++;
                else if(ib - ia == 2){
                    if(sb > sa)
                        a++;
                    else if(sb < sa)
                        b++;
                }
                break;
            }
        }
        cout << a << " " << b;
    }
    return 0;
}


#include <iostream>
#include <vector>

void run(std::istream &in, std::ostream &out) {
    int n;
    in >> n;
    std::vector<int> data(n);
    for (int i = 0; i < n; i++) in >> data[i];
    int i = 0;
    int j = n - 1;
    int timeA = 0, timeB = 0;
    while (j >= i) {
        if (timeA <= timeB) {
            timeB -= timeA;
            timeA = data[i];
            i++;
        } else {
            timeA -= timeB;
            timeB = data[j];
            j--;
        }
    }
    out << i << " " << n - i << std::endl;
}

int main() {
    run(std::cin, std::cout);
    return 0;
}


#include <iostream>
#include <vector>
#include <Python/Python.h>

void run(std::istream &in, std::ostream &out) {
    int n;
    in >> n;
    std::vector<int> data(n);
    for (int i = 0; i < n; i++) in >> data[i];
    int i = 0;
    int j = n - 1;
    int timeA = 0, timeB = 0;
    while (j - i > 1) {
        if (timeA <= timeB) {
            timeB -= timeA;
            timeA += data[i];
            i++;
        } else {
            timeA -= timeB;
            timeB += data[j];
            j--;
        }
    }
    out << i << " " << n - i << std::endl;
}

int main() {
    run(std::cin, std::cout);
    return 0;
}


#include <iostream>
#include <vector>

void run(std::istream &in, std::ostream &out) {
    int n;
    in >> n;
    std::vector<int> data(n);
    for (int i = 0; i < n; i++) in >> data[i];
    int i = 0;
    int j = n - 1;
    int timeA = 0, timeB = 0;
    while (j - i > 1) {
        if (timeA <= timeB) {
            timeB -= timeA;
            timeA += data[i];
            i++;
        } else {
            timeA -= timeB;
            timeB += data[j];
            j--;
        }
    }
    out << i << " " << n - i << std::endl;
}

int main() {
    run(std::cin, std::cout);
    return 0;
}


#include <iostream>
#include <vector>

using namespace std;

int main() {
	int n;
	cin >> n;

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

	int alice=0, bob=n-1, alice_eaten=0, bob_eaten=0;
	while( alice != bob ) {
		if( bars[alice] < bars[bob] ) {
			bars[bob] -= bars[alice];
			++alice;
			++alice_eaten;
			if( alice == bob )
				++bob_eaten;
		}
		else if( bars[alice] > bars[bob] ) {
			bars[alice] -= bars[bob];
			--bob;
			++bob_eaten;
			if( alice == bob )
				++alice_eaten;
		}
		else {
			++alice;
			++alice_eaten;
			++bob_eaten;
			if( alice != bob ) {
				--bob;
			}
		}
	}

	cout << alice_eaten << " " << bob_eaten;
}


#include <iostream>
#include <vector>

using namespace std;

int main() {
	int n;
	cin >> n;

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

	int alice=0, bob=n-1, alice_eaten=0, bob_eaten=0;
	do {
		if( bars[alice] < bars[bob] ) {
			bars[bob] -= bars[alice];
			++alice;
			++alice_eaten;
			if( alice == bob ) {
				--bob;
				++bob_eaten;
			}
		}
		else if( bars[alice] > bars[bob] ) {
			bars[alice] -= bars[bob];
			--bob;
			++bob_eaten;
			if( alice == bob ) {
				++alice;
				++alice_eaten;
			}
		}
		else {
			++alice;
			++alice_eaten;
			if( alice < bob ) {
				++bob_eaten;
				--bob;
			}
		}
	}
	while( alice <= bob );

	cout << alice_eaten << " " << bob_eaten;
}


#include <iostream>
#include <vector>

using namespace std;

int main() {
	int n;
	cin >> n;

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

	int alice=0, bob=n-1, alice_eaten=0, bob_eaten=0;
	do {
		if( bars[alice] < bars[bob] ) {
			bars[bob] -= bars[alice];
			++alice;
			++alice_eaten;
			if( alice == bob ) {
				--bob;
				++bob_eaten;
			}
		}
		else if( bars[alice] > bars[bob] ) {
			bars[alice] -= bars[bob];
			--bob;
			++bob_eaten;
			if( alice == bob ) {
				++alice;
				++alice_eaten;
			}
		}
		else {
			++alice;
			++alice_eaten;
			if( alice <= bob ) {
				++bob_eaten;
				--bob;
			}
		}
	}
	while( alice <= bob );

	cout << alice_eaten << " " << bob_eaten;
}


#include <iostream>
#include <unordered_map>

using namespace std;

int main() {
	int n;
	cin >> n;
	int t[n], l[n], r[n];
	for (int i = 0; i < n; ++i)
		cin >> t[i];
	l[0] = 0;
	for (int i = 1; i < n; ++i)
		l[i] = l[i - 1] + t[i - 1];
	r[n - 1] = 0;
	for (int i = n - 2; i >= 0; --i)
		r[i] = r[i + 1] + t[i + 1];
	for (int i = 0; i < n; ++i)
		if (l[i] > r[i]) {
			cout << i << ' ' << n - i << endl;
			break;
		}
	return 0;
}


#include <iostream>
#include <unordered_map>

using namespace std;

int main() {
	int n;
	cin >> n;
	int t[n], l[n], r[n];
	for (int i = 0; i < n; ++i)
		cin >> t[i];
	if (n == 1) {
		cout << 1 << ' ' << 0 << endl;
		return 0;
	}
	l[0] = 0;
	for (int i = 1; i < n; ++i)
		l[i] = l[i - 1] + t[i - 1];
	r[n - 1] = 0;
	for (int i = n - 2; i >= 0; --i)
		r[i] = r[i + 1] + t[i + 1];
	for (int i = 0; i < n; ++i)
		if (l[i] > r[i]) {
			cout << i << ' ' << n - i << endl;
			break;
		}
	return 0;
}


//
//  main.cpp
//  CodeForce
//
//  Created by Julien on 05/07/13.
//  Copyright (c) 2013 Julien. All rights reserved.
//

#include <iostream>
using namespace std;

int main()
{
    ios::sync_with_stdio(false);

    //INPUT
    int nBar = 0;
    cin >> nBar;
    int times[nBar];
    for (int iBar = 0; iBar < nBar; ++iBar) {
        cin >> times[iBar];
    }

    //WORKING...
    const int nParticipant = 2;
    const int AL = 0, BOB = 1;
    int idBar[nParticipant] = {-1, nBar};
    int busyUntill[nParticipant] = {0};
    int numBar[nParticipant] = {0};

    while(true){
        if (busyUntill[AL] <= busyUntill[BOB]) {
            //Alice eats a new bar.
            busyUntill[AL] += times[ ++idBar[AL] ];
            if (idBar[AL] == idBar[BOB]) break; //We went too far.
            numBar[AL] += 1;
        }else{
            //Bob does.
            busyUntill[BOB] += times[ --idBar[BOB] ];
            if (idBar[AL] == idBar[BOB]) break; //We went too far.
            numBar[BOB] += 1;
        }
    }
    //OUTPUT
    for (int iP = 0; iP < nParticipant; ++iP) {
        cout << numBar[iP] << ' ';
    }

    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int a=0,r=0,i,j,t[100003],n;
main()
{
    cin>>n;
   while ( i < n ) cin>>t[i++];
    while (i>a) r>0?r-=t[--i]:r+=t[a++];
    cout<<a<<" "<<n-a;
}


/* template by is_prime */
#undef NDEBUG
#ifdef tty
#define _GLIBCXX_DEBUG
#endif

#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cassert>
#include <cstring>
#include <ctime>
#include <bitset>
#include <numeric>
#include <iterator>
#include <utility>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>

using namespace std;

#define elif else if
#define gcd __gcd
#define lg __lg
#define ln log
#define bitcount __builtin_popcount
#define fabsl __builtin_fabsl
#define sqrtl __builtin_sqrtl
#define atan2l __builtin_atan2l
#define cosl __builtin_cosl
#define sinl __builtin_sinl
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define len(a) (a).size()
#define st first
#define nd second
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define rep(a,b) for (int a=0;a<(int)b;++a)
#define iter(a,b,c) for (int a=(int)b;b<=c?a<(int)c:a>(int)c;a+=(b<=c?1:-1))

typedef string str;
typedef pair<int, int> pii;
typedef vector<int> vi;

/* initiate variables */
int n, t[100001], a, b, sa, sb;

void algo() {
    /* solves problem */
    scanf("%d", &n);
    rep (i, n) {scanf("%d", &t[i]);}
    a = 0; b = n-1;
    sa = 0; sb = 0;
    while (b-a != 1) {
        if (sa + t[a] <= sb + t[b]) {sa += t[a++];}
        else {sb += t[b--];}
    }
    printf("%d %d\n", a+1, n-b);
}

int main(int agrc, char **argv) {
#ifdef tty
    assert(freopen(argv[1], "rt", stdin));
#endif

    algo();

#ifdef tty
    printf("%lfs\n", double(clock()) / CLOCKS_PER_SEC);
#endif
    return 0;
}


/* template by is_prime */
#undef NDEBUG
#ifdef tty
#define _GLIBCXX_DEBUG
#endif

#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cassert>
#include <cstring>
#include <ctime>
#include <bitset>
#include <numeric>
#include <iterator>
#include <utility>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>

using namespace std;

#define elif else if
#define gcd __gcd
#define lg __lg
#define ln log
#define bitcount __builtin_popcount
#define fabsl __builtin_fabsl
#define sqrtl __builtin_sqrtl
#define atan2l __builtin_atan2l
#define cosl __builtin_cosl
#define sinl __builtin_sinl
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define len(a) (a).size()
#define st first
#define nd second
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define rep(a,b) for (int a=0;a<(int)b;++a)
#define iter(a,b,c) for (int a=(int)b;b<=c?a<(int)c:a>(int)c;a+=(b<=c?1:-1))

typedef string str;
typedef pair<int, int> pii;
typedef vector<int> vi;

/* initiate variables */
int n, t[100001], a, b, sa, sb;

void algo() {
    /* solves problem */
    scanf("%d", &n);
    rep (i, n) {scanf("%d", &t[i]);}
    a = -1; b = n;
    sa = 0; sb = 0;
    while (b-a != 1) {
        if (sa + t[a+1] <= sb + t[b-1]) {sa += t[++a];}
        else {sb += t[--b];}
    }
    printf("%d %d\n", a+1, n-b);
}

int main(int agrc, char **argv) {
#ifdef tty
    assert(freopen(argv[1], "rt", stdin));
#endif

    algo();

#ifdef tty
    printf("%lfs\n", double(clock()) / CLOCKS_PER_SEC);
#endif
    return 0;
}


#include<iostream>
#include<cstdio>
#include<string>
#include<string.h>
#include<cstring>
#include<algorithm>

using namespace std;
const int maxn = 100050;
int s[maxn];
int main(){
	int n;
	cin >> n;
	unsigned long long sum = 0;
	for(int i = 0; i < n; ++i){
		cin >> s[i];
		sum += s[i];
	}
	int half = sum & 1 ? ((sum + 1) >> 1) : (sum >> 1);
	int recid = 0;
	unsigned long long tmpsum = 0;
	for(int i = 0; i < n; ++i){
		tmpsum += s[i];
		if(tmpsum >= half){
			recid = i;
			break;
		}
	}
	int a = 0, b = 0;
	unsigned long long asum = 0, bsum = 0;
	asum = tmpsum - s[recid];
	bsum = sum - tmpsum;
	if(asum <= bsum){
		a = recid + 1;
		b = n - a;
	}
	else{
		a = recid;
		b = n - a;
	}
	cout << a << " " << b << endl;
	return 0;
}


#include <algorithm>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <climits>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <deque>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <unordered_map>
#include <unordered_set>

using namespace std;

#define clr(x) memset((x), 0, sizeof(x))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define mp make_pair
#define sz size()
#define For(i, st, en) for(int i=(st); i<=(int)(en); i++)
#define Ford(i, st, en) for(int i=(st); i>=(int)(en); i--)
#define forn(i, n) for(int i=0; i<(int)(n); i++)
#define ford(i, n) for(int i=(n)-1; i>=0; i--)
#define fori(it, x) for (__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)
#define in(x) int (x); input((x));
typedef long double ld;
template <class _T> inline _T sqr(const _T& x) { return x * x; }
template <class _T> inline string tostr(const _T& a) { ostringstream os(""); os << a; return os.str(); }
const ld PI = 3.1415926535897932384626433832795L;
const ld EPS = 1e-8;
char TEMPORARY_CHAR;
typedef long long ll;
typedef unsigned long long ull;
typedef set < int > SI;
typedef vector < int > VI;
typedef vector < vector < int > > VVI;
typedef map < string, int > MSI;
typedef pair < int, int > PII;
const int INF = 2e9;
#define x first
#define y second
#define less(a,b) ((a) < (b) - EPS)
#define more(a,b) ((a) > (b) + EPS)
#define eq(a,b) (fabs((a) - (b)) < EPS)
#define remax(a, b) ((a) = (b) > (a) ? (b) : (a))
#define remin(a, b) ((a) = (b) < (a) ? (b) : (a))
typedef complex<double> cbase;
inline void fft (vector<cbase> &a, bool invert) {
    int n = (int)a.size();
    for (int i = 1, j = 0; i < n; ++i)
    {
        int bit = n >> 1;
        for (; j >= bit; bit >>= 1)
            j -= bit;
        j += bit;
        if (i < j)
            swap(a[i], a[j]);
    }
    for (int len = 2; len <= n; len <<= 1)
    {
        double ang = 2 * (double)PI / len * (invert ? -1 : 1);
        cbase wlen(cos(ang), sin(ang));
        for (int i = 0; i < n; i += len)
        {
            cbase w(1);
            for (int j=0; j < len / 2; ++j)
            {
                cbase u = a[i + j],  v = a[i + j + len / 2] * w;
                a[i + j] = u + v;
                a[i + j + len / 2] = u - v;
                w *= wlen;
            }
        }
    }
    if (invert)
        for (int i = 0; i < n; ++i)
            a[i] /= n;
}

inline void input(int &a)
{
    a = 0;
    while (((TEMPORARY_CHAR = getchar()) > '9' || TEMPORARY_CHAR < '0') && (TEMPORARY_CHAR != '-')){}
    char neg = 0;
    if (TEMPORARY_CHAR == '-')
    {
        neg = 1;
        TEMPORARY_CHAR = getchar();
    }
    while (TEMPORARY_CHAR <= '9' && TEMPORARY_CHAR >= '0')
    {
        a = (a << 3) + (a << 1) + TEMPORARY_CHAR - '0';
        TEMPORARY_CHAR = getchar();
    }
    if (neg)
        a = -a;
}
inline void out(int a)
{
    if (!a) putchar('0');
    if (a < 0)
    {
        putchar('-');
        a = -a;
    }
    char s[10];
    int i;
    for(i = 0; a; ++i)
    {
        s[i] = '0' + a % 10;
        a /= 10;
    }
    ford(j, i) putchar(s[j]);
}
inline int nxt()
{
    in(ret);
    return ret;
}

struct lnum
{
    vector <int> a;
    int base;
    lnum(int num = 0, int base = 1000000000):base(base)
    {
        if (!num)
            a.resize(1);
        while(num)
        {
            a.pb(num % base);
            num /= base;
        }
    }
    inline int len() const
    {
        return a.size();
    }
    lnum & operator=(const lnum &l)
    {
        if (this != &l)
        {
            a = l.a;
            base = l.base;
        }
        return *this;
    }
    inline friend lnum operator+(const lnum &l, const lnum &r)
    {
        lnum ret(0, l.base);
        int base = l.base;
        int ln = l.len(), rn = r.len();
        int n = max(ln, rn);
        ret.a.resize(n);
        int o = 0;
        for(int i = 0; i < n; ++i)
        {
            int s = o;
            if (i < ln)
                s += l.a[i];
            if (i < rn)
                s += r.a[i];
            o = s >= base;
            if (o)
                s -= base;
            ret.a[i] = s;
        }
        if (o)
            ret.a.push_back(1);
        return ret;
    }
    inline friend lnum operator-(const lnum &l, const lnum &r)
    {
        lnum ret(0, l.base);
        int base = l.base;
        int n = l.len();
        int rn = r.len();
        ret.a.resize(n);
        int o = 0;
        for(int i = 0; i < n; ++i)
        {
            int s = l.a[i] - o;
            if (i < rn)
                s -= r.a[i];
            o = s < 0;
            if (o)
                s += base;
            ret.a[i] = s;
        }
        if (ret.len() > 1 && !ret.a.back())
            ret.a.pop_back();
        return ret;
    }

    inline friend lnum operator*(const lnum &l, const lnum &r)
    {
        lnum ret(0, l.base);
        int base = l.base;
        if (l.len() * r.len() > 1000000)
        {
            vector<cbase> fa (l.a.begin(), l.a.end()),  fb (r.a.begin(), r.a.end());
            int  n = 1;
            while (n < max (l.len(), r.len()))
                n <<= 1;
            n <<= 1;
            fa.resize (n),  fb.resize (n);
            fft (fa, false),  fft (fb, false);
            for (int i = 0; i < n; ++i)
                fa[i] *= fb[i];
            fft (fa, true);
            ret.a.resize(n);
            for (int i = 0; i < n; ++i)
                ret.a[i] = int (fa[i].real() + 0.5);
            int carry = 0;
            for (int i=0; i < n; ++i)
            {
                ret.a[i] += carry;
                carry = ret.a[i] / base;
                ret.a[i] %= base;
            }
        }
        else
        {
            ret.a.resize(l.len() + r.len());
            for (int i = 0; i < l.len(); ++i)
                for (int j = 0, carry = 0; j < r.len() || carry; ++j)
                {
                    long long cur = ret.a[i + j] + (ll)l.a[i] * (j < r.len() ? r.a[j] : 0) + carry;
                    ret.a[i + j] = cur % base;
                    carry = cur / base;
                }
        }
        while (ret.len() > 1 && !ret.a.back())
                ret.a.pop_back();
        return ret;
    }
    inline friend lnum operator/(const lnum &l, const int &r)
    {
        lnum ret(0, l.base);
        ret.a.resize(l.len());
        int carry = 0;
        for(int i = l.len() - 1; i >= 0; --i)
        {
            long long cur = l.a[i] + (ll)carry * l.base;
            ret.a[i] = cur / r;
            carry = cur % r;
        }
        while (ret.len() > 1 && ret.a.back() == 0)
            ret.a.pop_back();
        return ret;
    }

    inline friend bool operator<(const lnum &l, const lnum &r)
    {
        if (l.len() < r.len())
            return true;
        if (l.len() > r.len())
            return false;
        int n = l.len();
        for(int i = n - 1; i; --i)
        {
            if (l.a[i] < r.a[i])
                return true;
            if (l.a[i] > r.a[i])
                return false;
        }
        return false;
    }
    inline friend bool operator>(const lnum &l, const lnum &r)
    {
        return r > l;
    }
    inline friend bool operator==(const lnum &l, const lnum &r)
    {
        if (l.len() != r.len())
            return false;
        int n = l.len();
        for(int i = n - 1; i; --i)
        {
            if (l.a[i] != r.a[i])
                return false;
        }
        return true;
    }
    inline friend bool operator!=(const lnum &l, const lnum &r)
    {
        return !(l == r);
    }
    inline void print()
    {
        if (base == 1000000000)
        {
            printf("%d", a.back());
            for(int i = a.size() - 2; i >=0; --i)
                printf("%09d", a[i]);
        }
        else
        {
            for(int i = a.size() - 1; i >= 0; --i)
                printf("%d", a[i]);
        }
    }
};
int gcd(int a, int b)
{
    if (a > b)
        swap(a, b);
    if (!a)
        return a;
    if (a == b)
        return a;
    if (a == 1)
        return 1;
    if (!(a & 1))
    {
        if (b & 1)
            return gcd(a >> 1, b);
        else
            return gcd(a >> 1, b >> 1) << 1;
    }
    else
    {
        if (b & 1)
            return gcd((b - a) >> 1, a);
        else
            return gcd(a, b >> 1);
    }

}

struct sr
{

};

int main()
{
    in(n);
    int t[n];
    forn(i, n)
        t[i] = nxt();
    int t1 = 0, t2 = 0, a = 0, b = 0;
    for(int i = -1, j = n; i + 1 < j;)
    {
        while (i  + 1 < j && t1 <= t2)
        {
            t1 += t[++i];
            ++a;
        }
        while (i + 1 < j && t2 < t1)
        {
            t2 += t[--j];
            ++b;
        }
    }
    cout << a << " " << b << endl;
    return 0;
}


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

int main()
{
    int n;
    cin>>n;
    vector <int> v(n);
    for(int i=0;i<n;i++)
        cin>>v[i];
    int k=0,l=n,s=v[0],d=1,f=0,t=0;
    while(k<l-1)
    {
        if(s<=t)
        {
            k++;
            s+=v[k];
            d++;
        }
        else
        {
            f++;
            l--;
            t+=v[l];
        }
    }
    cout<<d<<" "<<f;
    return 0;
}


//In the name of ALLAH
//6C

#include <iostream>
#include <cstdio>
using namespace std;

const int N = 1000010;

int a[N], who[N];

int main(){
  int n;
  scanf("%d",&n);
  for (int i=0;i<n;i++)
    scanf("%d",a+i);
  int pa = 0, pb = n-1;
  while (pa < pb){
    who[pa] = 1;
    who[pb] = 2;
    if (a[pa] < a[pb])
      a[pb] -= a[pa++];
    else if (a[pa] > a[pb])
      a[pa] -= a[pb--];
    else{
      pa++;
      pb--;
    }
  }
  if (!who[pb]) who[pb] = 2;
  int x = 0, y = 0;
  for (int i=0;i<n;i++){
    if (who[i]==1) x++;
    else y++;
  }
  cout << x << ' ' << y << '\n';
  return 0;
}


//In the name of ALLAH
//6C

#include <iostream>
#include <cstdio>
using namespace std;

const int N = 1000010;

int a[N], who[N];

int main(){
  int n;
  scanf("%d",&n);
  for (int i=0;i<n;i++)
    scanf("%d",a+i);
  int pa = 0, pb = n-1;
  while (pa < pb){
    who[pa] = 1;
    who[pb] = 2;
    if (a[pa] < a[pb])
      a[pb] -= a[pa++];
    else if (a[pa] > a[pb])
      a[pa] -= a[pb--];
    else{
      pa++;
      pb--;
    }
  }
  if (!who[pa]) who[pa] = 1;
  int x = 0, y = 0;
  for (int i=0;i<n;i++){
    if (who[i]==1) x++;
    else y++;
  }
  cout << x << ' ' << y << '\n';
  return 0;
}


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

typedef long long  ll;

///Input
#define pf printf
#define sf(n)       scanf("%lld", &n)
#define sff(a,b)    scanf("%lld %lld", &a, &b)
#define sfff(a,b,c) scanf("%lld %lld %lld", &a, &b, &c)
#define Case(no) printf("Case %d: ",++no)

#define rep(x,n) for(__typeof(n) x=0;x<(n);x++)
#define reps(i,x) for(int  i=0;i<(x.size());i++)
#define repp(x,n) for(__typeof(n) x=1;x<=(n);x++)
#define FOR(x,m,n) for(__typeof(n) x=(m);x<=(n);x++)
#define foreach(x,n) for(__typeof(n.begin()) x=n.begin();x!=n.end();x++)
///Shortcut
#define mem(ar,value) memset(ar,value,sizeof(ar))
#define all(x) x.begin(),x.end()
#define sqr(x) ((x)*(x))
#define len(s) s.size()
#define mp make_pair
#define pb push_back
#define xx first
#define yy second

///Min AND Max
#define min4(a,b,c,d) min(min(a,b),min(c,d))
#define max4(a,b,c,d) max(max(a,b),max(c,d))
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))

#define maxall(v) *max_element(all(v))
#define minall(v) *min_element(all(v))

#define inf (1e15)
#define eps (1e-9)
#define PI acos(-1.0)
#define pi 3.14159265358979323846
#define isEq(a,b) (fabs((a)-(b))<eps)
#define Dist(x1,y1,x2,y2) (sqrt(sqr((x1)-(x2))+sqr((y1)-(y2))))
#define spDist(lat1,long1,lat2,long2,r) ((r)*acos(sin(lat1)*sin(lat2)+cos(lat1)*cos(lat2)*cos((long1)-(long2))))
#define area(x1,y1,x2,y2,x3,y3) ( x1*(y2-y3) + x2*(y3-y1) + x3*(y1-y2) )
#define sqr(x) ((x)*(x))
#define distSqr(x1,y1,x2,y2) ( sqr(x1-x2) + sqr(y1-y2) )
#define dist4adj(x1,y1,x2,y2) ( abs(x1-x2) + abs(y1-y2) )
#define dist8adj(x1,y1,x2,y2) max( abs(x1-x2) , abs(y1-y2) )

///File
#define READ freopen("input.txt","r",stdin)
#define WRITE freopen("output.txt","w",stdout)

/**Define Bitwise operation**/
template<class T> inline T lowbit(T n){return (n^(n-1))&n;}//NOTES:lowbit(
template<class T> inline int countbit(T n){return (n==0)?0:(1+countbit(n&(n-1)));}
#define check(n, pos) (n & (1<<(pos)))
#define biton(n, pos) (n | (1<<(pos)))
#define bitoff(n, pos) (n & ~(1<<(pos)))

#define ledzero(n) (__builtin_clz(n))
#define trailzero(n) (__builtin_ctz(n))
#define onbit(n) (__builtin_popcount(n))

///upper bound and lower bound
#define LB(a,value) (lower_bound(all(a),value)-a.begin())
#define UB(a,value) (upper_bound(all(a),value)-a.begin())

///String
//int compare(string a,string b){if(a==b) return 0;if(SZ(a)==SZ(b)){for(int i=0; i<SZ(a); i++){if(a[i]>b[i]) return 1;else if(a[i]<b[i]) return -1;}return -1;}if(SZ(a)>SZ(b)) return 1;return -1;}
string string_add(string b,string a){if(len(a)>len(b)) swap(a,b);a=string((len(b)-len(a)),'0')+a;int carry=0,add;string res;for(int i=len(a)-1; i>-1; i--){add=(int)(a[i]-'0')+(int)(b[i]-'0')+carry;carry=add/10;res+=(add%10)+'0';}if(carry) res+=carry+'0';reverse(res.begin(),res.end());return res;}
string string_mul(string a,string b){if(len(a)>len(b)) swap(a,b);string res,tres;int l=0,carry,mul;for(int i=len(a)-1; i>-1; i--){tres=string(l,'0');carry=0;for(int j=len(b)-1; j>-1; j--){mul=(int)(a[i]-'0')*(int)(b[j]-'0')+carry;carry=mul/10; tres+=(mul%10)+'0'; }if(carry) tres+=carry+'0';reverse(tres.begin(),tres.end());res=string_add(tres,res);l++;}return res;}
void cut_leading_zero(string &res){int i;for(i=0; i<len(res); i++){if(res[i]!='0') break;}res=res.substr(i);if(!len(res)) res="0";return;}

///DEBUG
#define dbg(x) cout<<#x<<": "<<x<<endl
#define dbgar(i,a) cout<<#a<<"["<<i<<"] = "<<a[i]<<" "<<endl

#define UNIQUE(V) (V).erase(unique((V).begin(),(V).end()),(V).end())

//#define trace(x) cerr<<x<<endl;
#define d1(x) cerr<<__FUNCTION__<<":"<<__LINE__<<": "#x" = "<<x<<endl;
#define d2(x,y) cerr<<__FUNCTION__<<":"<<__LINE__<<": "#x" = "<<x<<" | "#y" = "<<y<<endl;
#define d3(x,y,z) cerr<<__FUNCTION__<<":"<<__LINE__<<": "#x" = "<<x<<" | "#y" = "<<y<<" | "#z" = "<<z<<endl;
#define d4(a,b,c,d) cerr<<__FUNCTION__<<":"<<__LINE__<<": "#a" = "<<a<<" | "#b" = "<<b<<" | "#c" = "<<c<<" | "#d" = "<<d<<endl;
#define d5(a,b,c,d,e) cerr<<__FUNCTION__<<":"<<__LINE__<<": "#a" = "<<a<<" | "#b" = "<<b<<" | "#c" = "<<c<<" | "#d" = "<<d<<" | "#e" = "<<e<<endl;
#define d6(a,b,c,d,e,f) cerr<<__FUNCTION__<<":"<<__LINE__<<": "#a" = "<<a<<" | "#b" = "<<b<<" | "#c" = "<<c<<" | "#d" = "<<d<<" | "#e" = "<<e<<" | "#f" = "<<f<<endl;

///Gcd and Lcm
template<class T>T gcd(T a,T b){return b == 0 ? a : gcd(b, a % b);}
template<typename T>T lcm(T a, T b) {return a / gcd(a,b) * b;}

///Bigmod && Pow
template<class T>T my_pow(T n,T p){if(p==0)return 1;T x=my_pow(n,p/2);x=(x*x);if(p&1)x=(x*n);return x;} ///n to the power p
template<class T>T big_mod(T n,T p,T m){if(p==0)return (T)1;T x=big_mod(n,p/2,m);x=(x*x)%m;if(p&1)x=(x*n)%m;return x;}
template<class T> inline T Mod(T n,T m) {return (n%m+m)%m;} ///For Positive Negative No.

template<class T>T multiplication(T n,T p,T m){if(p==0)return (T)0;T x=multiplication(n,p/2,m);x=(x+x)%m;if(p&1)x=(x+n)%m;return x;}
bool isVowel(char ch){ ch=toupper(ch); if(ch=='A'||ch=='U'||ch=='I'||ch=='O'||ch=='E') return true; return false;}

///string to int
template <class T> T extract(string s, T ret) {stringstream ss(s); ss >> ret; return ret;}/// extract words or numbers from a line
template<class T> string itos(T n){ostringstream ost;ost<<n;ost.flush();return ost.str();}///NOTES:toString(
ll stoi(string s){ll r=0;istringstream sin(s);sin>>r;return r;}///NOTES:toInt(
double toDouble(string s){double r=0;istringstream sin(s);sin>>r;return r;}

/**Direction**/
///int col[8] = {0, 1, 1, 1, 0, -1, -1, -1};int row[8] = {1, 1, 0, -1, -1, -1, 0, 1}; ///8 Direction
///int col[4] = {1, 0, -1, 0};int row[4] = {0, 1, 0, -1}; ///4 Direction
///int dx[]={2,1,-1,-2,-2,-1,1,2};int dy[]={1,2,2,1,-1,-2,-2,-1};///Knight Direction
///int dx[]={-1,-1,+0,+1,+1,+0};int dy[]={-1,+1,+2,+1,-1,-2}; ///Hexagonal Direction

const int mod= 1e9+7;
typedef   pair<ll,ll>  pii;
typedef   vector< pii > vpii;
typedef   vector<long long>   vi;
typedef   vector<string>   vs;
typedef   map<string,ll>  msi;
typedef   map<ll,ll>  mii;
typedef   map<char,ll>  mci;

ll a=0,b=0,d=0,n,m,res=0,c=0,t=0,ans=0,cc=0,f=0,ff=0,cnt=0,cost=0,ks=0,k;
ll mn=inf,mx=-inf;

string s[100],ss;
ll ar[100100];
//ll aa[105][105][105];

int main()
{

   cin>>n;
   rep(i,n)
   {
       cin>>ar[i];
   }
   if(n==1)
   {
       cout<<1<<" "<<0;return 0;
   }
   ll r=0,rr=0;
   ll res=0,ress=0;
   int i=0;
   while(r+rr<n  && i<n)
   {

       if(i==0)
       {
           res+=ar[i];
           ress+=ar[n-i-1];
           r++;
           rr++;
       }
       if(i)
       {
           if(res<=ress)
           {
               //ress-=res;
               res+=ar[r];
               r++;
           }
           else
           {
               //res-=ress;
               ress+=ar[n-rr-1];
               rr++;
           }
       }
      // cout<<res<<" "<<ress<<endl;
       i++;

   }
   cout<<r<< " "<<rr;
    return 0;
}


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

typedef long long  ll;

///Input
#define pf printf
#define sf(n)       scanf("%lld", &n)
#define sff(a,b)    scanf("%lld %lld", &a, &b)
#define sfff(a,b,c) scanf("%lld %lld %lld", &a, &b, &c)
#define Case(no) printf("Case %d: ",++no)

#define rep(x,n) for(__typeof(n) x=0;x<(n);x++)
#define reps(i,x) for(int  i=0;i<(x.size());i++)
#define repp(x,n) for(__typeof(n) x=1;x<=(n);x++)
#define FOR(x,m,n) for(__typeof(n) x=(m);x<=(n);x++)
#define foreach(x,n) for(__typeof(n.begin()) x=n.begin();x!=n.end();x++)
///Shortcut
#define mem(ar,value) memset(ar,value,sizeof(ar))
#define all(x) x.begin(),x.end()
#define sqr(x) ((x)*(x))
#define len(s) s.size()
#define mp make_pair
#define pb push_back
#define xx first
#define yy second

///Min AND Max
#define min4(a,b,c,d) min(min(a,b),min(c,d))
#define max4(a,b,c,d) max(max(a,b),max(c,d))
#define min3(a,b,c) min(a,min(b,c))
#define max3(a,b,c) max(a,max(b,c))

#define maxall(v) *max_element(all(v))
#define minall(v) *min_element(all(v))

#define inf (1e15)
#define eps (1e-9)
#define PI acos(-1.0)
#define pi 3.14159265358979323846
#define isEq(a,b) (fabs((a)-(b))<eps)
#define Dist(x1,y1,x2,y2) (sqrt(sqr((x1)-(x2))+sqr((y1)-(y2))))
#define spDist(lat1,long1,lat2,long2,r) ((r)*acos(sin(lat1)*sin(lat2)+cos(lat1)*cos(lat2)*cos((long1)-(long2))))
#define area(x1,y1,x2,y2,x3,y3) ( x1*(y2-y3) + x2*(y3-y1) + x3*(y1-y2) )
#define sqr(x) ((x)*(x))
#define distSqr(x1,y1,x2,y2) ( sqr(x1-x2) + sqr(y1-y2) )
#define dist4adj(x1,y1,x2,y2) ( abs(x1-x2) + abs(y1-y2) )
#define dist8adj(x1,y1,x2,y2) max( abs(x1-x2) , abs(y1-y2) )

///File
#define READ freopen("input.txt","r",stdin)
#define WRITE freopen("output.txt","w",stdout)

/**Define Bitwise operation**/
template<class T> inline T lowbit(T n){return (n^(n-1))&n;}//NOTES:lowbit(
template<class T> inline int countbit(T n){return (n==0)?0:(1+countbit(n&(n-1)));}
#define check(n, pos) (n & (1<<(pos)))
#define biton(n, pos) (n | (1<<(pos)))
#define bitoff(n, pos) (n & ~(1<<(pos)))

#define ledzero(n) (__builtin_clz(n))
#define trailzero(n) (__builtin_ctz(n))
#define onbit(n) (__builtin_popcount(n))

///upper bound and lower bound
#define LB(a,value) (lower_bound(all(a),value)-a.begin())
#define UB(a,value) (upper_bound(all(a),value)-a.begin())

///String
//int compare(string a,string b){if(a==b) return 0;if(SZ(a)==SZ(b)){for(int i=0; i<SZ(a); i++){if(a[i]>b[i]) return 1;else if(a[i]<b[i]) return -1;}return -1;}if(SZ(a)>SZ(b)) return 1;return -1;}
string string_add(string b,string a){if(len(a)>len(b)) swap(a,b);a=string((len(b)-len(a)),'0')+a;int carry=0,add;string res;for(int i=len(a)-1; i>-1; i--){add=(int)(a[i]-'0')+(int)(b[i]-'0')+carry;carry=add/10;res+=(add%10)+'0';}if(carry) res+=carry+'0';reverse(res.begin(),res.end());return res;}
string string_mul(string a,string b){if(len(a)>len(b)) swap(a,b);string res,tres;int l=0,carry,mul;for(int i=len(a)-1; i>-1; i--){tres=string(l,'0');carry=0;for(int j=len(b)-1; j>-1; j--){mul=(int)(a[i]-'0')*(int)(b[j]-'0')+carry;carry=mul/10; tres+=(mul%10)+'0'; }if(carry) tres+=carry+'0';reverse(tres.begin(),tres.end());res=string_add(tres,res);l++;}return res;}
void cut_leading_zero(string &res){int i;for(i=0; i<len(res); i++){if(res[i]!='0') break;}res=res.substr(i);if(!len(res)) res="0";return;}

///DEBUG
#define dbg(x) cout<<#x<<": "<<x<<endl
#define dbgar(i,a) cout<<#a<<"["<<i<<"] = "<<a[i]<<" "<<endl

#define UNIQUE(V) (V).erase(unique((V).begin(),(V).end()),(V).end())

//#define trace(x) cerr<<x<<endl;
#define d1(x) cerr<<__FUNCTION__<<":"<<__LINE__<<": "#x" = "<<x<<endl;
#define d2(x,y) cerr<<__FUNCTION__<<":"<<__LINE__<<": "#x" = "<<x<<" | "#y" = "<<y<<endl;
#define d3(x,y,z) cerr<<__FUNCTION__<<":"<<__LINE__<<": "#x" = "<<x<<" | "#y" = "<<y<<" | "#z" = "<<z<<endl;
#define d4(a,b,c,d) cerr<<__FUNCTION__<<":"<<__LINE__<<": "#a" = "<<a<<" | "#b" = "<<b<<" | "#c" = "<<c<<" | "#d" = "<<d<<endl;
#define d5(a,b,c,d,e) cerr<<__FUNCTION__<<":"<<__LINE__<<": "#a" = "<<a<<" | "#b" = "<<b<<" | "#c" = "<<c<<" | "#d" = "<<d<<" | "#e" = "<<e<<endl;
#define d6(a,b,c,d,e,f) cerr<<__FUNCTION__<<":"<<__LINE__<<": "#a" = "<<a<<" | "#b" = "<<b<<" | "#c" = "<<c<<" | "#d" = "<<d<<" | "#e" = "<<e<<" | "#f" = "<<f<<endl;

///Gcd and Lcm
template<class T>T gcd(T a,T b){return b == 0 ? a : gcd(b, a % b);}
template<typename T>T lcm(T a, T b) {return a / gcd(a,b) * b;}

///Bigmod && Pow
template<class T>T my_pow(T n,T p){if(p==0)return 1;T x=my_pow(n,p/2);x=(x*x);if(p&1)x=(x*n);return x;} ///n to the power p
template<class T>T big_mod(T n,T p,T m){if(p==0)return (T)1;T x=big_mod(n,p/2,m);x=(x*x)%m;if(p&1)x=(x*n)%m;return x;}
template<class T> inline T Mod(T n,T m) {return (n%m+m)%m;} ///For Positive Negative No.

template<class T>T multiplication(T n,T p,T m){if(p==0)return (T)0;T x=multiplication(n,p/2,m);x=(x+x)%m;if(p&1)x=(x+n)%m;return x;}
bool isVowel(char ch){ ch=toupper(ch); if(ch=='A'||ch=='U'||ch=='I'||ch=='O'||ch=='E') return true; return false;}

///string to int
template <class T> T extract(string s, T ret) {stringstream ss(s); ss >> ret; return ret;}/// extract words or numbers from a line
template<class T> string itos(T n){ostringstream ost;ost<<n;ost.flush();return ost.str();}///NOTES:toString(
ll stoi(string s){ll r=0;istringstream sin(s);sin>>r;return r;}///NOTES:toInt(
double toDouble(string s){double r=0;istringstream sin(s);sin>>r;return r;}

/**Direction**/
///int col[8] = {0, 1, 1, 1, 0, -1, -1, -1};int row[8] = {1, 1, 0, -1, -1, -1, 0, 1}; ///8 Direction
///int col[4] = {1, 0, -1, 0};int row[4] = {0, 1, 0, -1}; ///4 Direction
///int dx[]={2,1,-1,-2,-2,-1,1,2};int dy[]={1,2,2,1,-1,-2,-2,-1};///Knight Direction
///int dx[]={-1,-1,+0,+1,+1,+0};int dy[]={-1,+1,+2,+1,-1,-2}; ///Hexagonal Direction

const int mod= 1e9+7;
typedef   pair<ll,ll>  pii;
typedef   vector< pii > vpii;
typedef   vector<long long>   vi;
typedef   vector<string>   vs;
typedef   map<string,ll>  msi;
typedef   map<ll,ll>  mii;
typedef   map<char,ll>  mci;

ll a=0,b=0,d=0,n,m,res=0,c=0,t=0,ans=0,cc=0,f=0,ff=0,cnt=0,cost=0,ks=0,k;
ll mn=inf,mx=-inf;

string s[100],ss;
ll ar[1001];
//ll aa[105][105][105];

int main()
{

   cin>>n;
   rep(i,n)
   {
       cin>>ar[i];
   }
   if(n==1)
   {
       cout<<1<<" "<<0;return 0;
   }
   ll r=0,rr=0;
   ll res=0,ress=0;
   int i=0;
   while(r+rr<n  && i<n)
   {

       if(i==0)
       {
           res+=ar[i];
           ress+=ar[n-i-1];
           r++;
           rr++;
       }
       if(i)
       {
           if(res<=ress)
           {
               //ress-=res;
               res+=ar[r];
               r++;
           }
           else
           {
               //res-=ress;
               ress+=ar[n-rr-1];
               rr++;
           }
       }
      // cout<<res<<" "<<ress<<endl;
       i++;

   }
   cout<<r<< " "<<rr;
    return 0;
}


# include <cstdio>

int r,a,n,i,z[100001];

int main(){

    scanf("%d", &n);

    while ( i < n ) scanf("%d", &z[i++]);

    while ( i > a ) r > 0 ? r-=z[--i]:r+=z[a++];

    printf("%d %d", a, n-a);
}


#include <bits/stdc++.h>
#include <ext/algorithm>
#include <ext/numeric>

using namespace std;
using namespace __gnu_cxx;

#ifdef HOME
#define DB(x) cerr << __LINE__ << ": " << #x << " = " << (x) << endl << flush;
#else
#define DB(x)
#endif

#define all(c) (c).begin(),(c).end()
#define endl '\n'
#define mp make_pair

const int oo = 0x3f3f3f3f;

typedef long long i64;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> vi;

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

    int n; cin >> n;

    vector<int> v(n);

    for(int i = 0; i < n; ++i)
        cin >> v[i];

    if(n == 1)
    {
        cout << "1 0" << endl;
        return 0;
    }

    int a = 0, b = n - 1;
    int ta = v[a], tb = v[b];

    for( ; a+1 < b; )
        if(ta < tb)
            tb -= ta, ta = v[++a];
        else if(ta > tb) ta -= tb, tb = v[--b];
        else
        {
            ta = v[++a];
            if(a + 1 == b) break;
            tb = v[--b];
        }

    cout << a+1 << " " << n-a-1 << endl;

    return 0;
}


#include <deque>
#include <iostream>
#include <iomanip>
#include <algorithm>

#include <cstdlib>

using namespace ::std;

#ifdef DEBUG
#undef DEBUG
#define DEBUG(x) x
#else
#define DEBUG(x)
#endif

int main () {
	std::ios::sync_with_stdio(false);

	int n;
	cin >> n;

	deque<int> bars;
	for (int i = n; --i >= 0; ) {
		int size;
		cin >> size;
		bars.emplace_back (size);
	}

	int alice = 0, bob = 0, aliceBars = 0, bobBars = 0;
	while (!bars.empty())
		if (alice <= bob)
			++aliceBars, alice += bars.front(), bars.pop_front();
		else
			++bobBars, bob += bars.back(), bars.pop_back();

	cout << aliceBars << ' ' << bobBars << endl;

	return EXIT_SUCCESS;
}


#include <sstream>
#include <iomanip>
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <deque>
#include <complex>

#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORD(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)
#define REP(i,a) for(int i=0,_a=(a); i<_a; i++)
#define ll long long
#define F first
#define S second
#define PB push_back
#define MP make_pair

#define DEBUG(x) cout << #x << " = "; cout << x << endl;
#define PR(a,n) cout << #a << " = "; FOR(_,1,n) cout << a[_] << ' '; cout << endl;
#define PR0(a,n) cout << #a << " = "; REP(_,n) cout << a[_] << ' '; cout << endl;
using namespace std;

const double PI = acos(-1.0);
const int MN = 100111;

int a[MN], l[MN], r[MN], n;

int main() {
    while (scanf("%d", &n) == 1) {
        r[n+1] = a[n+1] = 0;
        FOR(i,1,n) {
            scanf("%d", &a[i]);
            l[i] = l[i-1] + a[i-1];
        }
        FORD(i,n,1) r[i] = r[i+1] + a[i+1];
        int c1 = 0, c2 = 0;
        FOR(i,1,n) {
            if (l[i] <= r[i]) ++c1;
            else ++c2;
        }
        cout << c1 << ' ' << c2 << endl;
    }
    return 0;
}


// C header files
#include <cmath>
#include <ctime>
#include <cctype>
#include <cstdio>
#include <cstring>
#include <cstdlib>

// C++ header files
#include <map>
#include <set>
#include <deque>
#include <limits>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>

// input / output
#include <fstream>
#include <iomanip>
#include <iostream>

using namespace std;

// C++ types
typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;

// pairs
typedef pair <ll, ll> pll;
typedef pair <int, int> pi;
typedef pair <double, double> pd;

// single vectors
typedef vector <int> vi;
typedef vector <bool> vb;
typedef vector <char> vc;
typedef vector <double> vd;
typedef vector <string> vs;
typedef vector <long long> vll;

// double vectors
typedef vector < vector <int> > vvi;
typedef vector < vector <bool> > vvb;
typedef vector < vector <char> > vvc;
typedef vector < vector <double> > vvd;
typedef vector < vector <string> > vvs;
typedef vector < pair <int, int> > vpi;
typedef vector < pair <double, double> > vpd;

// macroses
#define ft first
#define sc second
#define len(s) s.length()
#define pob(s) pop_back(s)
#define pub(s) push_back(s)
#define mp(a, b) make_pair((a), (b))
#define maxV(type) numeric_limits<type>::max()
#define minV(type) numeric_limits<type>::min()
#define sf(a, b, i) for(size_t (i)=(a); (i) < (b); (i)++)

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n;
    cin >> n;
    int* v = new int[n];
    for(int i=0; i < n; i++)
        scanf("%d", &v[i]);
    if(n == 1) printf("1 0\n");
    else {
    int* l = v;
    int* r = v+n-1;
    int lsum = v[0];
    int rsum = v[n-1];
    while(r-l > 1) {
        if(r-l == 2 || lsum < rsum) {
            l++;
            lsum += *l;
        }
        else {
            r--;
            rsum += *r;
       }
    }
    printf("%d %d", l-v+1, (v+n-1)-r+1);
    }
    //system("pause");
    return 0;
}


// C header files
#include <cmath>
#include <ctime>
#include <cctype>
#include <cstdio>
#include <cstring>
#include <cstdlib>

// C++ header files
#include <map>
#include <set>
#include <deque>
#include <limits>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>

// input / output
#include <fstream>
#include <iomanip>
#include <iostream>

using namespace std;

// C++ types
typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;

// pairs
typedef pair <ll, ll> pll;
typedef pair <int, int> pi;
typedef pair <double, double> pd;

// single vectors
typedef vector <int> vi;
typedef vector <bool> vb;
typedef vector <char> vc;
typedef vector <double> vd;
typedef vector <string> vs;
typedef vector <long long> vll;

// double vectors
typedef vector < vector <int> > vvi;
typedef vector < vector <bool> > vvb;
typedef vector < vector <char> > vvc;
typedef vector < vector <double> > vvd;
typedef vector < vector <string> > vvs;
typedef vector < pair <int, int> > vpi;
typedef vector < pair <double, double> > vpd;

// macroses
#define ft first
#define sc second
#define len(s) s.length()
#define pob(s) pop_back(s)
#define pub(s) push_back(s)
#define mp(a, b) make_pair((a), (b))
#define maxV(type) numeric_limits<type>::max()
#define minV(type) numeric_limits<type>::min()
#define sf(a, b, i) for(size_t (i)=(a); (i) < (b); (i)++)

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n;
    cin >> n;
    int* v = new int[n];
    for(int i=0; i < n; i++)
        scanf("%d", &v[i]);
    if(n == 1) printf("1 0\n");
    else {
    int* l = v;
    int* r = v+n-1;
    int lsum = v[0];
    int rsum = v[n-1];
    while(r-l > 1) {
        if(r-l == 2 || lsum > rsum) {
            l++;
            lsum += *l;
        }
        else {
            r--;
            rsum += *r;
       }
    }
    printf("%d %d", l-v+1, (v+n-1)-r+1);
    }
    //system("pause");
    return 0;
}


// C header files
#include <cmath>
#include <ctime>
#include <cctype>
#include <cstdio>
#include <cstring>
#include <cstdlib>

// C++ header files
#include <map>
#include <set>
#include <deque>
#include <limits>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>

// input / output
#include <fstream>
#include <iomanip>
#include <iostream>

using namespace std;

// C++ types
typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;

// pairs
typedef pair <ll, ll> pll;
typedef pair <int, int> pi;
typedef pair <double, double> pd;

// single vectors
typedef vector <int> vi;
typedef vector <bool> vb;
typedef vector <char> vc;
typedef vector <double> vd;
typedef vector <string> vs;
typedef vector <long long> vll;

// double vectors
typedef vector < vector <int> > vvi;
typedef vector < vector <bool> > vvb;
typedef vector < vector <char> > vvc;
typedef vector < vector <double> > vvd;
typedef vector < vector <string> > vvs;
typedef vector < pair <int, int> > vpi;
typedef vector < pair <double, double> > vpd;

// macroses
#define ft first
#define sc second
#define len(s) s.length()
#define pob(s) pop_back(s)
#define pub(s) push_back(s)
#define mp(a, b) make_pair((a), (b))
#define maxV(type) numeric_limits<type>::max()
#define minV(type) numeric_limits<type>::min()
#define sf(a, b, i) for(size_t (i)=(a); (i) < (b); (i)++)

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n;
    cin >> n;
    int* v = new int[n];
    for(int i=0; i < n; i++)
        scanf("%d", &v[i]);
    int* l = v;
    int* r = v+n-1;
    int lsum = v[0];
    int rsum = (n != 1 ? v[n-1] : 0);
    while(r-l > 1) {
        if(r-l == 2 || lsum > rsum) {
            l++;
            lsum += *l;
        }
        else {
            r--;
            rsum += *r;
       }
    }
    printf("%d %d", l-v+1, (v+n-1)-r+1);
    //system("pause");
    return 0;
}


// C header files
#include <cmath>
#include <ctime>
#include <cctype>
#include <cstdio>
#include <cstring>
#include <cstdlib>

// C++ header files
#include <map>
#include <set>
#include <deque>
#include <limits>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>

// input / output
#include <fstream>
#include <iomanip>
#include <iostream>

using namespace std;

// C++ types
typedef long long ll;
typedef unsigned int ui;
typedef unsigned long long ull;

// pairs
typedef pair <ll, ll> pll;
typedef pair <int, int> pi;
typedef pair <double, double> pd;

// single vectors
typedef vector <int> vi;
typedef vector <bool> vb;
typedef vector <char> vc;
typedef vector <double> vd;
typedef vector <string> vs;
typedef vector <long long> vll;

// double vectors
typedef vector < vector <int> > vvi;
typedef vector < vector <bool> > vvb;
typedef vector < vector <char> > vvc;
typedef vector < vector <double> > vvd;
typedef vector < vector <string> > vvs;
typedef vector < pair <int, int> > vpi;
typedef vector < pair <double, double> > vpd;

// macroses
#define ft first
#define sc second
#define len(s) s.length()
#define pob(s) pop_back(s)
#define pub(s) push_back(s)
#define mp(a, b) make_pair((a), (b))
#define maxV(type) numeric_limits<type>::max()
#define minV(type) numeric_limits<type>::min()
#define sf(a, b, i) for(size_t (i)=(a); (i) < (b); (i)++)

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int n;
    cin >> n;
    int* v = new int[n];
    for(int i=0; i < n; i++)
        scanf("%d", &v[i]);
    if(n == 1) printf("1 0\n");
    else {
    int* l = v;
    int* r = v+n-1;
    int lsum = v[0];
    int rsum = v[n-1];
    while(r-l > 1) {
        if(lsum < rsum) {
            l++;
            lsum += *l;
        }
        else {
            r--;
            rsum += *r;
       }
    }
    printf("%d %d", l-v+1, (v+n-1)-r+1);
    }
    //system("pause");
    return 0;
}