semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
//?? - ????
 

int main()
{
    char a[1101];
    int n;
    int count=0;
    char b;
    int i,j;
    scanf("%s",a);
    n=strlen(a);
    for(i=0;i<n;i++)
    {
                    if(a[i]>='a'&&a[i]<='z')
                    a[i]=a[i]-'a'+'A';
    }
    
          b=a[0];
          count++;
          if(n==1)printf("(%c,%d)",b,count);
          else 
          for(j=1;j<n;j++)
          {
                          if(a[j]==b)
                          {
                          count++;
                          if(j==n-1)
                          printf("(%c,%d)",a[j],count);}
                          else
                          {
                              
                              printf("(%c,%d)",a[j-1],count);
                              count=1;
                              b=a[j];
                              if(j==n-1)
                              printf("(%c,%d)",a[j],count);
                              
                          }          
     }
     getchar();
     getchar();

     


return 0;
}
int main()
{
char a[1001];
int n,i;
n=1;
scanf("%s",a);

if((a[0]>96)&&(a[0]<123))
a[0]=a[0]-32;
if(1==strlen(a))
{
printf("(%c,%d)",a[0],n);
}
for(i=1;i<strlen(a);i++)
{
if((a[i]>96)&&(a[i]<123))
a[i]=a[i]-32;
if(a[i-1]==a[i])
{
n=n+1;
}
else
{
printf("(%c,%d)",a[i-1],n);
n=1;

}
if(i==(strlen(a)-1))
printf("(%c,%d)",a[i],n);
}

return 0;
}
int main()
{
    int i,j,m,n,t,s,l,r,c[1000];
    char a[1000],b[1000];
    scanf("%s",a);
    l=strlen(a);
    for(i=0;i<l;i++)
    {
        if(a[i]>='a'&&a[i]<='z')
            a[i]=a[i]-'a'+'A';
    }
    for(i=0;i<l;i++)
    {
        t=1;
        for(j=1;i+j<l;j++)
            {
                if(a[i]==a[i+j])
                    t++;
                else
                break;
            }
        printf("(%c,%d)",a[i],t);
        i=i+j-1;
    }
    getchar();
    getchar();
}
int main() {
char c[1000];
int l,k;
cin>>c;
l=strlen(c);
for(int i=0;i<l;i++)
	if(c[i]>='a'&&c[i]<='z')
		c[i]=c[i]-32;
for(int i=0;i<l;i++)
{
	k=0;
	for(int j=i;j<l;j++)
	{
		if(c[j]==c[i])
			k++;
		else
			break;
	}
	cout<<"("<<c[i]<<","<<k<<")";
	i=i+k-1;
}
cout<<endl;
return 0;
}
char a[500];
void main()
{
	char mark;
	int i,sum=0,flag;
	gets(a);
for(i=0;a[i]!=0;i++)
if(a[i]>='a'&&a[i]<='z')a[i]+='A'-'a';
	mark=a[0];
	for(i=0,flag=0;a[i]!=0;i++){
		if(a[i]!=mark){
			printf("(%c,%d)",mark,sum);
			sum=1;
			mark=a[i];
		}
		else sum++;
	}
	printf("(%c,%d)",mark,sum);
}
main()
{
  char s[1001],word[1001];
  int i,len,count,num[1001];
  scanf("%s",s); 
  len=strlen(s);
  for (i=0;i<1001;i++) num[i]=1;
  count=1;
  for (i=0;i<=len-1;i++) 
  {
    if ((s[i]>='a') && (s[i]<='z')) s[i]=s[i]-'a'+'A';
  }
  for (i=0;i<=len-1;i++) 
  {
    word[count]=s[i];
    if (s[i]==s[i+1]) num[count]++; 
    else count++; 
  }                   
  for (i=1;i<=count-1;i++)
  {
    printf("(%c,%d)",word[i],num[i]);
  }  
}
int main()
{
	char s[1002];
	cin>>s;
	char mark = 0;
	int count = 0;
	for(int i = 0;i < strlen(s);i++)
	{
		char c = s[i];
		if(c >= 'a')
			c -= 32;
		if(c == mark)
		{
			count++;
		}
		else
		{
			if(mark != 0)
			{
				cout<<"("<<mark<<","<<count<<")";
			}
			mark = c;
			count = 1;
		}
	}
	cout<<"("<<mark<<","<<count<<")";
	return 0;
}
main()
{
      char a[1001];
      int i,m,j;
      int n=1;
      scanf("%s",a);
      m=strlen(a);
      for(j=0;j<=m-1;j++)
      {
         if(a[j]>='a'&&a[j]<='z')
         a[j]=a[j]-'a'+'A';
       }
       if (m==1)
       printf("(%c,1)",a[0]);
      for(i=1;i<=m-1;i++)
      {
       if(a[i]==a[i-1]&&i!=m-1)
       n++;
       else if(a[i]!=a[i-1]&&i!=m-1)
       {
       printf("(%c,%d)",a[i-1],n);
       n=1;
       }
       else if(a[i]!=a[i-1]&&i==m-1)
       printf("(%c,%d)(%c,1)",a[i-1],n,a[i]);
       else if(a[i]==a[i-1]&&i==m-1)
       printf("(%c,%d)",a[i],n+1);
       
      }
      }
