#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
using namespace std;
//看题解了!!!要不然对于输出一点思路也没有
//改了输入方式
int main()
{
int num[26] = { 0 };
int l, maxn = 0;
char s;
//运用循环和getchar来读取一行带空格的字符串
for (int i = 0; i < 4; i++) {
while (true) {
s = getchar();
if (s == '\n') {
break;
}
if (s <= 'Z' && s>= 'A') {
num[s - 'A']++;
}
}
}
for (int i = 0; i < 26; i++) {
maxn = max(maxn, num[i]);
}
for (int i = maxn; i > 0; i--) { //柱状图从上往下 每行分别输出
for (int j = 0; j < 26; j++) { //对于每一个字母而言
//其中得加个判定:如果是最后一行就输出*或一个空格
if (num[j] >= i) {
if (j == 25) {
cout << "*";
}
else {
cout << "* ";
}
}
else {
if (j == 25) {
cout << " ";
}
else {
cout << " ";
}
}
}
cout << endl;
}
for (int i = 0; i < 26; i++) {
//其实这里也多输出了一个空格 但我懒得弄了 看看能不能过
cout << (char)(i + 'A') << " "; //这里百度了(否则不加(char)只会输出数字)
}
return 0;
}