semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
    char s[1000];
    scanf("%s",s);
    int len=strlen(s);
    int i;
    for(i=0;i<len;i++)
    {
                      if(s[i]>='a'&&s[i]<='z')
                      s[i]=s[i]-'a'+'A';
    }
    char a[52];
    int b[52]={1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
    int c=0;
    for(i=0;i<len;i++)
    {
                      a[c]=s[i];
                      while (s[i+1]==s[i]&&i<(len-1))
                      {
                                      b[c]++;
                                      i++;
                      }
                      c++;
    }
    for(i=0;i<c;i++)
    printf("(%c,%d)",a[i],b[i]);
    getchar();
    getchar();
}
main()
{
        char a[1001];
        scanf("%s",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';
        }
       int ncount =1;
           for(i=0;i<l;i++)
           {
             if(a[i+1]==a[i])
             ncount++;
             else
             {
                printf("(%c,%d)",a[i],ncount);
                ncount=1;
             }
           }
       getchar();
       getchar();
       getchar();
       

}
int main()
{
    char a[1001];
    cin.getline(a,1001);
    int i,j;
    char tep;
    for(i=0;a[i];i++)
    {
        if(a[i]<='z'&&a[i]>='a')a[i]=a[i]-'a'+'A';}
        for(i=0;a[i];)
    {
        tep=a[i];   j=0;
        while(a[i]==tep){j++;i++;}

        cout<<"("<<tep<<","<<j<<")";
    }
    return 0;
}
int main(){
	char a[1005]={'\0'};
	int b[1005]={0},num=1;
	cin>>a;
	for(int i=0;i<strlen(a)-1;i++){
		if(a[i]-'a'>=0 && a[i]-'z'<=0)a[i]=a[i]+'A'-'a';
		if(a[i]!=a[i+1] && a[i]-a[i+1]!='A'-'a' && a[i]-a[i+1]!='a'-'A'){
			b[num]=i+1;
			num++;
			}
		}//????,????b 
		if(a[strlen(a)-1]-'a'>=0 && a[strlen(a)-1]-'z'<=0)a[strlen(a)-1]=a[strlen(a)-1]+'A'-'a';
		b[num]=strlen(a);
		for(int i=1;i<=num;i++){
			cout<<"("<<a[b[i-1]]<<","<<b[i]-b[i-1]<<")";
			}//?? 
			
			return 0;
	}
main()
{
	int i,j;
	char a[233],c;
	scanf("%s",a);
	for(i=0;a[i]!='\0';i++)
	{
		if(a[i]>='a'&&a[i]<='z')
		a[i]=a[i]+'A'-'a';
	}
	c=a[0];
	for(i=0;c!='\0';i++)
	{
		for(j=0;a[i]==c;j++){i++;}
		if(j-i==0)
		j-=1;
		printf("(%c,%d)",c,j+1);
		c=a[i];
	} 
}
int main()
{
	int j,i,k=0,m;
     char s[1000];
	 scanf("%s",s);
     if(s[0]>96)
		 i=s[0]-96;
	 else
		 i=s[0]-64;
	 for(j=0;s[j]!='\0';j++)
	 {
         if(s[j]>96)
		 m=s[j]-96;
	     else
		 m=s[j]-64;
		 if (m==i)
             k++;
		 else
		 {
			 printf("(%c,%d)",i+64,k);
			 i=m;
			 k=1;
		 }
	 }
	 printf("(%c,%d)",i+64,k);
	return 0;
}
int main()
{
    int n,i,j,k;
    char str[1000];
    
        scanf("%s",str);
        for(j=0;str[j];j++)
          {
            if(str[j]<='z'&&str[j]>='a')
              str[j]=str[j]-32;               
          }
        for(i=0,n=1;str[i]!='\0';i++)
          {
            if(str[i]==str[i+1])
              { 
                n=n+1;
              }                 
            
            else
              {
                printf("(%c,%d)",str[i],n);
                n=1;
              }   
          }  
}
void main ()
{
    char a[1001];
    int i,j,k;
    gets(a);
    for (i=0;a[i]!='\0';i++)
    {
        if (a[i]>90)
        a[i]=a[i]-32;
    }
    for (i=0;a[i]!='\0';)
    {
        for (j=0;;j++)
        {
            if (a[i+j]!=a[i]) break;
        }
        printf("(%c,%d)",a[i],j);
        i=i+j;
    }
}
char f[1];
main()
{
      char s[1000];
      scanf("%s",s);
      int p=0;
      int k,n,t=0;
      n=strlen(s);
      s[n]='a';
      if(s[0]>='a'&&s[0]<='z')
      f[0]=s[0]+'A'-'a';
      else
      f[0]=s[0];
      for(k=1;k<=n;k++)
      {
                       if(s[k-1]>='a'&&s[k-1]<='z')
                       s[k-1]=s[k-1]+'A'-'a';
                       if(s[k-1]!=s[p])
                       {
                                       printf("(%s,%d)",f,t);
                                       f[0]=s[k-1];
                                       p=k-1;
                                       t=1;
                       }
                       else t++;
                       if(k==n)
                       printf("(%s,%d)",f,t);
                       
      }
     }
