#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char *argv[])
{
cout<<"input the numbers"<<endl;
string str;
getline(cin,str);
char res[50];
res[0]='\0';
int len=str.length();
int k;
int count=1;
for(k=0;k<len;k++)
{
if(str[k+1]==str[k])
count++;
else
{
sprintf(res+strlen(res),"%c%d",str[k],count);
count=1;
}
}
if(str[k]==str[k-1])
count++;
else
count=1;
sprintf(res+strlen(res),"%c%d ",str[k],count);
cout<<res<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}