semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	char a[1000];
	char b[100];
	int i,flag,j;
	int c[100];
	gets(a);
	for(i=0;i<1000;i++)
	{	if(a[i]>96)
			a[i]=a[i]-32;
	if(a[i]==0)
		break;}
	flag=i;
	b[0]=a[0];
	j=0;
	for(i=0;i<=flag;i++)
		c[i]=1;
	for(i=1;i<=flag;i++)
	{if(b[j]==a[i])
	c[j]++;
	else
	{j++;
	b[j]=a[i];
	}
	}
	for(i=0;i<j;i++)
	printf("(%c,%d)",b[i],c[i]);
	return 0;
}
int main()
{
    int i;
    int num=1;
    char c[1000];
    scanf("%s",c);
    for(i=0;c[i]!='\0';i++)
    {
        if(c[i+1]==c[i]||abs(c[i+1]-c[i])==32)
            num+=1;
        else
        {
            c[i]=(c[i]>96)?(c[i]-32):c[i];
            printf("(%c,%d)",c[i],num);
            num=1;
            }
    }
    printf("\n");
    return(0);
}
/*
 * 2.cpp
 *
 *  Created on: 2011-12-31
 *      Author: 2011
 */
int main()
{
	char a[1001],temp;
	int i,len,num=1;
	cin >>a;
	len = strlen(a);
	if (a[0]>='a' && a[0]<='z')
		temp = a[0]-32;
	else temp = a[0];
	for (i=1; i<=len; i++)
	{
		if (a[i]>='a' && a[i]<='z') a[i]=a[i]-32;
		if (temp == a[i])
				num++;
		else
		{
			cout <<'(' <<temp <<',' <<num <<')';
			temp = a[i];
			num = 1;
		}
	}
	return 0;
}
int main(){
	char a[1005],t;
	int n,i;
	cin>>a;
	i=0;
	if(a[i]>='A'&&a[i]<='Z')
		t=a[i]; 
	else t=a[i]-32;
	n=1;
	for(int i=1;a[i]!=0;i++)
	{
		if(a[i]!=t&&a[i]-32!=t) {
			cout<<'('<<t<<','<<n<<')';
			if(a[i]>='A'&&a[i]<='Z')
				t=a[i]; 
			else t=a[i]-32;
			n=1;
		}
		else n++;
	}
	cout<<'('<<t<<','<<n<<')';
	return 0;
}
const int d = 'a'-'A';