/*
 * 1.cpp
 *
 *  Created on: 2011-12-31
 *      Author: 2011
 */
int main()
{
	char a[1010],b,c;int i,j,k,n=0,length;
	cin>>a;
	length=strlen(a);
	for(i=0;i<length;i++)
	{
		b=a[i];
		while(a[i]==b||(a[i]-('a'-'A'))==b||(a[i]+('a'-'A'))==b)
		{n=n+1;i++;}
		if(a[i-1]>='a')
		{
			b=a[i-1]-('a'-'A');
			cout<<"("<<b<<","<<n<<")";}
		if(a[i-1]<'a')
		{cout<<"("<<a[i-1]<<","<<n<<")";}
		i=i-1;
		n=0;
	}
	return 0;
}
main()
{
      char  a[1001];
      int i,n;
      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';)
      {
                       n=1;
                       while(a[i+1]==a[i])
                       {
                                          n++;
                                          i++;
                       }
                       printf("(%c,%d)",a[i],n);
                       i++;
      }
}
int main ()
{
	char a[1000];
	int i, con = 1;
	cin >> a;
	if (a[0] >= 'a' && a[0] <= 'z')
		a[0] -= 32;
	for (i = 1; a[i] != '\0'; i++)
	{
		if (a[i] >= 'a' && a[i] <= 'z')
		a[i] -= 32;
		if (a[i] == a[i-1])
			con++;
		else
		{
			cout << '(' << a[i-1] << ',' << con << ')';
			con = 1;
		}
	}
	cout << '(' << a[i-1] << ',' << con << ')';
	return 0;
}
struct point
{
	int x;
	char y;
};
int main()
{
	char c[1100];
	int i,j,n,b=0;
	struct point dian[27];
	gets(c);
	n=strlen(c);
	for(i=0;i<n;i++)
	{
		if(c[i]>='a')
			c[i]=c[i]-32;
	}
	dian[0].y=c[0];
	j=0;
	dian[0].x=1;
	for(i=1;i<n;i++)
	{
		if(c[i]==c[i-1])
		{
			dian[j].x+=1;
		}
		else
		{
			j++;
			dian[j].y=c[i];
			dian[j].x=1;
		}
	}
	for(i=0;i<=j;i++)
	{
		printf("(%c,%d)",dian[i].y,dian[i].x);
	}
	return 0;
}
struct stu
{
	char letter;
	int count;
};
int main()
{
	struct stu b[1001];
	char c[1000];
	char *str,*p;
	int i,j;
	str=p=c;
	gets(c);
	while(*p)
	{
		if(*p>='a'&&*p<='z')
			*p=*p+'A'-'a';
		p++;
	}
	b[0].letter=*str;
	b[0].count=1;
	str++;
	j=0;
	while(*str)
	{
		if(*str==*(str-1))
			b[j].count++;
		else
		{
			j++;
			b[j].letter=*str;
			b[j].count=1;
		}
		str++;
	}
	for(i=0;i<=j;i++)
		printf("(%c,%d)",b[i].letter,b[i].count);
	return 0;
}
int main ()
{
	char str[1000] ;
	int count = 0 , i , j = 0 , a[1000] , k = 0 , m ;
	cin >> str ;
	//cout << "(" << (char)'A + '
	for (i = 0 , j = 0 ; str[i] != '\0' ; i ++ , j ++)
	{
		if (str[i] >= 97&&str[i] <= 122)
		{
			a[j] = str[i] - 'a' ;
		}
	    if (str[i] >= 65&&str[i] <= 90)
		{
			a[j] = str[i] - 'A' ;
		}
	}
	cout << "(" << (char)('A' + a[0]) << "," ;
	for (k = 1 ; k < j ; k ++)
	{
		if (a[k] == a[k - 1])
			count ++ ;
		else
		{
			cout << count + 1 << ")" ;
			count = 0 ;
			cout << "(" <<(char) ('A' + a[k]) << "," ;
		}
	}
	//count = 0 ;
	//for (m = j ; a[m] != a[j] ; m --)
	//{
	//	count ++ ;
	//}
	cout << count + 1 << ")" << endl ;
	return 0 ;
}
int main()
{
	char a[1000] , b ;
	int i , l = 0 , m;
	cin >> a;
	m = strlen(a);
for(i = 0 ; i < m ; i++)
{
	if(a[i] == a[i + 1] || a[i] + 32 == a[i+1] || a[i] - 32 == a[i+1])
	{
		l++;
		continue;
	}
	else
	{
		if(a[i] - 'Z' > 0)
		{
			b = a[i] - 32 ;
		}
		else {b = a[i] ;}
	cout <<"("<<b<<","<<l + 1<<")";
	l = 0;
	}
}
return 0 ;
}
int main()
{
	char str[1000],temp;
	int i,count = 1;
	cin >> str;
	if(str[0] >= 97 && str[0] <= 122)
		temp = str[0] - 32;
	else
		temp = str[0];
	for(i = 1 ; i < strlen(str) ; i++)
	{
		if(str[i] == temp || str[i] - 32 == temp)
		{
			count++;
		}
		else if(str[i] >= 65 && str[i] < 90)
		{
			cout << "(" << temp << "," << count << ")";
			temp = str[i];
			count = 1;
		}
		else if(str[i] >= 97 && str[i] < 122)
			{
			cout << "(" << temp << "," << count << ")";
			temp = str[i] - 32;
			count = 1;
		}
	}
	cout << "(" << temp << "," << count << ")";
	return 0;
}
void main()
{
	char s[MAX];
	struct code{
		char c;
		int n;
	}t[MAX];
	int len,i,j,k;

	scanf("%s",s);
	len=strlen(s);
	for(i=0;i<len;i++){
		if(s[i]>=97&&s[i]<=122)
			s[i]-=32;
	}
	
	j=0;
	k=0;
	while(j<len){
		t[k].c=s[j];
		for(i=j;;i++){
			if(t[k].c!=s[i]){
				t[k].n=i-j;
				j=i;
				k++;
				break;
			}
		}
	}
	
	for(i=0;i<k;i++)
		printf("(%c,%d)",t[i].c,t[i].n);
	printf("\n");
}
int main()
{
	char str[1005];
	char mem[1005];
	int  num[1005]={0};
	cin >> str;
	int len;
	len=strlen(str);
	int i,j,m=0,n=0;
	int sum=0;
	for(i=0;i<1000;i++){
		if(str[n]<97){
			mem[m]=str[n];
		}
		else{
			mem[m]=str[n]-32;
		}
		for(j=n;j<len;j++){
			if(str[j]==mem[m] || ((str[j]-mem[m])==32))
			{
				sum++;
			}
			if( str[j]!=mem[m] && (str[j]-mem[m])!=32 && j!=len-1 ){
				num[m]=sum;
				sum=0;
				n=j;
				break;
			}
			if(j==len-1 && str[j]!=mem[m] && (str[j]-mem[m])!=32 ){
				num[m]=sum;
				if(str[j]<97){
				mem[m+1]=str[j];}
				else
					mem[m+1]=str[j]-32;
				num[m+1]=1;
				m+=2;
				n=len;
				break;
			}
			if(j==len-1 && (str[j]==mem[m] || (str[j]-mem[m])==32) ){
				num[m]=sum;
				m++;
				n=len;
				break;
			}
		}
		if(n<len-1){
			m++;
			continue;
		}
	}
	for(i=0;i<m;i++){
	cout <<"("<<mem[i]<<","<<num[i]<<")";
	}
	return 0;
}
main()
{
	char a[1000];
	scanf("%s",a);
	int i,A,j;
	A=strlen(a);
	int b[1000];           //?????????0???????????
	for(i=0;i<1000;i++)
		b[i]=1; 
	for(i=0;i<A;i++)
	{
		for(j=i+1;j<A;j++)
		{
			if(a[j]==a[i]||a[j]==a[i]-'a'+'A'||a[j]==a[i]-'A'+'a')
				b[i]++;
			else
				break;
				
			
		}
		if(a[i]>='a'&&a[i]<='z')
				a[i]=a[i]-'a'+'A';
		printf("(%c,%d)",a[i],b[i]);
		i=j-1;
	}
}
char str[1000];
int main(int argc, char *argv[])
{
    char current;
    int q=0;
    cin.getline(str,1000,'\n');
    current=str[0]>=96?str[0]-'a'+'A':str[0];
    
    for(int i=0;i<strlen(str)+1;i++)
    {
        if(str[i]>=96)str[i]-='a'-'A';
        if(str[i]==current){
            q++;
        }
        else{
            cout<<"("<<current<<","<<q<<")";
            current=str[i];
            q=1;
        }
    }
    return EXIT_SUCCESS;
}
int main()
{
    int n,i,j,k,s;
    int l;
    char shuru[2000];
    scanf("%s",shuru);                
   i=strlen(shuru);
   k=0;
   l=0;
   
   for(j=0;j<i;j++)
   {
       if(shuru[j]>90)
       shuru[j]=shuru[j]-32;
       else;                
   }
   if(i==1)
   {
       printf("(%c,1)",shuru[k])  ;   
   }
   else
   {
   
   while(k<i-1)
   {
       
        if(shuru[k]==shuru[k+1])
        {
                                s=1;
                do
               {
                 s++;
                 
               }
                while(shuru[k]==shuru[k+s]); 
                printf("(%c,%d)",shuru[k],s); 
                
                k=k+s;                                                     
        }
        else
        {
            printf("(%c,1)",shuru[k]);
            k++;
            l++;
        }
       // printf("%d",k);
        
        if(k==i-1)
        printf("(%c,1)",shuru[k]);
        else;
        
          
   }
}
    
    getchar();
    getchar();
}
int main()
{
	int i,j,len,num[2000]={0},k;
	char str[2000]={0},ch;
	cin.getline(str,1003);
	len=strlen(str);
	for(i=0;i<len;i++)
	{
		if(str[i]>='a'&&str[i]<='z') str[i]-=32;
	}
	for(i=0;i<len;i++)
	{
		ch=str[i];
		for(j=1;j<len-i&&str[i+j]==ch;j++);
		num[i]=j;
		i=i+j-1;
	}
	for(i=0;i<len;i++)
	{
		if(num[i]!=0) cout<<'('<<str[i]<<','<<num[i]<<')';
	}
	return 0;
}
int main()
{
    int n[27];
    char s[1001];
    gets(s);
    int i,j,k;
    int c=1;
    int l=strlen(s);
    for(i=0;i<l;i++)
    {
                    if(s[i]<='z'&&s[i]>='a')
                    s[i]=s[i]-'a'+'A';
    }
    for(i=1;i<l;i++)
    {
                    if(s[i]==s[i-1])
                    {c++;}
                    else
                    {
                        printf("(%c,%d)",s[i-1],c);
                        c=1;
                    }
    }
    printf("(%c,%d)",s[l-1],c);
    getchar();
    getchar();
}
char a[1000];
main()
{
	int i,j,n=1;
	cin>>a;
	j=strlen(a);
	for(i=0;i<j;i++) if(a[i]>96) a[i]-=32;
	for(i=1;i<=j;i++)
	{
		if(a[i]==a[i-1]) n++;
		else
		{
			cout<<'('<<a[i-1]<<','<<n<<')';
			n=1;
			}
		}
	}
