semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
main()
{
      int i,j,k,t;
      i=j=k=0;
      int b[1000];
      while(k<1000) 
      {b[k]=1;
      k++;}
      char a[1000];
      gets(a);
      for(k=0;k<1000;k++)
      {
          if (a[k]>'Z')  {a[k]=a[k]-32;}
      }
      while(i<1000)
         { j=i;
                     if (a[j]=='\0')
                     break;
                     while(a[j]==a[j+1])
                     {
                         b[j+1]=b[j]+1;
                         j++;
                         
                     }
                         printf("(%c,%d)",a[j],b[j]);
                         i=j+1;
                   
         }           
     
      }
int main()
{
    char a[1001];
    scanf("%s",a);
    int i;
    int k=1;
    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++)
    {
      if(a[i]==a[i+1])
      {
        k=k+1;
        continue;
      }
      else
      {
        printf("(%c,%d)",a[i],k);
        k=1;
      }
    }
    getchar();
    getchar();
    getchar();
    getchar();
    getchar();
}
int main()
{
	char yuan[1001],suo[1001];
	int n,i,j,a,ya[1001]={0};
	cin >> yuan ;
	n = strlen(yuan);
	for ( i = 0;i < n ; i ++ )
		if (yuan[i] >= 'a' && yuan[i] <= 'z')
			yuan[i] = yuan[i] + 'A' - 'a';
	suo[0] = yuan[0] ;
	j = 0;
	for ( i = 0 ;i < n ;i ++ )
	{
		if (yuan[i] == suo[j])
			ya[j] ++ ;
		else 
		{
			j ++;
			suo[j] = yuan[i];
			ya[j] = 1;
		}
	}
	for (i = 0; i <= j; i ++)
		cout << "(" << suo[i] << "," << ya[i] << ")";
	return 0;
}
//********************************
//*???2011??               **
//*??????                 **
//*???2013.1.12              **
//*******************************/


void read(char last, int time)
{
	char a = cin.get();
	if (a >= 'a' && a <= 'z')
		a -= 32;
	if (a == '\n')
	{
		cout << "(" << last << "," << time << ")";
	}
	else if (last == a)
	{
		read (last, time + 1);
	}
	else
	{
		cout << "(" << last << "," << time << ")";
		read (a, 1);
	}
}

