#include <stdio.h>int main() {char ch[1000] = { 0 };char ch2[1000] = { 0 };int main_x=1;//主要的进度int before=0;int later=1;int later2;int num;//次数int numa;//临时变量int numb;int end=0;scanf("%s", ch);while (ch[end] != '\0')++end;--end;while (main_x!=end+1) {for (; later!=end+1; ++later) {if ((ch[later] == ch[before])&&(ch[before]>='a'&&ch[before]<='z'))continue;if (later-before!=1) {num = 0;ch[before] -= 32;later2 = later;for (int i = before; i < later; ++i)++num;while (later-- != before + 1)ch[later] = '\0';numa = num * 10;numb = 0;while (numa /= 10)++numb;while (numb) {++later;if (numb != 1)numa = num / ((numb - 1) * 10);elsenuma = num;numa %= 10;ch[later] = numa + '0';--numb;}numa = 0;for (int i = later2; i < end + 1; ++i) {ch2[numa] = ch[i];++numa;}for (int i = before; i <= later; ++i) {ch2[numa] = ch[i];++numa;}for (int i = 0; i < before; ++i) {ch2[numa] = ch[i];++numa;}for (int i = 0; i <= end; ++i) {if (ch2[i] != '\0')ch[i] = ch2[i];else ch[i] = '\0';}while (end) {ch2[end] = '\0';--end;}ch2[0] = '\0';before=0;later=1;main_x = 1;while (ch[end] != '\0')++end;--end;break;}++before; ++later; ++main_x;break;}}puts(ch);return 0;}