data = list(map(int, input().split()))

def innerloop(s):

    val=data[s]
    while (s<len(data)):
        if data[s] is not val:
            break;
        s+=1
    e=s-1
    return e
    
# make all '0'
cnt=0
idx=0
while(idx<len(data)):
    if data[idx]==1:
        print(idx, innerloop(idx))
        idx=innerloop(idx)
        cnt+=1
    idx+=1

# make all '1'
while(idx<len(data)):
    if data[idx]==0:
        print(idx, innerloop(idx))
        idx=innerloop(idx)
        cnt+=1
    idx+=1

+ Recent posts