int main ()
{
	char a[1010]={0};
	cin>>a;
	int lenth = strlen(a);
	char outs[1010]={0};
	int outn[1010]={0};
	int num = 0;
	for (int i=0;i<lenth;i++){
		if (a[i]>'Z') 
			a[i] -= d;
	}
	outn[0] = 1;
	outs[0] = a[0];
	for (int i=0;i<lenth;i++){
		if (a[i] == a[i+1]){
			outn[num] += 1;
		}
		else {num += 1;outs[num]=a[i+1];outn[num]=1;}
	}
	for (int i=0;i<num;i++)
		cout<<"("<<outs[i]<<","<<outn[i]<<")";
	return 0;
	
}
main()
{
      char a[1001];
      int l,i,sum=1;
      scanf("%s",a);
      l=strlen(a);
      a[l]=' ';
      for(i=0;i<l;i++)
      {
                      if(a[i]<='z'&&a[i]>='a')
                      a[i]=a[i]-'a'+'A';
      }
      for(i=0;i<l;i++)
      {
                      if(a[i]==a[i+1])
                      sum=sum+1;
                      else
                      {
                          printf("(%c,%d)",a[i],sum);
                          sum=1;
                      }
      }
      getchar();
      getchar();
}
int main()
{
	char m;
	char temp='*';
	int cnt=0;
	int char_cnt=1;
	int TRUE=1;
	while(TRUE)
    {
               scanf("%c",&m);
               ++cnt;
	           if(m>=97&&m<=122)      m=m-32;
	           if(m==temp)            char_cnt++;
	           else if(temp=='*');
	           else
               {
                                 printf("(%c,%d)",temp,char_cnt);
		                         char_cnt=1;		                         
               }
	           temp=m;
	           if(m=='\n') break;
	}
	return 0;
}
int main()
{
 char a[10000],b[10000];
 int l,zushu=0,c[10000]={1};
 gets(a);
 
 l=strlen(a);
 for(int i=0;i<l;i++)
 if(a[i]>='a'&&a[i]<='z')
                       a[i]=a[i]+('A'-'a'); 
 b[0]=a[0];          
 
 for(int i=0;i<l-1;i++)
            {
             
             if(a[i]==a[i+1])
                     {
                      c[zushu]++;
                      
                             
                     }
             else
                     {zushu++;
                      
                      b[zushu]=a[i+1];
                             
                     }        
            }
 printf("(%c,%d)",b[0],c[0]);
 for(int i=1;i<=zushu;i++)
 {
 
 
 printf("(%c,%d)",b[i],c[i]+1);    
}
getchar();
getchar();
}
int main()
{
    char a[1000],b[1000][1];
    int number[1000]={0},i,j,k=0,len;
    cin>>a;
    len=strlen(a);
    for(i=0;i<len;i++)                              //????????????
    {
        if(a[i]>=97) a[i]=a[i]-32;
    }

    //cout<<a;

    k=0;
    b[k][0]=a[0];number[k]=1;
    for(i=1;i<len;i++)                              //????
    {
        if(a[i]==b[k][0])
         {
             number[k]=number[k]+1;  //cout<<number[k]<<' ';
         }
        else
        {
            number[k+1]=1;b[k+1][0]=a[i];k=k+1;
        }
    }

    for(j=0;j<k+1;j++)
    {
        cout<<'('<<b[j][0]<<','<<number[j]<<')';
    }


   return 0;
}
int main()
{
    char a[1001];
    int l,i,sum=1;
    gets(a);
    l = strlen(a);
    for ( i = 0 ; i < l ; i ++ )
    {
        if ( a[i] >= 'a' && a[i] <= 'z' )
        a[i] -= 32;
    }
    for ( i = 0 ; i < l ; i ++ )
    {
        if ( a[i] == a[i+1] )
        {
             sum++;
             }
        else
        {
            cout<<"("<<a[i]<<","<<sum<<")";
            sum=1;
        }
        }
}
int main()
{
    char str[1000],a[1000];
    gets(str);
    int i,n=1,j=0;
    int b[1000];
    for(i=0;str[i]!='\0';i++)
    {
    if(str[i]>'Z')
    str[i]=str[i]-32;
    }
    for(i=0;str[i]!='\0';i++)
{
    if(str[i+1]==str[i])
    n++;
    else
    {
    a[j]=str[i]; 
    b[j]=n;
    j++;
    n=1;
    }
}
    for(i=0;i<j;i++)
    printf("(%c,%d)",a[i],b[i]);
return 0;
}
main()
{  char a[1020];
   scanf("%s",a);
   int t,j;
   t=strlen(a);
   int i;
   int b[1020],k,h=0;
   if(t==1&&(a[0]-'a')>=0)
   printf("(%c,%d)",a[0]-32,1);
   else if (t==1&&(a[0]-'a')<=0)
   printf("(%c,%d)",a[i],1);      
   else
  { for(i=0;i<=t-2;)
  { for(i=h,k=1;i<=t-2;i++)
   {if(a[i]-a[i+1]==0||a[i]-a[i+1]==32||a[i]-a[i+1]==-32)
    {  k=k+1;
        
    }
    else 
    break;
    
                      }
      h=i+1;  
   if(a[i]-'a'>=0)
    printf("(%c,%d)",a[i]-32,k);
    else
    printf("(%c,%d)",a[i],k);                    
}                 
   }    }
int main()
{
	char s[1000];
	cin.getline(s,1000);
	int len = strlen(s);
	int i , n = 1;
	for(i = 1; i < len;i++)
	{
		if(s[i] == s[i-1] || s[i] - s[i-1] == 'A'-'a' ||s[i] - s[i-1] =='a'-'A')
			n++;
		else
		{
			cout <<"(" <<(char)toupper(s[i-1])<<","<<n<<")";
			n=1;
		}
	}
	cout <<"(" <<(char)toupper(s[len - 1])<<","<<n<<")";
	return 0;
}
char shift(char y)
{
    char x;
    if(y>='a')
    x=y-'a'+'A';
    else
    x=y;
    return x;
    }
