``````num_A,num_B,num_C,num_D,num_E,num_wrong,num_private = 0,0,0,0,0,0,0
ip_A = range(1,127)
ip_B = range(128,192)
ip_C = range(192,224)
ip_D = range(224,240)
ip_E = range(240,256)
valid = range(0,256)

while True:
try:
two = input().split('~')
ip = two[0].split('.')

if ip[0] !='127' and ip[0] != '0':
i = int(i)
if i in range(0,256):
i = str(bin(i))
i = i[2:]
i = '0'*(8-len(i))+i
else:
num_wrong += 1

if ''  not in ip:
ip[0] = int(ip[0])
ip[1] = int(ip[1])
ip[2] = int(ip[2])
ip[3] = int(ip[3])
if ip[1] in valid and ip[2] in valid and ip[3] in valid:
if ip[0] in ip_A:
num_A += 1
if ip[0] == 10:
num_private += 1
elif ip[0] in ip_B:
num_B += 1
if ip[0] == 172:
if ip[1] in range(16,32):
num_private += 1
elif ip[0] in ip_C:
num_C += 1
if ip[0] == 192 and ip[1] == 168:
num_private += 1
elif ip[0] in ip_D:
num_D += 1
elif ip[0] in ip_E:
num_E += 1
else:
num_wrong += 1
else:
num_wrong += 1
else:
num_wrong += 1
except:
break

print(str(num_A)+' '+str(num_B)+' '+str(num_C)+' '+str(num_D)+' '+str(num_E)+' '+str(num_wrong)+' '+str(num_private))

``````