semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	char m[100];
	int count[100]={0},i=0,t=0;
	cin>>m;
	for(i=0;m[i]!='\0';i++)
	{
		if(count[t]==0)
			count[t]++;
		else if( m[i]==m[i-1] ||m[i] -m[i-1]=='A'-'a'||m[i]-m[i-1]=='a'-'A')
			count[t]++;
		else
		{
			t++;
			count[t]=1;
		}
	}
	int sum=0;
	for(i=0;i<=t;i++)
	{
		sum+=count[i];
		if(m[count[i]-1]>='A'&&m[count[i]-1]<='Z')
			;
		else
			m[count[i]-1]+='A'-'a';
		cout<<'('<<m[sum-1]<<','<<count[i]<<')';
	}
	cout<<endl;
	return 0;
}
main()
{
      char str[1001]={'\0'};
      int i=0,count=0;
      scanf("%s",str);
      char b;
      
      for(;str[i]!='\0';i++)
      {  
         if(str[i]<='z'&&str[i]>='a')
           {
                 str[i]+='A'-'a';
           }
      }    
      i=0;
      b=str[0];
      for(;str[i]!='\0';i++)
      {
            if(b==str[i])
             count++;
            else
             {
                     printf("(%c,%d)",b,count);
                     b=str[i];
                     count=0;
                     i--;
             }
      } 
      printf("(%c,%d)",b,count);

    
}
//?????????
void change(char * a)
{
	int l=strlen(a);
	int i;
	for(i=0;i<l;i++)
	{
		if((a[i]>='a')&&(a[i]<='z'))
		{
			a[i]=a[i]-'a'+'A';
		}
	}
	return;
}