main()
{
    char a[101];
    int i,sum=1;
    scanf("%s",a);
    printf("(%c,",shift(a[0]));
    for(i=1;;i++)
    {
        if(shift(a[i])==shift(a[i-1]))
        {
            sum++;
            }
        if((shift(a[i])!=shift(a[i-1]))&&(a[i]!='\0'))
        {
            printf("%d)(%c,",sum,shift(a[i]));
            sum=1;
            }
        if(a[i]=='\0')
        {
            printf("%d)",sum);
            break;
            }
        }
    }
int main()
{
	char ch[100];
	int i,j,count=0,m;
	cin>>ch;
	for(i=0;i<strlen(ch);i++)
		if(ch[i]>='a'&&ch[i]<='z')
			ch[i]=ch[i]-32;
		j=0;
	
		while(1)
		{	m='A';
		for(i=m;i<='Z';i++)
		{
			if(i==ch[j])
			{
				while(i==ch[j])
				{
				count++;
				j++;
				}
			   cout<<'('<<(char)i<<','<<count<<')';
			   count=0;
			   m='A';
			}
		}
		if(j==strlen(ch))
			break;
		}
		return 0;
}
char str[1001],x;
int length;
void display(int p)
{
    if (!str[p]) return;
    if (length==1)
    {
        if (str[p]>='A'&&str[p]<='Z')
            x=str[p];
        else
            x=str[p]-32;
    }
    if (str[p]!=str[p+1]&&abs(str[p]-str[p+1])!=32)
    {
        cout<<'('<<x<<','<<length<<')';
        length=1;
    }
    else
        length++;
    display(p+1);
}        
int main()
{
    cin>>str;
    length=1;
    display(0);
}
//??????(??)
struct yasuohou
{
	char letter;
	int count;

}yasuohou;
int main()
{
	char str[100];
	struct yasuohou lettercount[100];//struct???????????????????????????[]??????
	int i,j;//i???????j???????
	gets(str);
	//?????
	for (i=0;i<strlen(str);i++)
	{
		if (str[i]>=97&&str[i]<=122)
		{str[i]=str[i]-32;
		}
	}


	//??????????????????lettercount[i]
	i=0;j=0;
	lettercount[j].letter=str[i];
	lettercount[j].count=1;
	for (i=0;i<strlen(str);i++)
	{
		if (str[i+1]==str[i])//????????????lettercount[i]????lettercount[i].count++
		{
			lettercount[j].count++;
			
		}
		else if (str[i+1]!='\0'&&str[i+1]!=str[i])
		{
			lettercount[j].count++;//???lettercount[j].count??
			j++;//??????lettercount[j]
			lettercount[j].letter=str[i+1];//?????letter?str[i+1]?letter
			lettercount[j].count=1;
			
		}
		else if (str[i+1]=='\0')
		{   lettercount[j].count++;
		break;
		}
	}
	for (i=0;i<=j;i++)
	{printf("(%c%c%d)",lettercount[i].letter,',',(lettercount[i].count)-1);
	}

	return 0;
}
int main()
{
	char a[1000];
	cin>>a;
	int length;
	int i;
	length=strlen(a);
	char b[1000];
	int c[1000];
	int x;
	x=0;
	for(i=0;i<length;i++)
	{
		if(a[i]>='a' && a[i]<='z')
			a[i]=a[i]-32;
	}
	b[0]=a[0];
	c[0]=1;
	for(i=1;i<length;i++)
	{
		if(a[i]==a[i-1])
		{
			b[x]=a[i];
			c[x]++;
		}
		else
		{
			x++;
			b[x]=a[i];
			c[x]=1;
		}
	}
	for(i=0;i<=x;i++)
		cout<<'('<<b[i]<<','<<c[i]<<')';
	cout<<endl;
	return 0;
}
int main()
{
	char a[2000],b[1000];
	int num[1000],sum=1,t=1;
	int i,j;
	cin>>a;
	for(i=1;a[i-1]!=0;i++)
	{
		if(a[i]==a[i-1]||a[i]-a[i-1]==32||a[i-1]-a[i]==32)sum++;
		else 
		{
			num[t]=sum;
			if(a[i-1]>=97)b[t]=a[i-1]-32;
			else b[t]=a[i-1];
			sum=1;
			t++;
		}
		
	}
	for(j=1;j<t;j++)
	{
		cout<<"("<<b[j]<<","<<num[j]<<")";
	}
	cout<<endl;
	return 0;
}
int main()
{
  char a[1000];
  scanf("%s",a);
  int l,i,b[1000],j;
  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<1000;i++)
  b[i]=0;
  for(i=0;i<l;i++)
  {
     for(j=i+1;j<l;j++)
     {
        if(a[j]==a[i])
          b[i]++;            
        else
        {
            break;
        }
     }
     b[i]++;
     i=j-1;       
  }
  for(i=0;i<1000;i++)
  {
    if(b[i]!=0)
    printf("(%c,%d)",a[i],b[i]);                 
  }
  getchar();
  getchar();  
}
/*1200012866 ???*/
int main(){
	char a[1010];
	cin>>a;
	for(int i=0;i<strlen(a);i++)//???????
		if(a[i]>='a'&&a[i]<='z')
			a[i]=a[i]+'A'-'a';
	int len=0;
	char before='\0';
	for(int i=0;i<strlen(a);i++){
		if(a[i]==before)//?????
			len++;
		else{//?????????
			if(before!='\0')
				cout<<'('<<before<<','<<len<<')';
			before=a[i];
			len=1;
		}
	}
	cout<<'('<<before<<','<<len<<')'<<endl;

	return 0;
}
int main()
{
    char st[2000];
    cin.getline(st,2000);
    for (int i=1;i<=strlen(st);i++)
        if ('a'<=st[i-1] && st[i-1]<='z') st[i-1]=st[i-1]-32;

          int t=1;
    for (int i=2;i<=strlen(st)+1;i++)
    {
        if (st[i-2]==st[i-1]) t++;
        else {printf("(%c,%d)",st[i-2],t); t=1; }
    }


    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=0;
                       while(a[i+1]==a[i])
                       {
                                          n++;
                                          i++;
                       }
                       n++;
                       printf("(%c,%d)",a[i],n);
                       i++;
      }
}
int main()
{
    char str[1000],b[1000];
    gets(str);
    int i,j=1,k=1,a[1000],len;
    len=strlen(str);
    for(i=0;i<len;i++)
    {
        b[0]=str[0];
        if(str[i]==str[i+1]||str[i]==str[i+1]-32||str[i]==str[i+1]+32)
        {
            k++;
        }
        else
        {
            b[j]=str[i+1];
            a[j-1]=k;
            j++;
            k=1;
        }
    }
        if(j==1)
        {
            a[j-1]=k;
        }
    else if(str[len-1]==str[len])
        a[j-2]+=1;
    for(i=0;i<j-1;i++)
    {
        if(b[i]<=122&&b[i]>=97)
        {
            b[i]=b[i]-32;
        }
        printf("(%c,%d)",b[i],a[i]);
    }
    return 0;
}
int main(){
	char a[1000],c[1000];
    int b[1000];
    cin>>a;
    int len,i,j;
    for(i=0;i<1000;i++)
    	b[i]=1;
    len=strlen(a);
    for(i=0;i<len;i++)
    	if(a[i]>='a'&&a[i]<='z')
    		a[i]=a[i]-32;
    a[len]=1;
    len=len+1;
    	for(i=0,j=0;i<len;i++){
    		if(a[i]==a[i+1]){
    			c[j]=a[i];
    			b[j]++;
    		}
    		else {
    		c[j]=a[i];
    		j++;
    		}
    	}
    for(i=0;i<j-1;i++)
    	cout<<"("<<c[i]<<","<<b[i]<<")";
    cout<<endl;
	return 0;
}
int main()
{
char ch[1010]={'\0'};
cin.getline(ch,1002);
int i,j=0,len;
len=strlen(ch);
for(i=0;i<len;i++)
{
while(1)
{
if(ch[j]==ch[i]||ch[j]-ch[i]==32||-ch[j]+ch[i]==32)
j++;
else break;
}
cout<<'(';
if(ch[i]>='a')
cout<<(char)(ch[i]-32);
else
cout<<ch[i];
cout<<','<<j-i<<')';
i=j-1;
}
return 0;
}
main()
{
      char a[1000]={""};
      int num=1;
      int i,N;
      gets(a);
      N=strlen(a);
      i=0;
      do{
         if(a[i]==a[i+1]||a[i]-a[i+1]==32||a[i]-a[i+1]==-32)
          {
              num++;
              i++;
          }
          else
          {
              if(a[i]>'Z'){
                           a[i]=a[i]-32;
                           }
              printf("(%c,%d)",a[i],num);
              num=1;
              i++;
          }
          }
         while(i<N);
      
}
int zimu(char m)
{
	int num = 0;
	if(m <= 'Z' && m >= 'A')
		num = m - 'A' - 1;
	else if(m <= 'z' && m >= 'a')
		num = m - 'a' - 1;
	return num;
}