int main()
{
	char str[1000];
	scanf("%s",str);
	char charCurrent ,charNext;
	charCurrent = charNext = toupper(str[0]);
	int count = 0;
	for(int i = 0; str[i] != '\0'; i++)
	{
		charCurrent = toupper(str[i]);
		if(str[i + 1] == '\0')
		{
			if(charCurrent == charNext)
				count++;
			break;
		}	
		charNext = toupper(str[i + 1]);
		if(toupper(str[i + 1]) == toupper(str[i]))
		{
			count++;
		}
		else
		{
			printf("(%c,%d)",charCurrent,count + 1);
			count = 0;	
		}
	}
	printf("(%c,%d)",charCurrent,count);
	return 0;
}
main()
{
      char a[1000];
      scanf("%s",a);
      char n;
      int i,m,j;
      m=1;
      for(i=1;i<1000;i++)
      {                  
                         if(a[i-1]=='\0')break;
                         if(a[i]==a[i-1])
                         m++;
                         else if(a[i]==a[i-1]+('A'-'a'))
                         m++;
                         else if(a[i]==a[i-1]-('A'-'a'))
                         m++;
                         else
                         {   
                             if('A'<=a[i-1] &&a[i-1]<='Z')
                             printf("(%c,%d)",a[i-1],m);
                             else
                             {printf("(%c,%d)",a[i-1]+'A'-'a',m);}
                             m=1;
                         }
      }

}
main()
{
          int i,j,t,m;
          char str[1000];
          scanf("%s",str);
          i=strlen(str);
          if (str[0]>='a'&&str[0]<='z')
          str[0]=str[0]+'A'-'a';  
          t=str[0];
          m=0;
          for(j=0;j<i;j++)
          {
              if (str[j]>='a'&&str[j]<='z')
              str[j]=str[j]+'A'-'a';     
              if (t==str[j])
              m=m+1;
              else 
              {
              printf("(%c,%d)",t,m);
              t=str[j];
              m=1;
              }
          }
          printf("(%c,%d)",t,m);
}
int main()
{
   char str[1001];
   int i,j,k;
   char temp;
   int flag[200];
   for(i=0;i<=199;i++)
	   flag[i]=0;
   gets(str);
   i=1;
   if(str[0]>='a'&&str[0]<='z')
		   str[0]=str[0]-'a'+'A';
   temp=str[0];
   flag[str[0]]=1;
   while(str[i]!=0)
   {
	   if(str[i]>='a'&&str[i]<='z')
		   str[i]=str[i]-'a'+'A';
	   if(flag[str[i]]==0)
	   {
           cout<<'('<<temp<<','<<flag[temp]<<')';
		   flag[temp]=0;
		   temp=str[i];
		   flag[str[i]]=1;

	   }
	   else
	   {
		   flag[str[i]]++;
	   }
     i++;
   }
   
   if(flag[str[i-1]]!=0)
	   cout<<'('<<temp<<','<<flag[temp]<<')';
	return 0;
}
/*
 *  Name:homework.cpp
 *  Created on: 2012-12-12
 *  Author: Meng Li
 *  Function:????
 *   */