int main ()
{
	char a = cin.get();
	if (a >= 'a' && a <= 'z')
		a -= 32;
	read(a, 1);
	return 0;
}
int main()
{
	int i,j=0,k,sum[1000]={0};
    char str[1100],a[1000];
    cin>>str;
    for(i=0;i<strlen(str);i++)
	{
		if(str[i]>='a'&&str[i]<='z')
			str[i]=str[i]-32;
	}
	a[0]=str[0];
	for(i=1;i<strlen(str);i++)
	{
		if(str[i]==str[i-1])
		{
			sum[j]++;
		}
		else 
		{
              j=j+1;
			  a[j]=str[i];
		}
	}
	for(i=0;i<=j;i++)
	{
		cout<<"("<<a[i]<<","<<sum[i]+1<<")";
	}
	return 0;
}
int main()
{
    char string[1000];
    char c;
    gets(string);
    int n,i,x;
    n=strlen(string);
    x=0;
    for(i=0;i<n;i++)
    {
                    if(string[i+1]==string[i]||abs(string[i+1]-string[i])==32)
                    {
                    x=x+1;
                    }
                    else 
                    {
                         if(string[i]<=90)
                         {
                         printf("(%c,%d)", string[i], x+1 );
                         x=0;
                         }
                         else
                         {
                              printf("(%c,%d)", string[i]-32, x+1 );
                              x=0;
                         }
                    }
     }

     return 0;
}
int main()
{
    char a[1999];
    int i,t;
    gets(a);
    for(i=0;a[i]!='\0';i++)
    {
       if(a[i]<='z'&&a[i]>='a')
       a[i]-=32;
    }
    for(i=0;a[i]!='\0';i++)
    {
       if(a[i+1]==a[i])
       {
         t=1;
         while(a[i+1]==a[i])
         {
           t++;
           i++;
         }
         cout<<"("<<a[i]<<","<<t<<")";
       }
       else
       cout<<"("<<a[i]<<","<<1<<")";
       
    }
    int ss;cin>>ss;
    return 0;
}
int main()
{
    char str[1005];
    int i,cnt,n;
    char c=0;
    gets(str);
    n=strlen(str);
    for (i=0;i<n;i++){
        if (c!=toupper(str[i])){
            if (c){
                printf("(%c,%d)",c,cnt);
            }
            cnt=1;
            c=toupper(str[i]);
            continue;
        }
        cnt++;
    }
    printf("(%c,%d)\n",c,cnt);
    return 0;
}
int main()
{
	char c[1000];
	int n,i=0,j,a[1000]={0};
	gets(c);
	n=strlen(c);
	for(j=0;j<n;j++)
		if(c[j]>96)c[j]=c[j]-32;
	while(i<n)
	for(j=0;j<n-i;j++)
	{
		if(c[i]==c[i+j])
		{
			a[i]++;
			if(i+j==n-1)goto loop;
		}
		else {i=i+j;break;}
	}
loop:for(i=0;i<n;i++)
	if(a[i]!=0)printf("(%c,%d)",c[i],a[i]);
	return 0;
}
main()
{
 char p[1000];
 scanf("%s",p);
 int i = 0;
 char c,t;
 int n;
 while(1)
 {
         if(p[i] == '\0')
         {
              printf("(%c,%d)\n",c,n);
              break;
         }
         if(i==0)
         {
              if(p[i]>='A' && p[i]<'Z')
                 c=p[i];
              else
                 c=p[i] - 'a'+'A';
              n = 1;
         }
         else
         {
              if(p[i]>='A' && p[i]<'Z')
                 t=p[i];
              else
                 t=p[i] - 'a'+'A';
              if(t==c)
                 n++;
              else
              {
                  printf("(%c,%d)",c,n);
                  c=t;
                  n=1;
              }
         }
    i++;
    } 
}
main()
{
	int i,j,m;
	char a[1009];
	scanf("%s",a);
	m=strlen(a);
	for(i=0;i<m;)
	{
		int count=0;
		for(j=i;j<m;j++)
		{
			if(a[i]==a[j]||a[i]==(a[j]+'A'-'a')||a[i]==(a[j]-'A'+'a'))
			count++;
			else
			break;
		}
		if(a[i]<='Z'&&a[i]>='A')
		printf("(%c,%d)",a[i],count);
		else
		printf("(%c,%d)",a[i]+'A'-'a',count);
		i=i+count;
	}
}
int main()
{
	int i, len, num = 1, t = 1;
	char a[1011] = {0};
	cin >> a;
	len = strlen(a);
	for (i = 0; i <= len - 1; i++)
		if (a[i] >= 'a' && a[i] <= 'z')
			a[i] = a[i] - 'a' + 'A';
	cout << "(" << a[0] << ",";
	for (i = 1; i <= len - 1; i++)
	{
		if (a[i] == a[i - 1])
			num += 1;
		else
		{
			cout << num << ")";
			num = 1;
			cout << "(" << a[i] << ",";
		}
	}
	cout << num << ")" << endl;

	return 0;
}
int main()
{
	char a[1010]={'\0'};
	char c=getchar();
	int num=0;
	while(c!='\n')
	{
		if(c>=97 && c<=122)
		{
			a[num]=c-32;
			num++;
		}
		else
		{
			a[num]=c;
			num++;
		}
		c=getchar();
	}
	int i=0;
	num=1;
	a[strlen(a)]='1';
	for(i=0;i<strlen(a)-1;i++)
	{
		if(a[i]==a[i+1])
			num++;
		else if(a[i]!=a[i+1])
		{
			cout<<"("<<a[i]<<","<<num<<")";
			num=1;
		}
	}
	return 0;
}
int main()
{
	struct comp{char A;int n;};
	int i,j,k=0;
	char P[1000];
	struct comp C[100][26]={'A',0}; 
	gets(P);
	for(i=0;i<strlen(P);i++)
	{
		if(i>0)
			if(P[i]==P[i-1]||P[i]==P[i-1]+'A'-'a'||P[i]==P[i-1]+'a'-'A')
			;
			else
				k++;
		for(j=0;j<26;j++)
			if(j+'A'==P[i]||j+'a'==P[i])
			{
				C[k][j].n++;
				C[k][j].A=j+'A';
				break;
			}
	}
	for(k=0;k<100;k++)
	for(j=0;j<26;j++)
		if(C[k][j].n!=0)
			printf("(%c,%d)",C[k][j].A,C[k][j].n);
	return 0;
}
int main()
{
    char a[1000],c[1000];
    int b[1000];
    int i,j,k,h;
    for(i=0;i<1000;i++)
    {
        scanf("%c",&a[i]);
        if(a[i]>='a'&&a[i]<='z') a[i]=a[i]-'a'+'A';
        if(a[i]=='\n') break;
    }
    for(h=0,j=0;h<i;h++)
    {
        c[j]=a[h];
        if(a[h]==a[h+1])
        {
            b[j]++;
        }
        else j++;
    }
    for(k=0;k<j;k++)
        printf("(%c,%d)",c[k],b[k]+1);
    return 0;
}
void count(char *string)
{   
    int i=0,j=0;
    while(string[i]!='\0')
        {while(*(string+i)==*(string+j))
        i++;
        printf("(%c,%d)",*(string+j),i-j);
        j=i;}
}
int main()
{
    char string[1001];
    gets(string);
    int i;
    for(i=0;string[i]!='\0';i++)
    if(string[i]>='a'&&string[i]<='z')
    string[i]=string[i]-'a'+'A';
    count(string);
    return 0;
}
int main()
{
    int i,a,n,num=1;
    char str[1001];
    scanf("%s",str);
    n=strlen(str);

    
    for (    i=0  ;i<=(n-1)   ;i++   )
    {
            if   (  str[i]>=97  )
            str[i]=str[i]-32;
    }
    
    
    for (    i=0  ;i<=(n-1)   ;i++   )
    {
            if (     str[i]==str[i+1]  )
            num++;
            else
            {
            printf("(%c,%d)",str[i],num);
            num=1;
            }
            
    }  
    
    
  
    
    
}
int main()
{   
          char s[1050];
          char bj;
          int i,j,k,f,l;
          scanf("%s",s);
          l=strlen(s);
          f=0;
          for (i=0;i<l;i++)
                 if (f==0)
                       {
                           bj=s[i];
                           if (bj>=97)
                              bj=bj-32;
                           f=1;
                        }
                       else
                       {
                           if   ((s[i]==bj)||(s[i]-32==bj))
                                        f++;
                                        else
                                        {
                                            printf("(%c,%d)",bj,f);
                                            f=1;
                                             bj=s[i];
                                             if (bj>=97)
                                             bj=bj-32;
                                        }
                       }
          printf("(%c,%d)",bj,f);
}
int main()
{
    char str[1000];
int i,X,s=0,j,n[26]={0};
scanf("%s",str);
X=strlen(str);
for (i=0;i<X;i++)
{
    if (('a'<=str[i])&&(str[i]<='z'))
{str[i]=str[i]-'a'+'A';}
}  
for (i=0;i<X;i++)
{
  s=s+1;
  if (str[i+1]!=str[i])
  {
                       printf("(%c,%d)",str[i],s);
                             s=0;
                             } 
      
}


}
main()
{
char a[100];
int b[100];
int i,k,n;
scanf("%s",a);
      for(i=0;a[i]!='\0';i++)
     {      
                        if(a[i]>='a'&& a[i]<='z')
                        a[i]=a[i]-'a'+'A';
     }
     i=0;
     while(a[i]!='\0')
     {
     for(k=i;;k++)
     {
         if(a[k]!=a[i])
         break;             
     } 
     printf("(%c,%d)",a[i],k-i); 
     i=k;               
     }
}
int main()