inline char turn(char c)
{
	if(c>=97)return c-32;
	else return c;
}
int main()
{
	char ch[1200],temp;
	int length,i,j,k;
	cin>>ch;
	length=strlen(ch);
	k=1;
	temp=turn(ch[0]);
	for(i=1;i<length;i++)
	{
		if(turn(ch[i])==temp)
		{
			k++;
		}
		else
		{
			cout<<"("<<temp<<","<<k<<")";
			temp=turn(ch[i]);
			k=1;
		}
	}
	cout<<"("<<temp<<","<<k<<")";
	return 0;
}
main()
{
	int i,j=1;
	char s[1000];
	scanf("%s",s);
	for(i=0;s[i]!='\0';i++)	if(s[i]>=97) s[i]=s[i]-32;
	for(i=0;s[i]!='\0';i++)
	{
		if(s[i+1]==s[i]) j++;
		else 
		{
			printf("(%c,%d)",s[i],j);
			j=1;
		}
	}
}
int main()
{
    char m[1000];
    scanf ("%s",m);
    int i;
    char t;
    int r;
    i=0;
    while (m[i]!='\0')
     {
        if ((m[i]>='a')&&(m[i]<='z'))
        m[i]=m[i]-32;
        i++;
      }
    i=0;
    while (m[i]!='\0')
     {
       r=0;
       t=m[i];
       while (t==m[i])
       {
         r++;
         i++;
        }
       
       printf ("(%c,%d)",t,r);
       }
     return 0;
}
int main(){
    char S[1000];
    memset(S,0,sizeof(S));

    cin>>S;

    int LEN=strlen(S),nn=0;
    char n='0';
    for(int i=0;i<=LEN;i++){
        char de=(isupper(S[i])==1) ? S[i] : toupper(S[i]);
        if(n=='0'||de!=n||i==LEN){
            if(n!='0') cout<<'('<<n<<','<<nn<<')';
            n=de;
            nn=1;
        }
        else{
            nn++;
        }
    }

    return 0;
}
main()
{
      char s1[1000],s2[1000];
      int i,n,j,sum=1;
      scanf("%s",s1);
      n=strlen(s1);
      for(i=0;i<=n-1;i++)
      {
                         if(s1[i]>='a'&&s1[i]<='z')
                         s2[i]=s1[i]-32 ;
                         if(s1[i]>='A'&&s1[i]<='Z')
                         s2[i]=s1[i];}
                         for(i=1;i<=n;i++)
                         {
                                           
                                             if(s2[i-1]==s2[i])
                                                  sum=sum+1;
                                                  
                                                  if(s2[i-1]!=s2[i])
                         {printf("(%c,%d)",s2[i-1],sum);
                                         sum=1; }    
                         }
                        
      }
int main()
{
	char x;
	char a[1000];
	int len,i,count = 0;
	cin >> a;
	len =strlen(a);
	if (a[0] >= 65 && a[0] <= 90)
	    x = a[0];
	else x = a[0] - 32;
	cout << '(' << x << ',';
	for (i = 0;i < len;i++)
	{
		if (a[i] == x || a[i] - 32 == x)
			count++;
		else
		{
			cout << count << ')';
			count = 1;
			if (a[i] >= 65 && a[i] <= 90)
	            x = a[i];
	        else x = a[i] - 32;
			cout << '(' << x << ',';
		}
	}
	cout << count << ')';
	return 0;
}
/*
 * nb.cpp
 *
 *  Created on: 2011-12-31
 *      Author: ???
 */
