Buggy python submission (verdict: Runtime Error):
while True:
    a,b=map(int,raw_input().split("."))
    if a<0:break
    s,s2="",""
    while a>=2:
        s+=str(a%2)
        a/=2
    else:
        s+=str(a)
    s=(s+"0"*(8-len(s)))[::-1]

    cnt=0
    while b!=0 and cnt<=4:
        b*=2
        s2+=str(b/10)
        b%=10
        cnt+=1
    s2+="0"*(4-len(s2))
    print s+"."+s2 if len(s2)<=4 else "NA"

Fixed submission:
def convert(x,p):
    if p==12:
	return
    convert(x/2,p+1)
    if p==3:
        ans.append(".")
    ans.append(str(x%2))

while True:
    n=input()
    if n<0:break
    ans=[]
    shift=int(n*16)
    if n==shift/16.0 and shift<4096:
        convert(shift,0)
	print "".join(ans)
    else:
        print "NA"

Buggy python submission (verdict: Runtime Error):
while True:
    a,b=map(int,raw_input().split("."))
    if a<0:break
    s,s2="",""
    while a!=0:
        s+=str(a%2)
        a/=2
    cnt=0
    while b!=0 and cnt<=4:
        b*=2
        s2+=str(b/10)
        b%=10
        cnt+=1
    s2+="0"*(4-len(s2))
    if len(s2)<=4:
        print "%08d.%d"%(int(s[::-1]),int(s2))
    else:
        print "NA"

Fixed submission:
def convert(x,p):
    if p==12:
	return
    convert(x/2,p+1)
    if p==3:
        ans.append(".")
    ans.append(str(x%2))

while True:
    n=input()
    if n<0:break
    ans=[]
    shift=int(n*16)
    if n==shift/16.0 and shift<4096:
        convert(shift,0)
	print "".join(ans)
    else:
        print "NA"

Buggy python submission (verdict: Runtime Error):
while True:
    a,b=map(int,raw_input().split("."))
    if a<0:break
    s,s2="",""
    while a!=0:
        s+=str(a%2)
        a/=2
    cnt=0

    s2="0"*4
    if len(s2)<=4:
        print "%08d"%(int(s[::-1]))
    else:
        print "NA"

Fixed submission:
def convert(x,p):
    if p==12:
	return
    convert(x/2,p+1)
    if p==3:
        ans.append(".")
    ans.append(str(x%2))

while True:
    n=input()
    if n<0:break
    ans=[]
    shift=int(n*16)
    if n==shift/16.0 and shift<4096:
        convert(shift,0)
	print "".join(ans)
    else:
        print "NA"

Buggy python submission (verdict: Runtime Error):
while True:
    a,b=map(int,raw_input().split("."))
    if a<0:break
    s,s2="",""

#    while a!=0:                                                                        
#       s+=str(a%2)                                                                     
#        a/=2                                                                           
    cnt=0

    while b!=0 and cnt<=4:
        b*=2
	s2+=str(b/10)
        b%=10
        cnt+=1
    s2="0"*4

    if len(s2)<=4:
        print "%08d"%(int(format(a,"b")))
    else:
        print "NA"

Fixed submission:
def convert(x,p):
    if p==12:
	return
    convert(x/2,p+1)
    if p==3:
        ans.append(".")
    ans.append(str(x%2))

while True:
    n=input()
    if n<0:break
    ans=[]
    shift=int(n*16)
    if n==shift/16.0 and shift<4096:
        convert(shift,0)
	print "".join(ans)
    else:
        print "NA"

Buggy python submission (verdict: Runtime Error):
while True:
    #a,b=map(int,raw_input().split("."))                                                
    a=input()
    if a<0:break
    s,s2="",""

#    while a!=0:                                                                        
#       s+=str(a%2)                                                                     
#        a/=2                                                                           
    cnt=0

    while b!=0 and cnt<=4:
        b*=2
	s2+=str(b/10)
        b%=10
        cnt+=1
    s2="0"*4

    if len(s2)<=4:
        print "%08d"%(int(format(int(a),"b")))
    else:
        print "NA"

Fixed submission:
def convert(x,p):
    if p==12:
	return
    convert(x/2,p+1)
    if p==3:
        ans.append(".")
    ans.append(str(x%2))

while True:
    n=input()
    if n<0:break
    ans=[]
    shift=int(n*16)
    if n==shift/16.0 and shift<4096:
        convert(shift,0)
	print "".join(ans)
    else:
        print "NA"