int main()
{
	int k = 1,i = 1;
	char a[10001],temp;
	cin.getline(a,10001);
	temp = a[0];
	while(a[i] != '\0')
	{
		if(zimu(a[i]) == zimu(temp))
		{
			k++;
		}
		else
		{
			cout << '(' << (char)('A' + 1 + zimu(temp)) << ',' << k << ')';
			k = 1;
			temp = a[i];
		}
		i++;
	}
	if(zimu(a[i - 1]) != zimu(a[i - 2] || k > 1))
		cout << '(' << (char)('A' + 1 + zimu(temp)) << ',' << k << ')';
	return 0;
}
main()
{
	char s[1001],c;
	int i,n=1;
	gets(s);
	if(s[0]>'Z') s[0]-='a'-'A';
	c=s[0];
	for(i=1;s[i];i++)
	{
		if(s[i]>'Z') s[i]-='a'-'A';
		if(s[i]==c) n++;
		else
		{
			printf("(%c,%d)",c,n);
			c=s[i];
			n=1;
		}
	}
	printf("(%c,%d)",c,n);
}
int main()
{
    char a[1000] ,yasuoc[1000];
    int yasuoi[1000] ;
	cin >> a ;
	int i = 1 , temp = 1 ,sum =0;
	while (i < strlen(a))
	{
		if (a[i] == a[i-1] || a[i] -  a[i-1] == 32 || a[i]-a[i-1] == -32)
		{
			temp++ ;
			i++;
		}
		else
		{
			if (a[i - 1] - 'a' >= 0)
				yasuoc[sum] = a[i - 1] - 32;
			else
				yasuoc[sum] = a[i - 1] ;
			yasuoi[sum++] = temp ;
			temp = 1 ;
			i++;
		}
	}
	if (a[i - 1] - 'a' >= 0)
		yasuoc[sum] = a[i - 1] - 32;
	else
		yasuoc[sum] = a[i-1] ;
	yasuoi[sum++] = temp ;
	for (i = 0 ; i<sum ; i++)
		cout << "(" << yasuoc[i] << ","<<yasuoi[i] <<")" ;
	return 0 ;
}
char c;
void get()
{
	
	c=cin.get();
	if(c<='z'&&c>='a')
		c=(char)(  (int)c-'a'+'A'  );
}