int main()
{
	int temp_num;
	int l;
	int i;
	char temp_char;
	char st[1024];   //?????????????????????
	scanf("%s",st);
	change(st);
	//printf("%s",st);  //debug
	l=strlen(st);
	temp_num=1;
	temp_char=st[0];
	for(i=1;i<=l;i++)  //?<???????????
	{
		if(st[i]==temp_char)
			temp_num++;
		else
		{
			printf("(%c,%d)",temp_char,temp_num);
			temp_char=st[i];
			temp_num=1;
		}
	}
	return 0;
}
main()
{
   char p[1001],i=0,count=1;
   int l;
   scanf("%s",p);
   l=strlen(p);
   while(1)
        {
           if(l==1)
              {
              if(p[0]>='A'&&p[0]<='Z')
                   printf("(%c,%d)",p[0],count);
                else
                  printf("(%c,%d)",p[0]-'a'+'A',count);
                break;
              }  
           else if(p[i]==p[i+1]||(p[i]-p[i+1]=='a'-'A')||(p[i]-p[i+1]=='A'-'a'))       
               {
               count++;
               i++;
               }  
           else
              {
                if(p[i]>='A'&&p[i]<='Z')
                   printf("(%c,%d)",p[i],count);
                else
                  printf("(%c,%d)",p[i]-'a'+'A',count);
                i++;
                count=1;         
              } 
           if(i==l)
           break;   
        }  
     
}
int main ()
{
	char str[1000];
	cin >> str;
	int i, len, count = 1;
	len = strlen(str);
	for (i = 0; i < len; i++ )
	{
		if (str[i] - 'a' >= 0 && str[i] - 'z' <= 0)
		{
			str[i] = str[i] - 32;
		}
	}
	if (len == 1)
	{
		cout << "(" << str[0] << "," << count << ")" ;
	}
	else
	{
		for (i = 0; i < len - 1; i++ )
		{
			count = 1;
			while (str[i] == str[i + 1])
			{
				count++ ;
				i++ ;
			}
			cout << "(" << str[i] << "," << count << ")" ;
		}
		if (count == 1)
		{
			cout << "(" << str[i] << "," << count << ")";
		}
	}
	cout << endl;

	return 0;
}
int main()
{
    char str[1000];
	int start = 0;
    cin >> str;
	int i,s=0;
	int len=strlen(str);
	for (i=start;i < len;i++)
	{
		if(str[i] - '0' == str[i+1] - '0' || str[i] - '0' == str[i+1] - '0' + 32 || str[i] - '0' == str[i+1] - '0' - 32)
			s++;
		else
			if(str[i] < 'a')
				{cout <<"("<<str[i]<<"," << s+1 << ")";s=0;start=i+1;}
			else
				{str[i] = str[i] - 32;cout <<"("<<str[i]<<"," << s+1 << ")";s=0;start=i+1;}
	}
	return 0;
}
int main()
{
 char a[1001];
cin.getline( a, 1001 );
for( int i = 0; i < strlen( a ); i++ )
{
if( a[i] >= 97 )
	a[i] -= 32;
}
int i = 0 ;
while( i < strlen( a ) )
{
	int count = 1;
while( a[i] == a[ i + 1 ] )
{ i++;count++;}
cout << "(" << a[i] << "," << count << ")";
i++;
}
return 0;


}
int main()
{
	char a[1020], temp;
	cin >> a;
	int la = strlen(a), i, num = 0;
	for (i = 0; i <= la - 1; i++)
	{
		if ((a[i] >= 97) && (a[i] <= 122))
			a[i] = a[i] - 32;
	}
	temp = a[0];
	cout << "(" << temp << ",";
	for (i = 0; i <= la - 1; i++)
	{
		if (a[i] == temp)
			num++;
		if (a[i] != temp)
		{
			temp = a[i];
			cout << num << ")(" << temp << ",";
			num = 1;
		}
	}
	cout << num << ")" << endl;
	return 0;
}
void main()
{
	char str[1000];
	int i,k=1;
	scanf("%s",&str);
	for(i=0;i<=999;i++)
	{
		if(str[i]<='z'&&str[i]>='a')
			str[i]=str[i]-32;
	}

	for(i=0;i<999;i++)
	{
		if(str[i+1]=='\0')
		{
			printf("(%c,%d)",str[i],k);
			break;
		}

		else if(str[i]==str[i+1])
		{
			k++;
		}
		else if(str[i]!=str[i+1])
		{
			printf("(%c,%d)",str[i],k);
			k=1;
		}
	}
}
int main()
{
	char str[1000];
	int flag[1000] = {0}, i = 0, j, sum[1000] = {0};
	cin >> str;
	for (i = 0; i < strlen(str); i ++)
	{
		if ('a' <= str[i] && str[i] <= 'z')
			str[i] = str[i] - 32;
	}
	i = 0;
	while (i < strlen(str))
	{
		if (flag[i] == 0)
		{
			for (j = i + 1;;j ++)
			{
				if (str[j] == str[i])
				{
					sum[i] ++;
					flag[j] = 1;
				}
				else
					break;
			}
			i = j;
		}
		else
			i ++;
	}
	for (i = 0; i < strlen(str); i ++)
	{
		if (flag[i] == 0)
		{
			cout << "(" << str[i] << "," << sum[i] + 1 << ")";
		}
	}
	return 0;
}
main()
{
	int a,i,j,k,num,length;
	char words[1000];
	gets(words);
	length=strlen(words);	
	for(i=0;i<length;i++)
	words[i]=toupper(words[i]);
	for(i=0;i<length;i++)
	{
			num=1;
		for(j=i;j<length;j++)
		{
			if(words[j]==words[j+1]) num++;
			else break;
		}
		if(words[i]!=words[i-1])
			printf("(%c,%d)",words[i],num);
	}

}
int main()
{
	char m[1000];
	int n,i,j=1;
	gets(m);
	n=strlen(m);
	for(i=1;i<n;i++)
	{
		if(m[i]>='A'&&m[i]<='Z')
		{
			if(m[i]!=m[i-1]&&m[i]!=m[i-1]-32)
			{
				if(m[i-1]>='A'&&m[i-1]<='Z')
					printf("(%c,%d)",m[i-1],j);
				else if(m[i-1]>='a'&&m[i-1]<='z')
					printf("(%c,%d)",m[i-1]-32,j);
				j=0;
			}
		}
		else if(m[i]>='a'&&m[i]<='z')
		{
			if(m[i]!=m[i-1]&&m[i]!=m[i-1]+32)
			{
				if(m[i-1]>='A'&&m[i-1]<='Z')
					printf("(%c,%d)",m[i-1],j);
				else if(m[i-1]>='a'&&m[i-1]<='z')
					printf("(%c,%d)",m[i-1]-32,j);
				j=0;
			}
		}
		j=j+1;
	}
	if(m[n-1]>='A'&&m[n-1]<='Z')
		printf("(%c,%d)",m[n-1],j);
	else
		printf("(%c,%d)",m[n-1]-32,j);
	return 0;
}
int main()
{
	char arr[1001];
	cin >> arr;
	int i,len,temp=0;
	len=strlen(arr);
	for(i=0;i<len;i++){
		if((int)arr[i] > 92) arr[i] = (char)((int)arr[i]-32);
	}
	for(i=1;i<len;i++){
		if(arr[i] != arr[i-1]){
			cout << '(' << arr[i-1] << ',' << i-temp << ')';
			temp=i;
		}}
	cout << '(' << arr[len-1] << ',' << len-temp << ')' << endl; 
	return 0;
}
int main()
{
	char str[1100];
	int i=0,p=0,used[1100];
	int len=0,sum=0;
	cin.getline(str,1100);
	len=strlen(str);
	for(i=0;i<len;i++)
	{
		if(str[i]>='a'&&str[i]<='z')
			str[i]=str[i]-32;
		else
			str[i]=str[i];
	}
	for(i=0;i<len;i++)
	{
		used[i]=1;
	}
	for(i=0;i<len;i++)
	{
		if(used[i]!=0)
		{
			p=i+1;
			while(str[i]==str[p])
			{
				used[i]++;
				used[p]=0;
				p++;
			}
		}
	}
	for(i=0;i<len;i++)
	{
		if(used[i]!=0)
			cout<<"("<<str[i]<<","<<used[i]<<")";
	}
	return 0;
}
/*
 * final2.cpp
 *
 *  Created on: 2013-1-12
 *      Author: wangyinzhi
 */