int main(){                            //???
	char input[1000];
	cin >> input;
	int length=0;
	length=strlen(input);
	int i, count=0, j;
	for (i=0;i<length;i++){
		count=0;
		if (input[i]>=97)
			input[i]=input[i]-32;
		for (j=i;j<length;j++){
			if (input[i]==input[j]||input[j]==input[i]+32){
				count++;
			}
			else
				break;
		}
		cout << '(' << input[i] << ',' << count << ')';
		i=j-1;
	}
	return 0;
}
char tran(char ch)
{
  char y;
  if(ch<='Z'&&ch>='A')
    y=ch;
  else
    y=ch+'A'-'a';
  return y;
}
main()
{
   int lenc,i,p=0,a[1000]={1};
   char b[1000],c[1000];
   gets(c);
   lenc=strlen(c);
   for(i=0;i<lenc;i++)
     c[i]=tran(c[i]);
   b[0]=c[0];
   for(i=1;i<lenc;i++)
     {
        if(c[i]==c[i-1])
           a[p]++;
        else
           {
            p++;
            b[p]=c[i];
            a[p]=1;
           }
     }
   for (i=0;i<=p;i++)
      printf("(%c,%d)",b[i],a[i]);
}
int  main()
{

	char yy[27]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};

char stri[1001],s;
cin>>stri;
int len,i=0,sum=0;
len=strlen(stri);
while(i<len)
{
s=stri[i];
while(stri[i]-'a'==s-'a'||stri[i]-'a'==s-'A'||stri[i]-'A'==s-'a'||stri[i]-'A'==s-'A')
{sum++;
i++;}
if((s-'A')>=0&&(s-'A')<=26)
cout<<"("<<yy[s-'A']<<","<<sum<<")";
else
cout<<"("<<yy[s-'a']<<","<<sum<<")";

 sum=0;
}