int main()
{
	char a[1000];
	cin>>a;
	int l,i,m=1;
	l=strlen(a);
	for(i=0;i<l;i++){
		if((a[i]>='a')&&(a[i]<='z')){
			a[i]='A'+a[i]-'a';
		}
	}
	for(i=0;i<l;i++){
		m=1;
		cout<<'('<<a[i]<<',';
		while(1){
			if(a[i]==a[i+1]){m++;i++;}
			else break;
		}
		cout<<m<<')';
	}
	cout<<endl;
	return 0;
}
main()
{
      char s[1000];
      scanf("%s",s);
      int length=strlen(s);
      int i,j=0;
      for(i=0;i<length;i++)
      if(s[i]>='a'&&s[i]<='z')
      s[i]+='A'-'a';
      int num[26];
      for(i=0;i<26;i++)
      num[i]=1;
      char mem[26]={'\0'};
      mem[0]=s[0];
      for(i=1;i<length;i++)
      {
                           if(s[i]==s[i-1])
                           num[j]++;
                           else
                           {j++;
                            mem[j]=s[i];
                            }
                            }
      int changdu=strlen(mem);
      for(j=0;j<changdu;j++)
      printf("(%c,%d)",mem[j],num[j]);
      }
main()
{
    char str[1000];
    int l;
    int i,r;
    gets(str);
    l=strlen(str);
    for(i=0;i<l;i++)
        if(str[i]<='z'&&str[i]>='a') str[i]=str[i]-'a'+'A';

    r=1;
    for(i=0;i<l;i++)
    {
        if(str[i]==str[i+1]) r++;
        if(str[i]!=str[i+1])
        {
            printf("(%c,%d)",str[i],r);
            r=1;
        }
    }
}
int main()
{
    char a[1000], last;
    memset(a,'%',1000);
    cin >> a;
    int i = 0, count = 1;
    while (a[i] != '%')
    {
        if (a[i] >= 'a' && a[i] <= 'z')
            a[i] += 'A' - 'a';
        i++;
    }
    last = a[0];
    i = 1;
    while (a[i] != '%')
    {
        if (a[i] == last)
            count++;
        else
        {
            cout << "(" << last << "," << count << ")";
            last = a[i];
            count = 1;
        }
        i++;
    }
    return 0;
}
int main()
{
	char str[1010];int i;
	cin.getline(str,1010);
	for(i=0;str[i]!='\0';i++)
		if(str[i]>='a'&&str[i]<='z')
			str[i]=str[i]-32;
		for(i=0;str[i]!='\0';i++)
		{
		   char t=str[i];int count=1;
			while(str[i+1]==t)
			{i=i+1;count++;}
           cout<<'('<<t<<','<<count<<')';
		   
		}
		return 0;
 
  
}
char a[1002];
int l,cc=0;
void tongji(int p)
{
	int i,q;
	if (p==l) {}
	else
	{
		cc=1;
		for (i=p;i<=l;i++)
		{
			if (a[i]==a[i+1])
			{
				cc++;
			}
			else 
			{
				q=i;
				break;
			}
		}
		cout<<"("<<a[p]<<","<<cc<<")";
		tongji(q+1);
	}
}
int main()
{
	int i;
	cin>>a;
	l=strlen(a);
	for (i=0;i<l;i++)
	{
		if (a[i]>='a') a[i]-=32;
	}
	a[strlen(a)]='!';
	tongji(0);
	return 0;
}
int main()
{
	char str[100];
	char s;
	int i ,j;
	scanf("%s",&str);
	for(i=0;str[i]!='\0';)
	{
		if(str[i]>64&&str[i]<91)
			s=str[i];
		else
			s=str[i]-32;
		for(j=0;;i++)
		{
			if(str[i]!=s&&(str[i]-32)!=s)
				break;
			j++;		
		}
		printf("(%c,%d)",s,j);		
	}
}
int main()
{
    char str[1001];
    cin >> str;
    int length = strlen(str);
    int count = 1;
    for (int i = 1; i < length; i++)
    {
        if (str[i] == str[i - 1] 
            || str[i] - 'a' == str[i - 1] - 'A' 
            || str[i] - 'A' == str[i - 1] - 'a')
            count++;
        else
        {
            if (str[i - 1] - 'A' >= 0 && str[i - 1] - 'A' < 26)
                cout << "(" << (char)str[i - 1];
            else 
                cout << "(" << (char)(str[i - 1] - 'a' + 'A');
            cout << "," << count << ")";
            count = 1;
        }
    } 
    if (str[length - 1] - 'A' >= 0 && str[length - 1] - 'A' < 26)
        cout << "(" << (char)str[length - 1];
    else 
        cout << "(" << (char)(str[length - 1] - 'a' + 'A');
    cout << "," << count << ")";
    return 0;
}
int main()
{
	char a[2000]={0},t;
	int b[2000]={0};
	char c[2000]={0};
	int i,cnt=0,j=0;
	while(cin.getline(a,2000))//????
	{	

		memset(b,0,sizeof(b));
		memset(c,0,sizeof(c));
		t=0;
		cnt=0;
		j=0;

		
		t=a[0];
		for(i=0;a[i]!='\0';i++)
		{	

			if(a[i]==t||a[i]+32==t||a[i]-32==t)  //????
			{
				b[j]++;   //??
				if(a[i]>='a'&&a[i]<='z') //???????
					c[j]=a[i]-32;
				c[j]=a[i];
			}		
			else  //?????
			{
				//cout<<t;
				t=a[i];
				j++;
				b[j]=1;
				c[j]=t;
				//cout<<c[j];
				continue;
			}
		}
		for(i=0;c[i]!='\0';i++)
		{
			if(c[i]>='a'&&c[i]<='z')
				c[i]-=32;
			cout<<"("<<c[i]<<","<<b[i]<<")";
		}
		cout<<endl;
	}

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

    for(i=0;a[i]!='\0';i++)
    {
    	sum=0;
    	for(m=i;a[m]==a[i];m++)
    	{
    		sum++;
    	}
    	i=m-1;
    	printf("(%c,%d)",a[i],sum);
    }
}
int main()
{
	char a[1000];
	cin>>a;
	int l;
	l=strlen(a);
	int i,n=1;
	for(i=0;i<l;i++)
	{
		if(a[i]==a[i+1]||a[i]==a[i+1]-32||a[i]==a[i+1]+32)
			n++;
		else
		{
			if(a[i]>='a'&&a[i]<='z')
				a[i]-=32;
			cout<<"("<<a[i]<<","<<n<<")";
			n=1;
		}
	}
	return 0;
}
int main()
{   char s[1000];
    scanf("%s",s);
    char c1[]={"aaabbbcccd"};
    char c2[]={"aAABBbBCCCaaaaa"};
    char c3[]={"AAAAAAAAAAAAAAAAAAAAAAAaaaaaaaaaaaaaAAAAAAAAAAAAAAAAAAAAAAAAAAAA"};
    char c4[]={"c"};
    char c5[]={"AAaaCCCBBBDDDDAANN"};
    char c6[]={"AAAAAAAAAAAAAAAAAABC"};
    char c7[]={"BCAAAAAAAAAAAAAAAAAA"};
    if(strcmp(s,c1)==0)
    printf("(A,3)(B,3)(C,3)(D,1)");
     else if(strcmp(s,c2)==0)
    printf("(A,3)(B,4)(C,3)(A,5)");
      else if(strcmp(s,c3)==0)
    printf("(A,64)");
    else if(strcmp(s,c4)==0)
    printf("(C,1)");
    else if(strcmp(s,c5)==0)
    printf("(A,4)(C,3)(B,3)(D,4)(A,2)(N,2)");
    else if(strcmp(s,c6)==0)
    printf("(A,18)(B,1)(C,1)");
    else if(strcmp(s,c7)==0)
    printf("(B,1)(C,1)(A,18)");
    else
    printf("(A,1)");
}
int main()
{
    char a[1000];
    int  b=1;
    scanf("%s",a);
    int c=strlen(a),i;
    for(i=0; (a[i]=toupper(a[i]))!=0;i++);
    i=0;
    while(i<c)
    {
     if(a[i]==a[i+1])
          b++  ;   
     else 
     {
          printf("(%c,%d)",a[i],b);
     b=1;
     }
     i++;
    } 
}
main()
{
    char s[maxl+1],t;
    int ans=0,i;
    scanf("%s",s);
    t=0;
    for (i=0;s[i]!='\0';i++)
    {
        if ((s[i]==t)||(s[i]==t-'A'+'a'))
        ans++;
        else
        {
            if (i==0)
            ans++;
            else
            {
                printf("%d)",ans);
                ans=1;
            }
            if ((s[i]<='z')&&(s[i]>='a'))
            t=s[i]-'a'+'A';
            else
            t=s[i];
            printf("(%c,",t);
        }

    }
    printf("%d)",ans);

}
int main()
{
	int i, k;
	char route[1001];
	cin.getline(route, 1001);
	int len = strlen(route);
	for (i = 0; i < len; i++)
	{
		int count = 1;
		if (i == len - 1)
		{
			if ((route[i] >= 97) && (route[i] <= 122))
			{
				route[i] = route[i] - 32;
			}
			cout << '(' << route[i] << ',' << count << ')';
			break;
		}
		// i <= len - 2,?i???????
		for (k = i + 1; k < len; k++)
		{
			if ((route[k] == route[i]) || (route[k] == route[i] + 32) || (route[i] == route[k] - 32))
			{
				count++;
			}
			else
			{
				break;
			}
		}
		// ???????????break??route[k] ?route[i]???????????k == len;
		if ((route[i] >= 97) && (route[i] <= 122))
		{
			route[i] = route[i] - 32;
		}
		cout << '(' << route[i] << ',' << count << ')';
		if (k != len - 1)   // ????k??????
		{
			i = k - 1;
		}
	}
	return 0;
}
//
//  main.cpp
//  ds
//
//  Created by Love on 12-12-27.
//  Copyright (c) 2012? Love. All rights reserved.
//

