public class Solution {
    public static void main(String[] args) throws IOException {
        FileInputStream file1InputStream = new FileInputStream(args[0]);
        byte[] count = new byte[128];
        while (file1InputStream.available() > 0) {
            int a = file1InputStream.read();
            count[a]++;
        }
        for (int i = 0; i < count.length; i++) {
            if (count[i] > 0) {
                System.out.println((char) i + " " + count[i]);
            }

        }
        file1InputStream.close();


    }