return 0;
}
main()
{
int i,n,k;
char a[1000];
scanf("%s",a);
n=strlen(a);
for(i=0;i<n;i++)
  {
   if(a[i]<'A'||a[i]>'Z')
   a[i]='A'-'a'+a[i];
   }
for(i=0;i<n;i++)
  {
   k=1;
  while(a[i]==a[i+1])
     {
       if(a[i]==a[i+1])
     k++;
     i++;
     }
     printf("(%c,%d)",a[i],k);
  }
getchar();getchar();getchar();getchar();
}
main()
{
	char a[1000];
	int num=1;
	int i,j;
	gets (a);
	for (i=0;a[i]!='\0';i++)
	{
		if (a[i]==a[i+1]||a[i]==a[i+1]+32||a[i]==a[i+1]-32)//?????????? 
		{
		num++;
		}
		else
		{
		if (a[i]<91)//??????? 
		printf("(%c,%d)",a[i],num);//?????? 
		else
		printf("(%c,%d)",a[i]-32,num);
		num=1;
		}		
	}
}
int main()
{
	char a[1001];
	int i, j, count = 1, len;
	cin.getline(a, 1001);
	len = strlen(a);
	for (i = 0; i <= strlen(a); i++)
	{
		if (a[i] > 'Z')
			a[i] = a[i] - ('a' -'A');
		if (i == 0)
			continue;
		if (a[i] == a[i - 1])
		{
			count++;
		}
		else
		{
			cout << "(" << a[i - 1] << "," << count << ")";
			count = 1;
		}
	}
	return 0;
}
int main()
{
	char s[1005];
	int i=0,j,k=1;
	gets(s);
	while(s[i]!='\0')
	{
		if(s[i]-'a'>=0&&s[i]-'z'<=0)
		s[i]=s[i]-'a'+'A';
		i++;
	}
	i=0;                           //i?????????? 
	while(s[i]!='\0')
	{
		if((s[i])!=(s[i+1]))
		{
			printf("(%c,%d)",s[i],k);
			k=1;
		}
		else k++;
		i++;
	}
}
/*
 * 02.cpp
 *
 *  Created on: 2011-12-31
 *      Author: 2011
 */