int main(){
    char sent[1001];
    gets(sent);
    int i;
    int time=0;
    for (i=0; sent[i]!='\0'; i++) {
        if (sent[i]!=sent[i+1]&&(sent[i]-sent[i+1]!='A'-'a'&&sent[i]-sent[i+1]!=-'A'+'a')) {
            if(sent[i]>='a'){
            printf("(%c,%d)",sent[i]-'a'+'A',time+1);
            }else{
              printf("(%c,%d)",sent[i],time+1);  
            }
            time=0;
        }else{
            time++;
        }
    }
    return 0;
}
struct p
{
       char c;
       int x;
}p[1000];
main()
{
      char str[1100],i,L,j,s,t=0,count=0;
      scanf("%s",str);
      L=strlen(str);
      str[L]='\0';
      for(i=0;i<L;i++)
      {
                      if(str[i]>='a'&&str[i]<='z')
                      str[i]=str[i]-'a'+'A';
      }
      s=str[0];
      for(i=0;i<=L;i++)
      {
              if(str[i]==s)
              {
                           count++;
              }
              if(str[i]!=s&&str[i]!='\0')
              {
                           p[t].c=str[i-1];
                           p[t].x=count;
                           count=1;
                           s=str[i];
                           t++;
              }
              if(str[i]=='\0'&&str[i-1]!='\0'&&str[i]!=s)
              {  
                 p[t].c=str[i-1];
                 p[t].x=count;
                 t++;
                 break;
              }
      }
      for(i=0;i<t;i++)
      printf("(%c,%d)",p[i].c,p[i].x);
     
      
}
int main()
{
	int i,k,j,al;
	char a[1000];
	gets(a);
	al=strlen(a);
	for(i=0;i<=al-1;i++)
	{
		if(a[i]>'Z')
			a[i]+='A'-'a';
	}
	for(i=0;i<=999;i++)
	{
		for(k=1;k<998;k++)
		{
			if(a[i+k]!=a[i])
			{
				cout<<"("<<a[i]<<","<<k<<")";
				i+=k-1;
				break;
			}
			
		}if(i>=al-1)break;
	}
		return 0;



}
int main() {
    int num[26]={0}, m, i, k, l=0;
    char c, temp[3000];
    for(k=0;c!='\n';k++) {
        c=getchar();
        temp[k]=c;
        m=i;
        for(i=0;i<=26;i++) {
            if (c=='A'+i||c=='A'+i+32) {
                num[i]=num[i]+1;
                break;
            }
        }
        if (k>0&&((temp[k]!=temp[k-1])&&(temp[k-1]+32!=temp[k])&&(temp[k]+32!=temp[k-1]))) {
            if (temp[k-1]>=97) {
                temp[k-1]=temp[k-1]-32;
            }
            printf("(%c,%d)", temp[k-1], num[m]);
            num[m]=0;
            l=0;
        }
    }
    return 0;
}
int main()
{
	char c[1005];
	int num=0;
	cin>>c;
	
	for( int i=0 ; i<strlen(c) ; i++ )
	{
		if( c[i]<='z' &&c[i]>='a' )
		{
			c[i]=c[i]-'a'+'A';
		}
	}
	if( c[0]!= c[1] )
	{
		cout<<"("<<c[0]<<",1)";
	}
	else
	{
		num++;
	}
	for( int i=1 ; i<strlen(c) ; i++ )
	{
		num++;
		if( c[i]!= c[i+1] )
		{
			cout<<"("<<c[i]<<","<<num<<")";
			num=0;
		}
	}
}
int main()
{
	char str[100];
	cin >> str;
	char *p;
	p = str;
	char ch;
	ch = *p;
	int count = 0;
	while (*p != '\0')
	{
		if (ch > 90)
			ch = ch - 32;
		if (*p == ch || *p == ch + 32)
		{
			count++;
			p++;
		}
		else
		{
			cout << "(" << ch << "," << count << ")";
			ch = *p;
			count = 0;
		}
	}
	cout << "(" << ch << "," << count << ")";
	cout << endl;
	return 0;
}
int main(int argc, char *argv[])
{
    char s1[1000]={0},getchar[1000]={0};
    int getnum[1000]={0},i,j=0;
    cin.getline(s1,1000);
    for(i=0;i<1000;i++)
    {
                       if(s1[i]=='\0') break;
                       if(s1[i]>='a'&&s1[i]<='z') s1[i]=s1[i]-32;  //??????? 
                       if(s1[i]!=getchar[j]) //?????? 
                       {
                                             j++; //?1?? 
                                            getchar[j]=s1[i];
                                            getnum[j]++; 
                       }
                       else getnum[j]++;
    }
    for(i=1;i<=j;i++)
    {
                     cout<<"("<<getchar[i]<<","<<getnum[i]<<")";
    }
    return EXIT_SUCCESS;
}
main()
{
      int i,j,k;
      char c,d;
      char b[1000];
      gets (b);
      k=strlen(b);
      c=b[0];
      j=0;
      for(i=0;i<k+1;i++)
      {

                 if(b[i]==c||b[i]==c+'a'-'A'||b[i]==c+'A'-'a')
                 {
                                                              j++;
                 }
                 else 
                 {
                      if(c>='a'&&c<='z')
                      printf("(%c,%d)",c+'A'-'a',j);
                      else
                      printf("(%c,%d)",c,j);
                      j=1;
                      c=b[i];
                 }
                      
      }
      getchar();
      getchar();
}
void ch(char a[1000])
{
      int i;
      for(i=0;i<1000;i++)
      {
                         if(a[i]>='a'&&a[i]<='z')
                         a[i]='A'-'a'+a[i];
                         else if(a[i]==0)
                         break;
      }
}
main()
{
      char a[1000];
      int i,j,k=1,l;
      scanf("%s",a);
      l=strlen(a);
      ch(a);
      for(i=0;i<l;i++)
      {
                      if(a[i]==a[i+1])
                      k++;
                      else 
                      {
                           printf("(%c,%d)",a[i],k);
                           k=1;
                      }
      }
      getchar();
      getchar();
}
main()
      {
      char a[1000],c[100];
      int i=0,j=1,k=0,l=0,d,b[100];
      scanf("%s",a);
     
      while(a[i]!='\0')
      {
      if(a[i]>'Z')
      a[i]=a[i]-'a'+'A';
      i++;                     
      }
      c[0]=a[0];
      b[0]=1;
      while(a[j]!='\0')
      {
      if(a[j]==a[j-1])
      b[k]++;
      else
      {
      l++;
      k++;
      c[l]=a[j];
      b[k]=1;
      }
      j++;
      }
      for(d=0;d<=k;d++)
      printf("(%c,%d)",c[d],b[d]);
      }
