import java.util.Arrays;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int aCount = 0, bCount = 0, cCount = 0, dCount = 0, eCount = 0, errorCount = 0, privateCount = 0;
while (scanner.hasNextLine()) {
String s = scanner.nextLine();
try {
String[] arr = s.split("~");
int[] ipArr = Arrays.asList(arr[0].split("\\.")).stream().mapToInt(Integer::valueOf).toArray();
int[] maskArr = Arrays.asList(arr[1].split("\\.")).stream().mapToInt(Integer::valueOf).toArray();
if (ipArr.length != 4 || maskArr.length != 4) {
throw new Exception();
}
for (int i = 0; i < 4; i++) {
if (ipArr[i] < 0 || ipArr[i] > 255 || maskArr[i] < 0 || maskArr[i] > 255) {
throw new Exception();
}
}
if (ipArr[0] != 0 && ipArr[0] != 127) {// 检查子网掩码
String bi = "";
for (int i = 0; i < 4; i++) {
String b = Integer.toBinaryString(maskArr[i]);
while (b.length() != 8) {
b = "0" + b;
}
bi += b;
}
if (bi.charAt(0) != 49 || bi.charAt(bi.length() - 1) != 48) {
throw new Exception();
}
int left = 0, right = bi.length() - 1;
for (;left < right; left++) {
if (bi.charAt(left) == 48) {
break;
}
}
for (;right >= 0; right--) {
if (bi.charAt(right) == 49) {
break;
}
}
if (left - right != 1) {
throw new Exception();// 非法子网掩码
}
}
if (ipArr[0] >= 240 && ipArr[0] <= 255) {// e类地址
eCount++;
} else if (ipArr[0] >= 224) {// d类地址
dCount++;
} else if (ipArr[0] >= 192) {// c类地址
cCount++;
} else if (ipArr[0] >= 128) {// b类地址
bCount++;
} else if (ipArr[0] >= 1 && ipArr[0] <= 126) {// a类地址
aCount++;
}
if (ipArr[0] == 10
|| (ipArr[0] == 172 && ipArr[1] >= 16 && ipArr[1] <= 31)
|| (ipArr[0] == 192 && ipArr[1] == 168)) {// 私有地址
privateCount++;
}
} catch (Exception e) {
errorCount++;// 非法ip或非法子网掩码
}
}
System.out.println(aCount + " " + bCount + " " + cCount + " " + dCount + " "
+ eCount + " " + errorCount + " " + privateCount);
}
}