{
  char a[1000];
  scanf("%s",a);
  int i,k;
  int j[1000]={0};
  k=1;
  for (i=1 ; i<1000 ; i++)
  {
    if(a[i]=='\0')
      {   
          if('A'<=a[i-1] && a[i-1]<='Z')
             printf("(%c,%d)",a[i-1],j[k]+1);
          else
             {
                a[i-1]=a[i-1]-'a'+'A';
                printf("(%c,%d)",a[i-1],j[k]+1);
             }
          break;
      }
    else if (a[i]==a[i-1] || a[i]==a[i-1]+'a'-'A' || a[i]==a[i-1]-'a'+'A')
          j[k]++;
    else
      {
          if('A'<=a[i-1] && a[i-1]<='Z')
             printf("(%c,%d)",a[i-1],j[k]+1);
          else
             {
                a[i-1]=a[i-1]-'a'+'A';
                printf("(%c,%d)",a[i-1],j[k]+1);
             }
          k++;
      }
  }
 

  return 0;
}
int main()
{
	char str[1000], str2[5];
	int i, count = 0;
	cin >> str;
	for (i = 0; str[i] != '\0';)
	{
		count = 0;
		str2[0] = str[i];
		if (str2[0] <= 'z' && str2[0] >= 'a')
			str2[0] = str2[0] - 32;
		for (; str[i] == str2[0] || str[i] == str2[0] + 32;)
		{
			count++;
			if (str[i] != '\0')
				i++;
		}
		cout << "(" << str2[0] << "," << count << ")";
	}
	cout << endl;
	return 0;
}
int main()
{
	char a[1001];
	cin >> a;
	char t;
	for (int i = 0; i < strlen(a);)
	{
		if (a[i] > 96)
			a[i] -= 32;
		t = a[i];
		int j;
		for (j = 0; ;j++)
			if (a[i+j] != t && a[i+j] != t + 32)
				break;
		cout << '(' << t << ',' << j << ')';
		i += j;
	}



}
char str[1000];
int main()
{
	cin>>str;
	int len=strlen(str);
	for(int i=0;i<len;i++)
		if(str[i]>='a'&&str[i]<='z')
			str[i]=(char)(str[i]+'A'-'a');
	char als;
	als=str[0];
	int aln=0;
	for(int i=0;i<len;i++)
	{
			if(str[i]==als)
				aln++;
			else
			{
				cout<<"("<<als<<","<<aln<<")";
				als=str[i];
				aln=1;
			}
	}
	cout<<"("<<als<<","<<aln<<")"<<endl;
	return 0;
}
main()
{
      char a[1000];int i,j,k=0,l,tem=1;
      scanf("%s",&a); 
      l=strlen(a); 
      
      for(i=0;i<l;i++)
      if(a[i]>='a'&&a[i]<='z') a[i]=a[i]-32;
      if(l==1)
      printf("(%c,1)",a[0]);
      else
      do
      {
                      tem=1;
                      for(j=k+1;j<=l;j++)
                      {
                                        if(a[k]!=a[j])
                                        {
                                         printf("(%c,%d)",a[k],tem);
                                         k=j;
                                         break;
                                        }
                                        else
                                        tem++;
                      }                           
      }while(k<l);
    }
