def iswrongyan(ip2): index = [0 for x in range(32)] for i in range(0,8): index[7-i] = ip2[0]%2 ip2[0] = int(ip2[0]/2) for i in range(0,8): index[15-i] = ip2[1]%2 ip2[1] = int(ip2[1]/2) for i in range(0,8): index[23-i] = ip2[2]%2 ip2[2] = int(ip2[2]/2) for i in range(0,8): index[31-i] = ip2[3]%2 ip2[3] = int(ip2[3]/2) for i in range(len(index)-1): if index[i] == 0 and index[i+1] == 1: return True if sum(index) == 0 or sum(index) == 32: return True return False num = [0,0,0,0,0,0,0] while True: try: ip = input().split('~') ip1 = ip[0].split('.') ip2 = ip[1].split('.') if '' in ip1 or '' in ip2: #错误码,位数不足 num[5] = num[5] + 1 else: for i in range(4): #位数正确码 ip1[i] = int(ip1[i]) ip2[i] = int(ip2[i]) if iswrongyan(ip2) and ip1[0]!= 0 and ip1[0]!=127: #判断掩码是否错误和ip地址是否正确 num[5] = num[5] + 1 else: #其余都是正确码 if ip1[0]>=1 and ip1[0] <= 126: num[0] = num[0] + 1 #A类 if ip1[0]>=128 and ip1[0] <= 191: num[1] = num[1] + 1 #B类 if ip1[0]>=192 and ip1[0] <= 223: num[2] = num[2] + 1 #C类 if ip1[0]>=224 and ip1[0] <= 239: num[3] = num[3] + 1 #D类 if ip1[0]>=240 and ip1[0] <= 255: num[4] = num[4] + 1 #E类 if ip1[0] == 10: num[6] = num[6] + 1 #私有ip1 if ip1[0] == 172 and ip1[1]>=16 and ip1[1]<=31: num[6] = num[6] + 1 #私有ip2 if ip1[0] == 192 and ip1[1] == 168: num[6] = num[6] + 1 #私有ip3 except: res = '' for i in range(7): res = res + str(num[i]) + ' ' print(res) break