int main()
{
	char a[1000]={0};
	int b[1000]={0};


	get();
	int i=0;
	a[i]=c;
	b[i]++;

	get();
	while(c!='\n')
	{
		if(c==a[i])
			b[i]++;
		else
		{
			i++;
			a[i]=c;
			b[i]++;
		}
		get();
	}

	for(i=0;b[i]!=0;i++)
	{
		cout<<"("<<a[i]<<","<<b[i]<<")";
	}


	return 0;
}
main()
{
      char a[1001],c;
      gets(a);
      int i;
      int k=1;
      for(i=0;a[i]!='\0';i++)
      {
           if ((a[i+1]==a[i])||(a[i+1]==a[i]+'A'-'a')||a[i+1]==(a[i]-'A'+'a'))
               k++;
           else
           {
               if(a[i]<'a')
                  printf("(%c,%d)",a[i],k);
               else
               {   
                  c=a[i]+'A'-'a'; 
                  printf("(%c,%d)",c,k);
               }
               k=1;
           }
      }
}
int main()
{
	char a[500] , c;
	int t = 0 , i , len;
	cin >> a;
	len = strlen(a);
	c = a[0];
	t = 1;
	if (c >= 'a' && c <= 'z')
	{
		   c = c - 32;
	}
	for (i = 1 ; i <= len - 1 ; i++)
	{
		if (c >= 'a' && c <= 'z')
		{
		   c = c - 32;
		}
		if (a[i] == c || a[i] == c + 32)
		{
			t++;
		}
		else
		{
			cout << '(' << c << ',' << t << ')';
			c = a[i];
			t = 1;
		}
	}
	cout << '(' << c << ',' << t << ')';
	return 0;
}
int main()
{
	char a[1000];
	int i=0,j,k,b[1000];
	scanf("%s",a);
	while(a[i]!='\0')
	{
	if(a[i]>='a'&&a[i]<='z')
	a[i]=a[i]-'a'+'A';
	i++;
    }
    
    for(j=0;j<i;)
    {
		b[j]=0;
		for (k=j;k<i;k++)
		{
		if(a[j]==a[k])
		b[j]++;
		else
		break;
		
		}
		printf("(%c,%d)",a[j],b[j]);
		j=k;
	}
	
}
/*
 * END2.cpp
 * ??(12-5) ??????
 *  Created on: 2013-1-10
 *      Author: Administrator
 */