int main()
{
	int l;
	char a[1000],b[1000];
	cin>>a;
	l = strlen(a);
	int num[1000],i,j = 0;
	for (i = 0; i <= l; i++) num[i] =1;
	for (i = 0; i < l;i++)
	{
		if (a[i+1] != a[i] && a[i+1] != a[i] +32 && a[i+1] != a[i] -32)
		{
			b[j] = a[i];
			j++;
		}
	   if (a[i+1] == a[i] || a[i+1] == a[i] +32 || a[i+1] == a[i] -32)
	   {
		   num[j]++;
	   }
	}
	b[j - 1]=a[l-1];
	for (i = 0; i < j; i++)
	{
		if (b[i] >='A' && b[i] <= 'Z')
		{
	        cout << "(" << b[i]<< "," << num[i] <<")";
		}
		if (b[i] >='a' && b[i] <= 'z')
		cout << "(" << (char)(b[i] - 'a' + 'A') << "," << num[i] <<")";
	}
	return 0;
}
int main()
{
	char a[1000];
	char temp;
	int i, l, count;
	cin.getline(a, 1000);
	l = strlen(a);
	for(i = 0; i <= l - 1; i++)
	{
		if(a[i] >= 'a' && a[i] <= 'z')
		{
			a[i] = a[i] - 32;
		}
	}
	a[l] = '0';
	temp = a[0];
	count = 1;
	if(l > 1)
	{
    	for(i = 1; i <= l; i++)
		{
	    	if(a[i] == temp)
			{
		    	count++;
			}
	    	if(a[i] != temp)
			{
		    	cout << "(" << temp << "," << count << ")";
		    	temp = a[i];
		    	count = 1;
			}
		}
	}
	if(l == 1)
	{
		cout << "(" << a[0] << "," << 1 << ")";
	}
	cin.get();
	return 0;
}
main()
{
      char a[1001];
      int n,i,x,count;
      scanf("%s",a);
      n=strlen(a);
      for(i=0;i<n;i++)
      {
           if(a[i]>'Z')
           a[i]=a[i]-'a'+'A';
      }
      for(i=0,count=0,x=a[0];i<n;i++)
      {
           if(a[i]==x)
           {
               count++;
           }
           else
           {
               printf("(%c,%d)",x,count);
               count=1;
               x=a[i];
           }
           if(i==n-1)
           printf("(%c,%d)",x,count);
      }
      getchar();
      getchar();
      return 0; 
}
main()
{
      char ch,c[1001];
      int a,len,i;
      scanf("%s",c);
      len=strlen(c);
      if(c[0]>='a'&&c[0]<='z')
               ch='A'+c[0]-'a';
      else
               ch=c[0];
      a=1;
      for(i=1;i<=len-1;i++)
      {  if(c[i]-ch==0||c[i]-ch=='a'-'A')
            a++;
         else
           {
             printf("(%c,%d)",ch,a);
            if(c[i]>='a'&&c[i]<='z')
               ch='A'+c[i]-'a';
            else
               ch=c[i];
            a=1;
           }
      }
      printf("(%c,%d)",ch,a);
     
}
main()
{
int i,len,k=0;
char a[1000];
char p[1000];
int b[1000]={1};

scanf("%s",a);
len=strlen(a);
for(i=0;i<=len-1;i++)
{
              if(a[i]=='a'||a[i]=='A')
              a[i]='A';
              if(a[i]=='b'||a[i]=='B')
              a[i]='B';
              if(a[i]=='C'||a[i]=='c')
              a[i]='C';
              if(a[i]=='d'||a[i]=='D')
              a[i]='D';
//printf("%c",a[i]);
}

for(i=0;i<=len-1;i++)
{
     if(a[i+1]==a[i])
                     {
                     b[k]=b[k]+1;
                     }
     else
     {
     p[k]=a[i];
     printf("(%c,%d)",p[k],b[k]);
     k=k+1;
     b[k]=1;
     }
}

}
int main()
{
	char c[1000];
	int n,i,j=0;
	gets(c);
	n=strlen(c);
	for(i=0;i<n;i++)
	{
		if(c[i]>='A'&&c[i]<='Z')
		{
		if(c[i]!=c[i-1]&&c[i]!=c[i-1]-32)
		{
			if(c[i-1]>='A'&&c[i-1]<='Z')
				printf("(%c,%d)",c[i-1],j);
			else if(c[i-1]>='a'&&c[i-1]<='z')
                printf("(%c,%d)",c[i-1]-32,j);
			j=0;
		}
		}
		else if(c[i]>='a'&&c[i]<='z')
		{
            if(c[i]!=c[i-1]&&c[i]!=c[i-1]+32)
			{
				if(c[i-1]>='A'&&c[i-1]<='Z')
                printf("(%c,%d)",c[i-1],j);
			else if(c[i-1]>='a'&&c[i-1]<='z')
                printf("(%c,%d)",c[i-1]-32,j);
				j=0;
			}
		}
		j++;
	}
        if(c[n-1]>='A'&&c[n-1]<='Z')
                printf("(%c,%d)",c[n-1],j);
			else if(c[n-1]>='a'&&c[n-1]<='z')
                printf("(%c,%d)",c[n-1]-32,j);
    return 0;
}
main()
{
int i=0,j=0,k=0;
int s[26];      

char out[1001];
scanf("%s",out);
for(k=0;k<strlen(out);)
{
    if(out[k]<='z' && out[k]>='a')
    {out[k]=out[k]-'a'+'A';}
    k++;
    }

for(i=0;i<strlen(out);i++)
   { while(out[i]==out[i+1])
     {j++;
     i++;}                  
      
    printf("(%c,%d)",out[i],j+1);
    j=0;
    
      }
            }