int main(){
	char a[1001];
	cin>>a;
	int l=strlen(a);
	int number=1;
	a[l]='2';
	for(int i=0;i<l;i++){
		if(a[i+1]==a[i]||a[i+1]-a[i]=='A'-'a'||a[i]-a[i+1]=='A'-'a'){
			number++;
		}
		else {
			if(a[i]>=97) a[i]=a[i]-32;
			cout<<"("<<a[i]<<","<<number<<")";
			number=1;
		}
	}
	return 0;
}
int main()
{
 char in[1000];
 int a=1,b,c;
 scanf("%s",in);
 for(int i=0;in[i]!='\0';i++) 
    {
         if(in[i]>='a') in[i]=in[i]-'a'+'A';
         else in[i]=in[i];
        }   
 
 for(int i=0;in[i]!='\0';i++)
   if(in[i]==in[i+1]){ a++;
                        continue  ;}
   else
   {  printf("(%c,%d)",in[i],a);
       a=1;
   }
 
      
  return 0;     
       
}
int main()
{ char str[1001];
int num [27],flag,i,j; 
scanf("%s",str);

for(j=0;j<=27;j++)
{num[j]=1;} 
for (i=0;i<=strlen(str);i++)
{   if (str[i] >= 'a' &&  str[i] <='z')
 str[i]=str[i]-'a'+'A'; 
    } 

for (i=1;i<=strlen(str);i++)
{   
    if (str[i]==str[i-1])
    {num[str[i]-'A']++;
}
    else
    {
    
    printf ("(%c,%d)",str[i-1],num[str[i-1]-'A']);
    num[str[i-1]-'A']=1; 
 
     } 
     
     
    
    
    
} 
        

             
             
            
          
   
   
   
   
   
   
   
   
   
   
   

   
    return 0;
}
int main()
{
	char str[1000];
	int i,n,s,count;
	char k;
	scanf("%s",str);
	n=strlen(str);
	if(str[0]<97)
	k=str[0];
	else
		k=str[0]-32;
	count=1;
	for(i=1;i<n;i++)
	{
		if(str[i]==k||str[i]-32==k)
		{
			count=count+1;
		}
		else
		{
			printf("(%c,%d)",k,count);
			if(str[i]<97)
	        k=str[i];
	        else
		    k=str[i]-32;
			count=1;}
		
	}
		printf("(%c,%d)",k,count);
	return 0;
}
int main()
{
	char a[1000];
	int i;
	cin >> a;
	for(i=0;a[i]!='\0';i++)
	{
		if(a[i] >= 'a')
			a[i] = a[i] - ('a' - 'A');
	}
	for(i=0;a[i]!='\0';i++)
	{
		int count = 0;
		while(a[i] == a[++i])
		{
			count++;
		}
		count++;
		i--;
		cout << "(" << a[i] << "," << count << ")";
	}
	return 0;
}
int main()
{
    int i,j,c;
    char a[1001];
    scanf("%s",a);
    j=1;
    for(i=0;i<1001;i++)
    {
      if(a[i]=='\0')
      {c=i;
      break;}
    }
    for(i=0;i<c;i++)
    {
       if(((a[i]-'a')==(a[i+1]-'a'))||((a[i]-'a')==(a[i+1]-'A'))||((a[i]-'A')==(a[i+1]-'a')))
         j+=1;
        else    
           {
             if((a[i]>='a')||(a[i]<'A'))
              {a[i]=a[i]+'A'-'a';}
           printf("(%c,%d)",a[i],j);
            j=1;
           }
    }
   // getchar();
    //getchar();
    return 0;
}
main()
{
	int i,n=0,k;
	char bs[1000];
	scanf("%s",bs);
	int a[1000];
	char cs[1000];
	for(i=0;bs[i]!='\0';i++)
	{
		if(bs[i]>='a'&&bs[i]<='z')
		bs[i]=bs[i]-'a'+'A';
		a[i]=1;
	}
	cs[0]=bs[0];
	for(i=1;bs[i]!='\0';i++)
	{
		if(bs[i]==cs[n])
		{
		a[n]++;
		}
		else
		{
			n++;
			cs[n]=bs[i];
		}
	}
	for(i=0;i<=n;i++)
	{
		printf("(%c,%d)",cs[i],a[i]);
	}
}
int main()
{
    char a[1000];
    int count=1,i;
    gets(a);
    for(i=0;i<strlen(a);i++)
    {
                            if((a[i]==a[i+1])||(a[i]-a[i+1]=='a'-'A')||(a[i+1]-a[i]=='a'-'A'))
                            {
                                            count++;
                            }
                            else
                            {
                                if(a[i]>='a')
                                {
                                             a[i]=a[i]-'a'+'A';
                                             printf("(%c,%d)",a[i],count);
                                             count=1;
                                }
                                else
                                {
                                    printf("(%c,%d)",a[i],count);
                                    count=1;
                                }
                            }
    }
    getchar();
    getchar();
}
int main(){

	char s[2000];

	cin>>s;

int p=0;

while(s[p]!=0){

	int sum=1;
	char c=s[p];

	while((s[p+1]-s[p]==0)||(s[p+1]-s[p])=='A'-'a'||(s[p+1]-s[p])=='a'-'A'){
		sum++;
		p++;
	}

	char out;

	if(c>='a') out=(char)(c-'a'+'A');
	else out=c;

	cout<<'('<<out<<','<<sum<<')';

	p++;

}

	return 0;

}
int main()
{
    char a[1000];
    gets(a);
    char t;
    int i,l,count;
    l=strlen(a);
    for(i=0;i<l;i++)
        if(a[i]>='a'&&a[i]<='z')
            a[i]=a[i]-'a'+'A';
    t=a[0];
    count=1;
    for(i=1;i<l;i++)
    {
        if(a[i]==t)
            count++;
        else
        {
            printf("(%c,%d)",t,count);
            t=a[i];
            count=1;
        }
    }
    t=a[l-1];
    printf("(%c,%d)\n",t,count);
}
struct ys
	{char zm;
int gs;} ys[1001];