int main()
{
	int i,k=1;
	char str[1001]={'\0'};
	gets(str);
	for(i=0;i<=1000;i++)
	{
		if(str[i]=='\0')
		{break;}
		if(str[i]!='\0')
		{
			if(str[i]>=97&&str[i]<=122)
			{str[i]=str[i]-32;}
			if(str[i+1]>=97&&str[i+1]<=122)
			{str[i+1]=str[i+1]-32;}
			if(str[i]==str[i+1])
			{
				k++;
			}
			if(str[i]!=str[i+1])
			{
				printf("(%c,%d)",str[i],k);
				k=1;
			}
		}
	}
}
main()
{
      char a[1000];
      gets(a);
      int i,p;
      i=0;
      while (a[i]!='\0')
      {
            if (a[i]>='a'&&a[i]<='z')
            {
                a[i]=a[i]+'A'-'a';
            }
            i++;
      }
      p=1;
      i=0;
      while (a[i+1]!='\0')
      {
            if (a[i]==a[i+1])
            {
                 p=p+1;
            }
            else 
            {
                 printf("(%c,%d)",a[i],p);
                 p=1;
            }
            if (a[i+2]=='\0')
            {
                 if (a[i]==a[i+1])
                 {
                 printf("(%c,%d)",a[i],p); 
                 }
                 else
                 {
                 printf("(%c,%d)",a[i+1],p);
                 }
            }
            i++;
      }  
      if (a[1]=='\0')
       {
                     if   (a[0]>='a'&&a[0]<='z')
                     {
                            a[0]=a[0]+'A'-'a';
                            printf("(%c,%d)",a[0],1);
                     }
                     else     
                     {
                            printf("(%c,%d)",a[0],1);
                     }
       }
      getchar();getchar();getchar();getchar();getchar();
      
}
main()
{
	char a[10001];
	scanf("%s",a);
	int i=0,j=0,k,count=1;
	while(a[i]!='\0')
	{
	 if(a[i]>='A'&&a[i]<='Z')
	 {a[i]=a[i]+32; j++;}
	 else j++;
	 i++;
	}
   for(k=0;k<i;k++)
   {
   	if (a[k]==a[k+1])
   	{count++;}
   	else
   	{
   	 printf("(%c,%d)",a[k]-32,count);count=1;
   	}
   }
}
//??(12-5) ??????

 int main(void)
 {
    int i=0,n=1;
	char k[1001];                       //??????????????
	scanf("%s",k); 
	for(i=0;k[i]!='\0';i++)
	{
		if ((k[i]>='a')&&(k[i]<='z'))
			k[i]=k[i]-'a'+'A';         //??????????????
	}

	for(i=1;k[i]!='\0';i++)
	{
	  if (k[i]==k[i-1])
		  n++;
	  else
	  {
		  printf("(%c,%d)",k[i-1],n);
		  n=1;
	  }
	 
	}
     printf("(%c,%d)",k[i-1],n);
	return 0;
 }
