Alice and Bob like games. And now they are ready to start a new game. They have placed n chocolate bars in a line. Alice starts to eat chocolate bars one by one from left to right, and Bob — from right to left. For each chocololate bar the time, needed for the player to consume it, is known (Alice and Bob eat them with equal speed). When the player consumes a chocolate bar, he immediately starts with another. It is not allowed to eat two chocolate bars at the same time, to leave the bar unfinished and to make pauses. If both players start to eat the same bar simultaneously, Bob leaves it to Alice as a true gentleman.

How many bars each of the players will consume?

Input

The first line contains one integer n (1 ≤ n ≤ 105) — the amount of bars on the table. The second line contains a sequence t1, t2, ..., tn (1 ≤ ti ≤ 1000), where ti is the time (in seconds) needed to consume the i-th bar (in the order from left to right).

Output

Print two numbers a and b, where a is the amount of bars consumed by Alice, and b is the amount of bars consumed by Bob.

Examples

Input

5
2 9 8 2 7


Output

2 3
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import time
import sys, io
import re, math
start = time.clock()
alice=0
bob=0
n=int(raw_input())
l=map(int,raw_input().split())
i,j=0,len(l)-1

#１つしか与えられなかった時の判定
if len(l)==1:
    alice+=1
    print alice,bob
#これで後のwhile処理させないらしい。すげえ。
    exit (0)


while 1:
#tmp_iはaliceの食べる方、tmp_jはbobの食べる方。
    tmp_i=l[i]
    tmp_j=l[j]
#bob側のが大きければ先にaliceが一つ食べ終わるの1lice加算
    if tmp_i<tmp_j:
        alice+=1
#aliceが食べ終わったのと同じ量を食べるけどちょっと残る
        l[j]-=l[i]
#残量をチェックし余裕があれば次のを食べる準備
        if i+1<len(l):
            i+=1
#余裕がなかったのでbobの食べ途中も1加算して終了
        if i==j:
            bob+=1
            break
#alice側のが大きければ先にbobが一つ食べ終わるのでbob1加算
    elif tmp_i>tmp_j:
        bob+=1
#bobが食べ終わったのと同じ量を食べるけどちょっと残る
        l[i]-=l[j]
#残量をチェックし余裕があれば次のを食べる準備
        if j-1>=0:
            j-=1
#余裕がなかったのでaliceの食べ途中も1加算して終了
        if i==j:
            alice+=1
            break
#aliceのとbobの食べようとしてるのが同じ量の時
    else:
#共に1加算する
        alice+=1
        bob+=1
#新しいのを食べに行く準備
        if i+1<len(l):
            i+=1
        if j-1>=0:
            j-=1
#余裕がなかったので終了
        if i-j == 1:
            break
#最後の1つはalice優先で終了
        if i==j:
            alice+=1
            break
print alice,bob