#include <stdio.h>

void main() 
{
    char s[10];
    int count = 0;
    char a;

    printf("Enter the string: ");
    for (int i = 0; i != '\0'; i++) 
    {
        scanf(" %s", &s[i]);
    }

    for (int i = 0; i != '\0'; i++) 
    {
        a = s[i];
        for (int j = 0; j != '\0'; j++) 
        {
            if (s[i] != s[j]) 
            {
                count = 1;
            } 
            else if (s[i] == s[j]) 
            {
                count++;
            }
        }
        printf("%s %d", a, count);
    }
}