void main()
{int i,t,len;
char a[1001]={'\0'};

gets(a);
len=strlen(a);

for(i=0;i<1001;i++)
ys[i].gs=0;


ys[0].zm=a[0];
ys[0].gs=1;
t=0;
for(i=1;i<len;i++)
{if(a[i]==ys[t].zm||a[i]==(ys[t].zm+32)||a[i]==ys[t].zm-32)
ys[t].gs++;
else
{t++;
ys[t].zm=a[i];
ys[t].gs=1;}}

for(i=0;i<=t;i++)
{if(ys[i].zm>='a')
ys[i].zm=ys[i].zm-32;
	printf("(%c,%d)",ys[i].zm,ys[i].gs);}


}
int main()
{
	char a[1010];
	int len = 1;
	cin >> a;
	if(strlen(a) == 1)
	{
		if (a[0] >= 65 && a[0] <= 90)
		{
			cout << "(" << a[0] << ",1)";
		}
		else
		{
			cout << "(" << (char)(a[0] - 32) << ",1)";
		}
	}
	for(int i = 1; a[i] != '\0'; i++)
	{
		if (a[i] == a[i - 1] || a[i] == a[i - 1] + 32 || a[i] == a[i - 1] - 32)
		{
			len++;
		}
		else
		{
			if (a[i - 1] >= 65 && a[i - 1] <= 90)
			{
				cout << "(" << a[i - 1] << "," << len << ")";
			}
			else
			{
				cout << "(" << (char)(a[i - 1] - 32) << "," << len << ")";
			}
			len = 1;
		}
		if (i == strlen(a) - 1)
		{
			if (a[i] >= 65 && a[i] <= 90)
			{
				cout << "(" << a[i] << "," << len << ")";
			}
			else
			{
				cout << "(" << (char)(a[i] - 32) << "," << len << ")";
			}
		}
	}
	cout << endl;
	return 0;
}
main()
{
      char s[1010];
      int l,i,j,k,x;
      char c;
      
      gets(s);
      l=strlen(s);
      for (i=0;i<l;i++)
          s[i]=toupper(s[i]);
      i=0;
      while (i<l)
      {
            c=s[i];
            j=i+1;
            while (j<l && s[j]==c)
                j++;
            x=j-i;
            printf("(%c,%d)",c,x);
            i=j;
      }
      //puts(s);
      printf("\n");
      getchar();
      getchar();
            
}
/*
 * Run-lengthEncoding.cpp
 *
 *  Created on: 2012-12-25
 *      Author: Cui Zhaoxiong Class4 1200012931
 */