/* 
 * ????main.cpp
 * ??????
 * ?????2013-01-11
 * ?????????????????????????????????????????????????????????????????????????????????????"AAABBBBCBB"??????(A,3)(B,4)(C,1)(B,2)?????????????????????????? 
 *		 ???????????????????????????
 */


char printc( char c )
{
	if ( c <= 'z' && c >= 'a' )
		return c + 'Z' - 'z';
	return c ;
}

int main ()
{
	char c[1000] = {0};
	char *p = NULL;
	int num = 0;
	cin >> c;
	for ( p = c; *p; p++ )
	{
		if ( p == c || (*p != *(p-1) && (*p != *(p-1) + 'z' - 'Z') && (*p != *(p-1) + 'Z' - 'z')) )
		{
			if ( p != c )
				cout << num << ')';
			num = 1;
			cout << '(' << printc(*p) << ',' ;
		}
		else 
			num ++;
	}
	cout << num << ')' << endl;
	return 0;
}
int main()
{
	char ch[1000]={'\0'};
	int num=0,length=0,i,k=0;
	char result;
	cin.getline(ch,1000);						//?????
	for (i=0;i<1000;i++)
		if (ch[i]!='\0')
			num++;								//?????
	if (num==1)
	{
		if ((ch[0]>='A')&&(ch[0]<='Z'))
			k=ch[0]-'A';
		else
			k=ch[0]-'a';
		result='A'+k;
		cout<<"("<<result<<","<<"1"<<")";
	}
	else
	{
		for (i=0;i<num-2;i++)
		{
			if ((ch[i]==ch[i+1])||(ch[i+1]-ch[i]==32)||(ch[i]-ch[i+1]==32))//????????????????????
				length++;
			else									//????????????
			{
				length++;
				if ((ch[i]>='A')&&(ch[i]<='Z'))
					k=ch[i]-'A';
				else
					k=ch[i]-'a';
				result='A'+k;
				cout<<"("<<result<<","<<length<<")";
				length=0;
				k=0;
				result='\0';
			}
		}
		if ((ch[num-2]==ch[num-1])||(ch[num-2]-ch[num-1]==32)||(ch[num-1]-ch[num-2]==32))
		{
			length=length+2;
			if ((ch[num-1]>='A')&&(ch[num-1]<='Z'))
				k=ch[num-1]-'A';
			else
				k=ch[num-1]-'a';
			result='A'+k;
			cout<<"("<<result<<","<<length<<")";
		}
		else
		{
			length++;
			if ((ch[num-2]>='A')&&(ch[num-2]<='Z'))
				k=ch[num-2]-'A';
			else
				k=ch[num-2]-'a';
			result='A'+k;
			cout<<"("<<result<<","<<length<<")";
			if ((ch[num-1]>='A')&&(ch[num-1]<='Z'))
				k=ch[num-1]-'A';
			else
				k=ch[num-1]-'a';
			result='A'+k;
			cout<<"("<<result<<","<<"1"<<")";
		}
	}
	return 0;
}
int main()
{
	char ch[1001];
	char s;
	int i,ln,m,j;
	cin>>ch;
	ln=strlen(ch);
	for(i=0;i<ln;i++)
	{
		if(ch[i]>=96)
		{
			ch[i]=ch[i]-32;
		}
	}
	m=0;
	j=1;
	for(i=0;i<ln;i++)
	{
		s=ch[i];
		
		if(ch[i+1]==s)
			j++;
		else
		{cout<<"("<<s<<","<<j<<")";
		   m=i;
		   j=1;
		  }
	}
	return 0;
}
/*
 * 2.cpp
 *
 *  Created on: 2011-12-31
 *      Author: 2011
 */