int main()
{
	char a[1000];
	cin>>a;
	int k=0,j,number=0;
	int len=strlen(a);
	int i=0;
	for(i=0;i<len;i++)
	{
		if(a[i]>='a'&&a[i]<='z')
		{
			a[i]=a[i]-32;
		}
	}
	for(i=0;i<len;i=i+k)
	{
		for(j=i;j<len;j++)
		{
			if(a[j]==a[j+1])
			{
				number++;
			}
			else break;
		}
		number++;
		cout<<"("<<a[i]<<","<<number<<")";
		k=number;
		number=0;
	}
}
int main()
{
	char a[1005],b[1005];
	cin>>a;
	int len,i;
	int sum[1005],t=0;
	memset(sum,0,sizeof(sum));
	len=strlen(a);
	for(i=0;i<len;i++)
	{
		if(a[i]>='a')
			b[t]=a[i]-32;
		else
		{
		b[t]=a[i];
		}
		while(a[i]==b[t]||a[i]==b[t]+32||a[i]==b[t]-32)
		{
			i++;
			sum[t]++;
		}
		t++;i--;
	}
	for(i=0;i<t;i++)
	{
		cout<<"("<<b[i]<<","<<sum[i]<<")";
	}
	cout<<endl;
	return 0;
}
main()
{   
    char str[1000];
    int a[1000]={0},i,n,t=1;
    scanf("%s",str);
    for(i=0;str[i]!='\0';i++)
    {
    if((str[i]>=97)&&(str[i]<=122)) 
    str[i]=str[i]-32;                         
    }
    for(n=0;str[n]!='\0';n++)
    {
    
    if(str[n]==str[n+1])
    t=t+1;
    else
    {
    printf("(%c,%d)",str[n],t);
    t=1;
    }
    }
    
}
int main()
{
	char str[1001];
	int i, len, count;
	cin >> str;
	len = strlen(str);
	for (i = 0; i < len; i++)
	{
		if (str[i] >= 'a' && str[i] <= 'z')
		{
			str[i] -= 32;
		}
	}
	i = 0;
	while (i < len)
	{
		count = 1;
		while (str[i+1] == str[i] && i < len)
		{
			i++;
			count++;
		}
		cout << "(" << str[i] << "," << count << ")";
		i++;
	}
	return 0;
}
//??(12-5) ?????? ??? 20121231