int main(){
	char input[1005];
	cin >>input;
	char past;
	char zipc[1005];
	int zipi[1005];
	int flag=0;
	int length=strlen(input);
	for (int i=0;i<=length-1;i++){
		if (input[i]>='a') input[i]=input[i]-'a'+'A';
		if (i==0) {
			past=input[0];
			zipc[0]=past;
			zipi[0]=1;
		}else{
			if (past==input[i]){
				zipi[flag]++;
			}else{
				flag++;
				zipc[flag]=input[i];
				zipi[flag]=1;
			}
			past=input[i];
		}
	}
	for (int i=0;i<=flag;i++){
		cout <<'(' <<zipc[i] <<',' <<zipi[i] <<')';
	}
	return 0;
}
int main()
{
	int n,i,j=0;
	char a[1000];
	struct comp
	{
		char letter;
		int num;
	}com[1000];
	scanf("%s",a);
	n=strlen(a);
	for(i=0;i<n;i++)
	{
		com[i].num=0;
	}
	for(i=0;i<n;i++)
	{
		if(a[i]>=97&&a[i]<=122)
			a[i]=a[i]-32;
	}
	for(i=0;i<n;i++)
	{
		if(a[i]==com[j].letter)
		{
			com[j].num++;
		}
		else
		{
			j++;
			com[j].letter=a[i];
			com[j].num++;
		}
	}
	for(i=1;i<=j;i++)
	{
		printf("(%c,%d)",com[i].letter,com[i].num);
	}
	return 0;
}
/*
 * 12-5.cpp
 *
 *  Created on: 2011-12-31
 *      Author: 2011
 */