int main(){
	int k=1;
    char c[1000],nowchar;
    cin>>c;
    int i=0;
    while(i<strlen(c)-1){
    	 if(c[i]>='a'&& c[i]<='z') nowchar=c[i]-'a'+'A';
    	    	    else nowchar=c[i];
    	while((c[i+1]==c[i] || c[i+1]==c[i]-'A'+'a' || c[i+1]==c[i]-'a'+'A'))
    	{      			k++;i++;
    	}cout<<"("<<nowchar<<","<<k<<")";
    	k=1;
    	i++;
    	}
    if(c[strlen(c)-1]!=c[strlen(c)-2]) {
    	if(c[i]>='a'&& c[i]<='z') nowchar=c[i]-'a'+'A';
    	    	    else nowchar=c[i];
    	cout<<"("<<nowchar<<",1)";
    }
    return 0;
}
main()
{
     char a[2000];
     int b=1;
     int i,j;
     scanf("%s",a);
     for(i=0;a[i]!='\0';i++)
     {
                        if(a[i]>='a'&&a[i]<='z')
                        a[i]=a[i]-32;
     }
     for(j=0;a[j]!='\0';j++)
     {
                        if(a[j]==a[j+1])
                        b=b+1;
                        else
                        {
                            printf("(%c,%d)",a[j],b);
                            b=1;
                        }
     }
     getchar();
     getchar();
     getchar();
     getchar();
     getchar();
     
}
main()
{
    int i,n;
    char str[1100];
    int a[26]={0};
    scanf("%s",str);
    str[strlen(str)]=str[strlen(str)-1]+1;
    for(i=0;i<strlen(str)-1;i++)
    {
        if(str[i]==str[i+1]||abs(str[i]-str[i+1])=='a'-'A')
        {
            if(str[i]-'A'<26)
                a[str[i]-'A']++;
            else
                a[str[i]-'a']++; 
        }
        else
        {
            if(str[i]-'A'<26)
                a[str[i]-'A']++;
            else
                a[str[i]-'a']++; 
            if(str[i]-'A'<26)
            {    
                printf("(%c,%d)",str[i],a[str[i]-'A']);
                a[str[i]-'A']=0;
            }
            else
            {
                printf("(%c,%d)",str[i]-'a'+'A',a[str[i]-'a']);
                a[str[i]-'a']=0;
            }
        }
    }
    
}
int main()
{
	int i, num, j, length = 0, pos = 0;
	char a[1000];
	a[0] = 0;
	cin >> a + 1;
	for (i = 1; a[i] !=0; i++)
	{
		if (a[i] > 96 && a[i] < 123)
		{
			a[i] = a[i] - 32;
		}
	}
	for (i = 2; a[i] !='\0'; i++)
	{
		if (a[i] != a[i-1])
		{
			length = i - 1 - pos;
			pos = i - 1;
			cout << "(" << a[i-1] << "," << length <<")";
		}
	}
	cout << "(" << a[i-1] << "," << i - 1 -pos  <<")";
	return 0;
}
int main()
{
	char words[1002]={0};
	cin.getline(words,1001,'\n');
	int i,j; int count={0};
	for(i=0;words[i]!=0;i++)
	{  
		count=0;
		for(j=i;words[j]!=0;j++)
		{
			
			if(words[j]==words[i]||words[j]==(words[i]+'A'-'a')||words[i]==(words[j]+'A'-'a'))
				count++;
			else
			{
				
				break;
			}
		}
		i=j-1;
		//cout<<i<<endl;
		if(words[i]<='z'&&words[i]>='a')
			words[i]+='A'-'a';
		cout<<"("<<words[i]<<","<<count<<")";
	}
	return 0;
}
int main()
{
	int len=0,counts=0,k=0,i;
	char str[1001],c; 
	cin>>str;
	for(len=0;str[len]!='\0';len++);
	while(k<len)
	{
		c=str[k];
		if(c>='a')
			c=c-32;
		for(i=0;i<len;i++)
		{
			if(str[k+i]==c||str[k+i]==(c+32))
				counts++;
			else
				break;
		}
		cout<<'('<<c<<','<<counts<<')';
		k=k+i;counts=0;
	}
	cout<<endl;
	cin.get();cin.get();
	return 0;
}
/*
 * homework3.cpp
 *
 *  Created on: 2012-12-4
 *      Author: Lixurong
 */