char s[1010];

int main()
{
    scanf("%s",s);
    int i=0,d=1;

    while(s[i]!='\0')
    {
        if(s[i]>='a'&&s[i]<='z') s[i]-=32;
        if(s[i+1]!=s[i]&&s[i+1]!=s[i]+32)
        {
            printf("(%c,%d)",s[i],d);
            d=1;
            i++;
            continue;
        }
        d++,i++;
    }
    return 0;
}
int main()
{
    char a[1000];
    gets(a);
    int i=0;
    int l,m;
    l=strlen(a);
    while(i<l)
    {
          int k=1;
         //int q=0;
         m=i+1;
         while((a[i]==a[m]||a[i]==a[m]-'a'+'A'||a[i]==a[m]+'a'-'A')){
                  k++;  
                  m++;                                                
         }
         if (a[i]>='a'&&a[i]<='z')
                  a[i]=a[i]-'a'+'A';
                  //if(m==l-1)
                  //k++;
                printf("(%c,%d)",a[i],k);
                i=m;
        /*for(m=i+1;m<l;m++)
        {
           if (a[i]==a[m]||a[i]==a[m]-'a'+'A'||a[i]==a[m]+'a'-'A')
           {
              k++;
           }
           
            
           else 
            {
                if (a[i]>='a'&&a[i]<='z')
                  a[i]=a[i]-'a'+'A';
                  //if(m==l-1)
                  //k++;
                printf("(%c,%d)",a[i],k);
                i=m;
                //q++;
                break;
            }
           
        }*/
    }
getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();
}
main()
{
	char str[MAX];
	char c;
	int i,num,flg;
	scanf("%s",str);
	flg=0;
	for (i=0;;i++)
	{
	
		if ((i!=0) && (str[i]==str[i-1] || str[i]==str[i-1]-32 || str[i]==str[i-1]+32))
		{
				num=num+1;	
		}
		else if (str[i]>='A' && str[i]<='Z') 
			{
				if (flg)
					printf("(%c,%d)",c,num);
				flg=1;
				c=str[i];
				num=1;	
			}
				else
				{
					if (flg)
						printf("(%c,%d)",c,num);
					flg=1;
					c=str[i]-32;
					num=1;	
				}
		if (str[i]=='\0')
			break;	
	}
}
/* Name        : ??????
 * Version     : 1.0 
 * Date        : 2013-01-11 
 * New         : 
 * Description : 
 * State       : Design
 */
