#include <bits/stdc++.h>
using namespace std;
int a[26];
string b;
int main()
{
int n,maxn;
cin>>b;
for(int i=0; i<4; i++)
{
n=b.size();
for(int j=0; j<n; j++)
{
if(b[j]>='A' && b[j]<='Z')
{
a[b[j]-'A']++;
}
}
}
for(int i=0; i<26; i++)
{
maxn=max(maxn,a[i]);
}
for(int i=maxn; i>0; i--)
{
for(int j=0; j<26; j++)
{
if(a[j]>=i)
{
cout<<"*";
}
else
{
cout<<" ";
}
cout<<endl;
}
}
for(int i=0; i<26; i++)
{
printf("%c",i+'A');
}
return 0;
}