int main()
{
	char string[1005],temp;
	cin.getline(string,1005);
	//cout<<string<<endl;
	int i,length=strlen(string),count=0;
	for(i=0;i<length;i++)
		if(string[i]>='a'&&string[i]<='z')
			string[i]+=('A'-'a');
	for(i=0;i<length;)
	{
		/*if(string[i]>='a'&&string[i]<='z')
			string[i]+=('A'-'a');
		if(string[i+1]>='a'&&string[i+1]<='z')
					string[i+1]+=('A'-'a');*/
		count=1;
		temp=string[i];
		i++;
		while(string[i]==string[i-1])
		{
			if(i==length)
				break;
			count++;
			i++;
		}
		cout<<'('<<temp<<','<<count<<')';
	}


	return 0;
}
int main()
{
	int i=0,j=0,k,len,p,q,p1,q1,t;
	char b[1000];
	cin>>b;
	if((b[0]>='a'&&b[0]<='z')||(b[0]>='A'||b[0]<='Z'))
	{
		 len=strlen(b);k=0;
		 for(i=0;i<len;i++)
		 {   p=b[i]-'a';q=b[i]-'A';//cout<<"ok"<<endl;
			 for(j=0;j<len-i;j++)
			 {   p1=b[i+j]-'a';q1=b[i+j]-'A';
                if(p==p1||p==q1||q==p1||q==q1)
				  k++;
				else  {
					
					if(b[i]>='a'&&b[i]<='z')
					{cout<<"(";
					printf("%c",b[i]-'a'+'A');
					cout<<","<<k<<")";}
					else
					   cout<<"("<<b[i]<<","<<k<<")";
					k=0;break;}
			 }if(i+j-1==len-1)break;
			 else i=i+j-1;
			 //cout<<i<<endl;
		 }
		 if(b[i]>='a'&&b[i]<='z')
					{cout<<"(";printf("%c",b[i]-'a'+'A');cout<<","<<k<<")";}
					else
					cout<<"("<<b[i]<<","<<k<<")";
		 
	}
	else cout<<b<<endl;
  return 0;
}
int main()
{
	char str[1000];
	cin >> str;
	int i, n, count = 1;
	n = strlen(str);
	for(i = 0; i < n; i++)
	{
		if(str[i] - 'a' >= 0 && str[i] - 'z' <= 0)
			str[i] = str[i] - 'a' + 'A';
	}
	for(i = 0; i < n - 1; i++)
	{
		if(str[i] == str[i + 1])
			count++;
		else
		{
			cout << "(" << str[i] << "," << count << ")";
			count = 1;
		}
	}
	if(str[n - 2] == str[n - 1])
		cout << "(" << str[n - 1] << "," << count << ")";
	else cout << "(" << str[n - 1] << "," << count << ")";

	return 0;
}
char A[1000];
int main()
{
	cin>>A;
	int len=strlen(A);
	int num;
	for(int i=0;i<len;i++)
	{
		if(i==0)
		{
			num=1;
		}
		
		else
		{
			
			
		    if(A[i]==A[i-1]||A[i]-'A'==A[i-1]-'a'||A[i]-'a'==A[i-1]-'A')
			{
				num++;
			}
			else
			{
				if(A[i-1]>='A'&&A[i-1]<='Z')
				cout<<'('<<A[i-1]<<','<<num<<')';
				else
				{
					char p='A'+A[i-1]-'a';
					cout<<'('<<p<<','<<num<<')';
				}
				num=1;
				
			}
			
			
		}
		if(i==len-1)
		{
			if(A[i]>='A'&&A[i]<='Z')
				cout<<'('<<A[i]<<','<<num<<')';
				else
				{
					char p='A'+A[i]-'a';
					cout<<'('<<p<<','<<num<<')';
				}
		}
	
	}
	
    return 0;
}
main()
{
	int x,u,i;
	char t;
	char s[10000];
	scanf("%s",s);
	x=strlen(s);
	for(i=0;i<x;i++)
	{
		if(s[i]>='a'&&s[i]<='z')
		s[i]=s[i]+'A'-'a';
	}
	u=1;
	t=s[0];
	if(x==1)
	printf("(%c,%d)",t,u);
	else if(x>1)
	{
	for(i=1;i<x;i++)
	{
		if(s[i]==t)
		{
			u++;
			if(i==x-1)
			printf("(%c,%d)",t,u);
		} 
		else
		{
			printf("(%c,%d)",t,u);
			t=s[i];
			u=1;
			if(i==x-1)
			printf("(%c,%d)",t,u);
		}
	}
	}
}
main()
{      int m,i,n,p;p=0;
char a[30]={'a','b','c','d','e','f','g','h','i','j','k','l','m'};
char d[30]={'n','o','p','q','r','s','t','u','v','w','x','y','z'};
char b[30]={'A','B','C','D','E','F','G','H','I','J','K','L','M'};
char e[30]={'N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};       
                    
      char c[100]; 
      scanf("%s",c);
    
      for(n=0;n<100;n++)
       {if (c[n]=='\0')   break;}
       for(m=0;m<26;m++)
     {for(i=0;i<n;i++)
            {if(a[m]==c[i])
             c[i]=b[m];
             if(d[m]==c[i])
             c[i]=e[m];}} 
      
      do { for(i=p;i<n;i++)
            {if(c[i]!=c[p])  break;}
           
            printf("(%c,%d)",c[p],i-p);
            p=i;
           }while(p!=n);
}
int main()
{
	char zfc[1002]={0},t;
	scanf("%s",zfc);
	int i,sum=0,n=strlen(zfc),m='A'-'a';
	for(i=0;i<n;i++)
	{
		if(zfc[i]>='a'&&zfc[i]<='z')
		{
			zfc[i]+=m;
		}
	}
	t=zfc[0];
	for(i=0;i<=n;i++)
	{
		if(zfc[i]!=t)
		{
			printf("(%c,%d)",t,sum);
			sum=1;
			t=zfc[i];
		}
		else
		{
			sum++;
		}
	}
	return 0;
 }
main()
{
      int num=0,i;
      char str[1000],b,a;
      scanf("%s",str);
      for(i=0;i<strlen(str);i++)
        {
          for(b='A';b<='Z';b++)
          {
          if(str[i]==b || str[i]==b+32)
           {
             num=num+1;
             break;
           }
          }
          if(str[i+1]!=b && str[i+1]!=b+32)
          {
            printf("(%c,%d)",b,num);
            num=0;
          }
        }
    
    return (0);
    
}
main()
{
    char a[1000];
    int b,c,d,f,g;
    int e[1000];
    for(g=0;g<1000;g++)
    e[g]=0;
    scanf("%s",a);
    c=strlen(a);
    for(b=0;b<c;b=b+e[b])
    {
    for(d=b;d<=c;d++)
    {
                       if(a[d]==a[b]||a[d]==(a[b]+32)||a[b]==(a[d]+32))
                       e[b]++;
                       else
                       break;
                       }
                       }
                       for(f=0;f<=c;f++)
                       {
                       if(e[f]!=0)
                       {
                                  if(a[f]>'Z')
                                  printf("(%c,%d)",a[f]-32,e[f]);
                                  else
                                  printf("(%c,%d)",a[f],e[f]);
                                  }
                                  }
                                  }
int main()
{
	char a[1000];
	int i,j,k,x,s;
	scanf("%s",a);
	i=0;
	j=0;
	k=0;
	x=strlen(a);
	for (i=0;i<x;i++)
	{
		if((a[i]>='a') && (a[i]<='z'))
		{
			a[i]=a[i]-32;
		}
	}
	for (i=0;i<x;i++)
	{
        if (a[i]!=a[i+1])
		{  s=i-k+1;
		    k=i+1;
		printf("(%c,%d)",a[i],s);
	}
	}
	return 0;
}