int main()
{
    char Ch[1001]={0},ChO[1001]={0};
    int iChO[1001]={0},k=0;
    cin>>Ch;
    if (Ch[0]>95) Ch[0]-=32;
    ChO[0]=Ch[0],iChO[k]=1;
    for (int i=1;i<1001;i++)
    {
        if (Ch[i]>95) Ch[i]-=32;
        if (Ch[i]==Ch[i-1])
        {
            iChO[k]++;
        }
        else
        {
            k++;
            ChO[k]=Ch[i];
            iChO[k]=1;
        }
    }
    for (int i=0;ChO[i]!=0;i++)
    {
        cout<<'('<<ChO[i]<<','<<iChO[i]<<')';
    }
    return 0;
}
int main()
{
    int i,j;
    i=0;
    j=1;
    char a[1001];
    gets(a);
    do
    {
        if(a[i]>'Z')
        {
            a[i]=a[i]-('a'-'A');
        }
        i=i+1;
    }
    while(a[i]!='\0');
    i=0;
    do
    {
        if(a[i]==a[i+1])
        {
            j=j+1;
        }
        else
        {
            printf("(%c,%d)",a[i],j);
            j=1;
        }
        i=i+1;
    }
    while(i<1001&&a[i]!='\0');
    return 0;
}
int main(){
	int i=0,j=0,k=0,l,f[1002]={0},g;
	char s[1002],a[1002];
	gets(s);
	l=strlen(s);
	if(l==1){
		if(s[0]>=65&&s[0]<=90)
			printf("(%c,%d)",s[0],1);
		else
			printf("(%c,%d)",s[0]-32,1);
	}
	else{
		for(i=1;i<=l;i++){
		k=i-1;
		f[k]=1;
		for(;i<l;i++){
			if(s[i]==s[k]||abs(s[i]-s[k])==32)
				f[k]++;
			else
				break;
		}
		if(s[k]>=65&&s[k]<=90)
			printf("(%c,%d)",s[k],f[k]);
		else
			printf("(%c,%d)",s[k]-32,f[k]);
	}
	}
	return 0;
}
int main()
{
	char a[1000]={0};
	int len, i, sum=1;
	cin >> a;
	len=strlen(a);
	for(i=0;i<len;i++)
		if(a[i]>='a'&&a[i]<='z')
			a[i]=a[i]+('A'-'a');
	for(i=1;i<=len;i++)    //????<=??<
	{
		if(a[i]==a[i-1])
			sum++;
		else
		{
			cout << "(" << a[i-1] << "," << sum << ")";
			sum = 1;
		}
	}
	return 0;
}
int main()
{
	char string[1500],string2[2];
	int i=0,j=0,m=0,n=0,length=0,flag=0;
	int a[1500];
	gets( string );
	length=strlen( string );
	for ( i=0;i<length;i++ )
	{
		a[i]=1;
	}
	
	for ( i=0;i<length;i++ )
	{
		if ( string[i]>=97 && string[i]<=122  )
			string[i]=string[i]-32;
	}
	
	for ( i=1;i<length;i++ )
	{
		if ( string[i]==string[i-1] )
		{
			a[i]=a[i-1]+1;
		}
		else if ( string[i]!=string[i-1] )
		{
			cout<<"("<<string[i-1]<<","<<a[i-1]<<")";
		}
	}
	cout<<"("<<string[length-1]<<","<<a[length-1]<<")"<<endl;
	
	return 0;
}
int main()
{
    char a[2000];
	cin >> a;
	int i = 1, count = 1;
	while(a[i] != '\0')
	{
		if(a[i] == a[i-1] || a[i] == a[i-1] + 32 || a[i] == a[i-1] - 32)
			count++;
		else
		{
			if(a[i-1] <= 'Z')
			{
				cout<<'('<<a[i-1]<<','<<count<<')';
	            count = 1;
		    }
			else
			{
			    cout<<'('<<(char)(a[i-1] - 32)<<','<<count<<')';
	            count = 1;
			}

		}
		i++;
	}
	if(a[i-1] <= 'Z')
		cout<<'('<<a[i-1]<<','<<count<<')';
	else
 	    cout<<'('<<(char)(a[i-1] - 32)<<','<<count<<')';
	return 0;
}
main()
{
      char x[1001],z[1001]; 
      int i,n=1;
      for (i=0;i<1001;i++)
      {
          x[i]='\0';
          z[i]='\0';
          }
      scanf("%s",x);
      //printf("%c\n",xz[0]);
      for (i=0;x[i]!='\0';i++)
      {
          if (x[i]>='a'&&x[i]<='z')
          z[i]=x[i]-'a'+'A';
          else
          z[i]=x[i];
      }
      for (i=0;z[i]!='\0';i++)
      {
          if (z[i]==z[i+1])
          n++;
          else
          {printf("(%c,%d)",z[i],n);
          n=1;}
      }
      getchar();
      getchar();
      getchar();
}
int main()
{
char str[1000];
int i,j,n;
scanf("%s",str); 

for(i=0;str[i]!='\0';i++)
  {
  if(str[i]>='a')
  str[i]+='A'-'a';
  else;
  }
   

n=1;
for(i=0;str[i]!='\0';i++)
    {

     if(str[i]==str[i+1])
     n++;
     else
     {printf("(%c,%d)",str[i],n);
     n=1;}
    
        
    }                   
 return 0;
}