int main()
{
	char a[1005];
	cin >> a;
	for( int i=0; i<strlen(a); i++ )
	{
		if(a[i]<='z' && a[i]>='a')
			a[i]+='A'-'a';
	}
	char b=a[0];
	int t=0;
	for( int i=0; i<=strlen(a); i++ )
	{
		if( b==a[i] )
			t++;
		else
		{
			cout << "(" << b << "," << t << ")";
			t=1;
			b=a[i];
		}
	}
	return 0;
}
main()
{
      char str[1000];
      gets(str);
      int i,k;
      for(i=0;str[i]!='\0';i=i+1)
      {
      if(str[i]>='a')
      str[i]=str[i]-32;
      }
     
      i=0;
      k=1;
      for(;str[i]!='\0';)
      {
      if(str[i]==str[i+1])
      {
      k=k+1;
      i=i+1;
      }
      else
      {
      printf("(%c,%d)",str[i],k);
      i=i+1;
      k=1;
      }
      
      
      }

}
main()
{
       char a[1000];
       int n,i,j,count;
       gets(a);
       n=strlen(a);
       for(i=0;i<n;i++)
       {
         if(a[i]<='z'&&a[i]>='a')
           a[i]=a[i]-'a'+'A';
           }
           i=0;
           for(;i<n;)
         {
           count=1;
           for(j=i+1;;j++)
           if(a[j]==a[i])
           count++;
           else
           {
               printf("(%c,%d)",a[i],count);
           i=j;
           break;
           }
           }
           getchar();
           getchar();
}
int main()
{
    int x,y,i,len,j,num=0;
    char str[1200]={'\0'},a;
    cin>>str;
    len=strlen(str);
    for(i=0;i<len;i++)
    {
        if(str[i]>=97)    str[i]=str[i]-32;
    }
    num=1;
    for(i=0;i<len;i++)
    {
       if(str[i]==str[i+1])   num++;
       else
       {
           cout<<'('<<str[i]<<','<<num<<')';
           num=1;
       }
    }
    
    
    
    
    return 0;
}
int main()
 {
     int i,n;
        n=1;
     char str[1001];
     scanf("%s",str);
     for(i=0;i<strlen(str);i++)
     {
        if(str[i]>='a'&&str[i]<='z')
        {
           str[i]=str[i]-'a'+'A';
        }
     }
     i=0;
     while(i<strlen(str))
     {
        if(str[i]==str[i+1])
        {
           n=n+1;
        }
        else
        {
           printf("(%c,%d)",str[i],n);
           n=1;
        }
        i++;
     }
 }