int main(){
	char s[1000];
	char m;
	int len,i,num;
	cin.getline(s,1000);
	len=strlen(s);
	for (i=0;i<len;i++) if ('a'<=s[i]&&s[i]<='z')
		s[i]=s[i]-'a'+'A';
	i=1;
	m=s[0];num=1;
	while(i<len){
		if (s[i]==m) num++;
		else{
			cout<<'('<<m<<','<<num<<')';
			m=s[i];
			num=1;
		}
		i++;
	}
	cout<<'('<<m<<','<<num<<')';
	return 0;
}
int main()
{
	char s[1000];
	int i,p;
	gets(s);
	for(i=0;i<strlen(s);i++)
	{
		p=1;
		if(s[i]!=s[i+1])
		{
			if(s[i]>='a'&&s[i]<='z')
			{
				s[i]-='a'-'A';
			}
			cout<<"("<<s[i]<<","<<1<<")";
		}
		else
		{
			while(s[i]==s[i+1]||s[i]==s[i+1]+'A'-'a'||s[i]==s[i+1]+'a'-'A')
			{
				i++;
			    p++;
			}
			if(s[i]>='a'&&s[i]<='z')
			{
				s[i]-='a'-'A';
			}
			cout<<"("<<s[i]<<","<<p<<")";
		}
	}
	cout<<endl;
	return 0;
}
int main()
{
	char str[1001];

	cin.getline(str,1001);

	int i,counter=0;
	char alp[1000]={0};
	int num[1000]={0};
	int flag=0;

	for (i=0;str[i]!='\0';i++)
	{
		if (str[i]>='a'&& str[i]<='z')
			str[i]=str[i]-'a'+'A';
		if (str[i]==alp[counter])
			num[counter]++;
		else
		{
			counter++;
			alp[counter]=str[i];
			num[counter]++;
		}
	}

	for (i=1;i<=counter;i++)
	{
		cout<<'('<<alp[i]<<','<<num[i]<<')';
	}


	return 0;
}
int main()
{
 char s[1000];
 gets(s);
 int i;
 int count=1;
 int a[1000];
 for(i=0;i<100;i++)
 a[i]=1;
 for(i=1;s[i-1]!='\0';i++)
 {
  if(s[i]==s[i-1]|| s[i]-s[i-1]==32||s[i]-s[i-1]==-32)
  a[count]++;
  else
  {
   if(s[i-1]>'Z'||s[i-1]<'A')
   {
     printf("(%c,%d)",s[i-1]-32,a[count]);
     count++;
    }
   else
   {
    printf("(%c,%d)",s[i-1],a[count]);
    count++;
   }
}
 }
 getchar();
}
main()
{
      char a[1000];
      scanf("%s",a);
      int i;
      for(i=0;a[i]!='\0';i++)
      {
        if('a'<=a[i]&&a[i]<='z')
        a[i]=a[i]+'A'-'a';
      }
      for(i=0;a[i]!='\0';i++)
      {
        int b=0;
        while(a[i+1]==a[i])
        {
          b=1+b;
          i=i+1;
          }
        printf("(%c,%d)",a[i],b+1);
      }
}
main()
{
int a,b,c,i,j,l,x,n;
n=0;
char d[2000];
char m;
int e[10000];
scanf("%s",d);
l=strlen(d);
for(i=0;i<l;i++)
if(d[i]>='a' && d[i]<='z')
d[i]=d[i]-'a'+'A';
for(i=0;i<1000;i++)
e[i]=0;
for(i=0;i<l;i++)
{n++;
 if(d[i+1]!=d[i])
 {m=d[i];
 printf("(%c,%d)",m,n);
 n=0;}
}

getchar();
getchar();
}
int main()
{
	char ch[1000], a;
	int size, i = 0,  b, lonth;
	cin >> ch;
	a = ch[0];
	if (a >= 'a' && a <= 'z')
		a += ('A' - 'a');
	size = 0;
	lonth = strlen(ch);
	for (i = 0; i <= lonth; )
	{
		b = ch[i] - a;
		if (b == 0 || b == ('a' - 'A'))
		{
			size++;
			i++;
		}
		else
		{
			cout << "(" << a << "," << size << ")";
			a = ch[i];
			if (a >= 'a' && a <= 'z')
				a = 'A' + a - 'a';
			size = 0;
		}
	}
	return 0;
}
char str[1000];
int num[1000]={0};
char w[1000]={'\0'};
int ch='a'-'A';
int main()
{
	cin>>str;
	int len;
	int j=0;
	if(str[0]>'Z')
		w[0]=str[0]-ch;
	else
		w[0]=str[0];
	num[0]++;
	
	len=strlen(str);
	for(int i=1;i<len;i++)
	{
		if(str[i]==w[j]||str[i]-ch==w[j])
		{
			num[j]++;
			continue;
		}
		else
		{
			j++;
			num[j]++;
			if(str[i]>'Z')
				w[j]=str[i]-ch;
			else
				w[j]=str[i];
		}
	}
	for(int i=0;i<1000;i++)
	{
		if(num[i])
			cout<<"("<<w[i]<<","<<num[i]<<")";
	}
	return 0;
}
main ()
{
	char a[1001],b[1001];
	int c[1001];
	int m=0;
	scanf ("%s",a); 
		b[0]=a[0];
	for (int l=0;l<=1000;l++)
		{c[l]=1;
		b[l]=0;	
	}
	for (int i=0;i<=strlen(a);i++)
		{
			if (a[i]==a[i+1]||a[i]==a[i+1]+32||a[i]==a[i+1]-32)
				c[m]++;
			else 
				{b[m]=a[i];
				m++;} 
		}
	for (int k=0;k<strlen(b);k++)
	{	if (b[k]>95)
		b[k]=b[k]-32; 
		printf ("(%c,%d)",b[k],c[k]);	 
}
}
main ()
{
     char a[1000];
     char b[1000];
     int c[1000];
     for (int i=0;i<1000;i++)
     c[i]=1;
     scanf ("%s",a);
     int l;
     l=strlen(a);
     for (int i=0;i<l;i++)
     {
         if (a[i]>'Z')
         a[i]=a[i]-'a'+'A';
     }
     int n;
     n=0;
     for (int i=0;i<l;i++)
     {
         if (i==0)
         {
                  b[0]=a[0];
         }
         else if (a[i]==a[i-1])
         {
              c[n]=c[n]+1;
         }
         else if (a[i]!=a[i-1])
         {
              n=n+1;
              b[n]=a[i];
         }
     }
     for (int i=0;i<=n;i++)
     {
         printf ("(%c,%d)",b[i],c[i]);
     }
     getchar ();
     getchar ();
}
main()
{
      char c[1000];
      scanf("%s",c);
      int i,j;
      i=0;
      for(int k=0;c[k]!='\0';k++)
      {
              if(c[k]>='a'&&c[k]<='z')
              c[k]=c[k]-'a'+'A';
              }
      while(c[i]!='\0')
      {
                   for(j=i;;j++)
                   {
                                      if(c[j]!=c[i])
                                      break;
                                      }
      printf("(%c,%d)",c[i],(j-i));
      i=j;
      }
      }
