import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int countA = 0;
        int countB = 0;
        int countC = 0;
        int countD = 0;
        int countE = 0;
        int countError = 0;
        int countPrivate = 0;
        while (sc.hasNextLine()) {
            String line = sc.nextLine();
            String[] split = line.split("~");
            String ip = split[0];
            String mask = split[1];
            String[] maskArr = mask.split("\\.");
            String[] ipArr = ip.split("\\.");
            if (ipArr[0].equals("0") || ipArr[0].equals("127")) {
                continue;
            }
            if (!isOKMask(maskArr) || !isOKAddress(ipArr)) {
                countError++;
            } else {
                int firstIp = Integer.parseInt(ipArr[0]);
                int secondIp = Integer.parseInt(ipArr[1]);
                if (firstIp >= 1 && firstIp <= 126) {
                    if (firstIp == 10) {
                        countPrivate++;
                    }
                    countA++;
                } else if (firstIp >= 128 && firstIp <= 191) {
                    if (firstIp == 172 && secondIp >= 16 && secondIp <= 31) {
                        countPrivate++;
                    }
                    countB++;
                } else if (firstIp >= 192 && firstIp <= 223) {
                    if (firstIp == 192 && secondIp == 168) {
                        countPrivate++;
                    }
                    countC++;
                } else if (firstIp >= 224 && firstIp <= 239) {
                    countD++;
                } else if (firstIp >= 240 && firstIp <= 255) {
                    countE++;
                }
            }
        }
        sc.close();
        System.out.println(countA + " " + countB + " " + countC + " " + countD + " " + countE + " " + countError + " " + countPrivate);
    }

    private static boolean isOKMask(String[] maskArr) {
        String maskBinary = "";
        for (String s : maskArr) {
            String binaryString = Integer.toBinaryString(Integer.parseInt(s));
            if (binaryString.length() < 8) {
                for (int i = 0; i < 8 - maskArr.length; i++) {
                    binaryString = 0 + binaryString;
                }
            }
            maskBinary += binaryString;
        }
        return maskBinary.lastIndexOf("1") < maskBinary.indexOf("0");
    }

    private static boolean isOKAddress(String[] ipArr) {
        if (ipArr.length != 4) {
            return false;
        }
        for (String s : ipArr) {
            for (int i = 0; i < s.length(); i++) {
                if (!Character.isDigit(s.charAt(i))) {
                    return false;
                }
            }
            int digit = Integer.parseInt(s);
            if (digit < 0 || digit > 255) {
                return false;
            }
        }
        return true;
    }
}