int main ()
{
	int i, flag = 1, j;
	unsigned long len;
	char am[100];
	cin.getline(am,100);
	len = strlen(am);
	for (i = 0; i < len; i++)
	{
		if (am[i] >= 'a' )
			am[i] = am[i] - 32;
	}
	for (i = 0; i < len; i++)
	{
		for (j = i + 1; j < len; j++)
		{
			if (am[j] == am[i] || fabs(am[j] - am[i]) == 32)
			{
				flag++;
			}
			else 
				break;
		}
		
		cout <<"("<<am[i]<<","<<flag<<")";
		flag = 1;
		i = j - 1;

	}



	return 0;
}
int main()
{
	char str[1001];
	cin >>str;
	int sum =1,i;
	for(i = 0; str[i]!='\0';i++)
	{
		if('a'<=str[i]&&str[i]<='z')
			str[i]=str[i]-32;
	}
	for(i = 1; str[i]!='\0';i++)
	{
		if(str[i] == str[i -1])
			sum++;
		else 
		{
			cout <<'('<<str[i -1]<<','<<sum<<')';
			sum =1;
		}
	}
	cout <<'('<<str[i -1]<<','<<sum<<')'<<endl;
	return 0;
}
int main()
{
	char str[1000 + 1];
	int i,j;
	int len;
	int flag = 0;
	int sum = 0;
	cin >> str;
	len = strlen(str);
	
	for( i =0, j = 1; j <= len - 1; j++)
	{
		
		if(str[i] >= 'a')
			str[i] = str[i] - 32;
		if(str[j] >= 'a')
			str[j] = str[j] - 32;

		if( str[i] == str[j] )
			sum++;
	    if(str[i] != str[j] || (j == len - 1 && str[i] == str[j]) ) 
		{
			flag = 1;
			printf("(%c,%d)",str[i],sum + 1);
			i = j;
			sum = 0;
		}
		
		if(j == len - 1 && sum == 0 && str[j] != str[j-1])
		{
			printf("(%c,%d)",str[j],sum + 1);
		}
	}
	if(len == 1)
	{
		if(str[0] >= 'a')
			str[0] = str[0] - 32;
		printf("(%c,%d)",str[i],sum+1);
	}

	return 0;
}
int main()
{
    int i,n;
    char l[1000];
    scanf("%s",l);
    n=1;
    for(i=0;l[i]!='\0';i++)
   {
  if(l[i]==l[i+1]||l[i]==l[i+1]-'a'+'A'||l[i]==l[i+1]-'A'+'a')
    {if(l[i]>='A'&&l[i]<='Z')
       {if(l[i]==l[i+1]||l[i]==l[i+1]-'a'+'A')
       n=n+1;}
    else
       { if(l[i]==l[i+1]||l[i]==l[i+1]-'A'+'a')
       n=n+1;}
    }
    else
      { if(l[i]>='A'&&l[i]<='Z')
       { printf("(%c,%d)",l[i],n);
        n=1;}
       if(l[i]>='a'&&l[i]<='z')
       {l[i]=l[i]-'a'+'A';
       printf("(%c,%d)",l[i],n);
        n=1;}}
   }
}
int main()
{
	char c[1010]={0};
	gets (c);
	int len=strlen (c);
	for(int i=0;i<len;i++)
	    c[i]=toupper(c[i]);
	for(int i=0;i<len;i++)
		{
		int count=1;
		for(int j=i+1;j<len;j++)
	        if(c[j]!=c[i])
	           break;
	        else	
	           count++;
	    printf("(%c,%d)",c[i],count);
	    i=i+count-1;
		}        
}
int main ()
{
   char c[1000];
   gets (c);
   int k=strlen (c);
   for (int s=0;s<k;s++)
     if (c[s]>='a'&&c[s]<='z')   c[s]=c[s]-'a'+'A';   
   int a[1000]={0},p=0;
   char C[1000];
   for (int i=0,j;i<k;i++)
     {  
       if (i>0&&c[i]==c[i-1]) continue;
       else 
         for (j=i;j<k;j++)
         {
          if (c[i]==c[j])
             {
               a[p]++;
               C[p]=c[i];
             }
          else 
             {
               p++;
               break;  
             }
         }   
     }
    for (int q=0;q<=p;q++) 
       printf ("(%c,%d)",C[q],a[q]);         
}