n=int(input())
s=input()
krut=False
i1=0
while not krut:
    while s[i1]=='0' and i1<n: i1+=1
    i2=i1+1
    while s[i2]=='0' and i2<n: i2+=1
    if (i2-i1+1)%2==0: krut=True
    else:
        i2+=1
        if s[i2]=='0': krut=True
        else: i1=i2-1
print(i1+1,i2+1)