A,B=0,0 for x in range(1,1001): bx=bin(x)[2:] c0=bx.count("0") c1=bx.count("1") if c0<c1: A+=1 else: B+=1 print(str(A)+" "+str(B))