main()
{
      char a[1001],b[1001];
      int c[1001],i,m,M;
    
      scanf("%s",a);
      
     
      for(i=0;a[i]!=0;i++){
                               
         if('a'<=a[i]&&a[i]<='z')
            a[i]=a[i]-'a'+'A';
      }
            
    
        
       for(i=0,m=0,c[m]=1,b[m]=a[0];a[i+1]!=0;i++){
       
            if(a[i]==a[i+1])
               c[m]++;
               
            else
              {m++; 
              b[m]=a[i+1];
              c[m]=1;
             }
         
       }
       M=m;
       for(m=0;m<=M;m++){
       printf("(%c,%d)",b[m],c[m]);}
       
}
char f(char c[1000])
{
int i;
for(i=0;i<1000;i++)
if(c[i]>='a'&&c[i]<='z')
c[i]=c[i]+'A'-'a';
}
main()
{int i,m=1;
char a[1000];
gets(a);
f(a);
for(i=0;a[i]!='\0';i++)
{if(a[i]==a[i+1])
m++;
else 
{printf("(%c,%d)",a[i],m);
m=1;
}
}
}
main()
{
   int i=0,j=0,b[26]={0};
   char a[1000],c[26];
   scanf("%s",a);
   for(int k=0;a[k]!='\0';k++)
   {if((a[k]>='a')&&(a[k]<='z'))
    a[k]+=('A'-'a');}
   for(;a[i]!='\0';i++)
   {
    if(a[i+1]==a[i])
    b[j]++;
    else
    {c[j]=a[i];
    j++;}
     }
   
    for(int k=0;k<j;k++)
    {printf("(%c,%d)",c[k],b[k]+1);}

}
int main()
{char s[1000];
int i,j,p,q;
scanf("%s",s);
for(i=0;;i++)
{if(s[i]=='\0')
break;

 else if(s[i]>='a')
	s[i]=s[i]-32;}
for(q=0;q<i;)
{j=q;p=1;
for(;;j++)
{if(s[j+1]==s[j])
{p=p+1;
continue;}
else
	break;}
q=q+p;
printf("(%c,%d)",s[j],p);}}
int main()
{
	char str[1001],str2[1001];
	int i,num[1000],j=0;
	cin>>str;
	for(i=0;i<1000;i++)
		num[i]=1;
	for(i=0;str[i]!='\0';i++)
	{
		if(str[i]>=97&&str[i]<=122)
			str[i]=str[i]-32;
	}
	str2[0]=str[0];
	for(i=1;str[i]!='\0';i++)
	{
		if(str[i]==str2[j])
			num[j]++;
		else
		{	
			str2[j+1]=str[i];
			j++;
		}
	}
	for(i=0;i<j+1;i++)
	{
		cout<<"("<<str2[i]<<","<<num[i]<<")";
	}
	cout<<endl;
	return 0;
}
int main()
{ 
    char s[1000];
    int l,i,num=1;
    scanf("%s",s);
    l=strlen(s);
     if((s[l-1]-s[l-2]==0)||(s[l-1]-s[l])==('a'-'A')||(s[l-1]-s[l-2])==('A'-'a'))
      for(i=0;i<l;i++)
        {
          if((s[i+1]-s[i]==0)||(s[i+1]-s[i])==('a'-'A')||(s[i+1]-s[i])==('A'-'a'))
            {
              num++;
            }       
          else
            { if(s[i]-'a'>=0)
              printf("(%c,%d)",s[i]-32,num);
              else
              printf("(%c,%d)",s[i],num);
              num=1;      
            }         
        }
     else
      {for(i=0;i<l-1;i++)
        {
          if((s[i+1]-s[i]==0)||(s[i+1]-s[i])==('a'-'A')||(s[i+1]-s[i])==('A'-'a'))
            {
              num++;
            }       
          else
            { if(s[i]-'a'>=0)
              printf("(%c,%d)",s[i]-32,num);
              else
              printf("(%c,%d)",s[i],num);
              num=1;      
            }         
        } 
      if(s[l-1]-'a'>=0)
              printf("(%c,1)",s[l-1]-32);
              else
              printf("(%c,1)",s[l-1]);
      } 
      getchar();
      getchar();
}
main()
{
      int i,count=1;
      char a[2000];
      for(i=0;i<2000;i++)a[i]='\0';
      gets(a);
      for(i=0;i<2000;i++)
      {
                         if(a[i]=='\0')break;
                         if(a[i]==a[i+1] || a[i]==a[i+1]+('A'-'a') || a[i]==a[i+1]-('A'-'a'))count++;
                         else
                         {
                             if(a[i]>='a')a[i]=a[i]-('a'-'A');
                             printf("(%c,%d)",a[i],count);
                             count=1;
                         }
      }
}
int main()
{
	char str[1001];
	cin.getline(str,1001);
	int len;
	len = strlen(str);
	int i, num = 1;
	char cur = str[0], p;
	if (len == 1)
	{
		if (cur <= 'z' && cur >= 'a')
		{
			p =  cur + 'A' - 'a' ;
			cout <<"(" << p <<"," << num <<")";
		}
		else
			cout <<"("<< cur << "," << num <<")";
	}
	for ( i = 1; str[i] !='\0'; i ++ )
	{
		if (cur == str[i] || str[i] == cur + 'A' - 'a' || str[i] == cur +'a' - 'A')
		{
			num ++;
			if (i == len - 1)
				if (cur <= 'z' && cur >= 'a')
				{
					p =  cur + 'A' - 'a' ;
					cout <<"(" << p <<"," << num <<")";
				}
				else
					cout <<"("<< cur << "," << num <<")";
		}
		else
		{
			if (cur <= 'z' && cur >= 'a')
			{
				p =  cur + 'A' - 'a' ;
				cout <<"(" << p <<"," << num <<")";
			}
			else
				cout <<"("<< cur << "," << num <<")";
			num = 1;
			cur = str[i];
			if (i == len - 1)
				if (cur <= 'z' && cur >= 'a')
				{
					p =  cur + 'A' - 'a' ;
					cout <<"(" << p <<"," << num <<")";
				}
				else
					cout <<"("<< cur << "," << num <<")";
				
		}
	}



	
	return 0;
}
int main(){
	int i,l;
	char c[1000];
	gets(c);
	l=strlen(c);
	int a;
	a=0;
	for(i=0;i<l;i++)
		if(c[i]>=97&&c[i]<=122)
			c[i]=c[i]-32;
	for(i=0;i<l;i++)
	{if(c[i]==c[i+1])
			a++;
	else 
	{cout<<"("<<c[i]<<","<<a+1<<")";
	a=0;}}

	
				
			
			return 0;
}
/*
 * 222.cpp
 *
 *  Created on: 2012-12-24
 *      Author: stream
 */
int main()
{
	int num=1,i,l;
	char a[1001];
	cin >>a;
	l=strlen(a); 
	if(l==1)
	{
		if(a[l-1]>=97)
			a[l-1]=a[l-1]-32;
		cout <<"("<<a[l-1]<<","<<num<<")";
		
	}
	else
	{
	for(i=1;i<l;i++)
	{
		if((a[i]==a[i-1])||(a[i]==a[i-1]+32)||(a[i]==a[i-1]-32))
		{
			num++;
		}
		else
		{
			if(a[i-1]>=97)
				a[i-1]=a[i-1]-32;
			cout <<"("<<a[i-1]<<","<<num<<")";
			num=1;
		}
		if(i==l-1)
		{
			if(a[l-1]>=97)
       			a[l-1]=a[l-1]-32;
			cout <<"("<<a[l-1]<<","<<num<<")";
		}
	}
	}
	return 0;
}