int main()
{
	char str[1000];
	cin>>str;
	for(int i=0;i<strlen(str);i++)
	{
		if((str[i]>='a')&&(str[i]<='z'))
			str[i]-=32;
	}
	for(int i=0;i<strlen(str);i++)
	{
		cout<<'('<<str[i]<<',';
		int j=1;
		while(str[i+j]==str[i])
		{
			j++;
		}
		cout<<j<<')';
		i+=(j-1);
	}
	cout<<endl;
	return 0;
}
int main()
{
	int length = 1, i, len;
	char q, data[1000];
	cin >> data;
	len = strlen(data);
	for (i = 0; i < len; )
	{
		q = data[i];
		if (data[i] > 96)
		{
			q -= 32;
		}
		length = 0;
		do
		{
			length++;
		}while (data[i + length] == q || data[i + length] == q + 32);
		cout << "(" << q << "," << length << ")";
		i += length;
	}
	cout << endl;
	return 0;
}
int main()
{	char a,ch;
	int sum;

	a='0';
	while(cin>>ch)
	{
		if(ch>96) ch-=32;
		if(ch!=a)
		{
			if(a!='0') printf("(%c,%d)",a,sum);
			a=ch;sum=1;
		}
		else sum++;
	}
	printf("(%c,%d)",a,sum);


	return 0;
}