semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	char st[1000],temp;
	scanf("%s",st);
	int t,len=strlen(st);
	int i,x=0;
	for(t=0;t<len;t++)if(st[t]>='a'&&st[t]<='z')st[t]=st[t]-'a'+'A';
	for(t=0;x<len;t++){
		temp=st[x];
		for(i=0;;i++){
			if(st[x+i]!=st[x+i+1])break;
		}
		printf("(%c,%d)",st[x],i+1);
		x=x+i+1;
	}
	return 0;
}
main()
{
      int i,count=0,j,l;            
      char string[1000];
      scanf("%s",string);
      l=strlen(string);
      for(i=0;i<l;i++)
      {
            if(string[i]>='a'&&string[i]<='z')
             string[i]=string[i]-'a'+'A';
      }
      char s;
      s = string[0];
      for(i=0;i<l;i++)
      {
          if(string[i]==s)
             count++;
          else
          {
             printf("(%c,%d)",s,count);
             s = string[i];
             count=1;
          }
      }
      printf("(%c,%d)",s,count);                                                              
      getchar();
      getchar();
}
int main()
{
    char str[1000];
    gets(str);
    int i;
    for(i=0;i<strlen(str);i++)
    {
        if(str[i]<'a')
        str[i]=tolower(str[i]);
    }
    int a=1;
    for(i=0;i<strlen(str);i++)
    {
        if(str[i]!=str[i+1])
        {
        printf("(%c,%d)",str[i]-'a'+'A',a);
        a=1;
        }
        else a++;
    }

}
int main()
{
	char str[1000];
	scanf("%s",str);

	//?????????
{
	int i=0;
	while (str[i]!='\0')
	{
		if (str[i]>='a'&&str[i]<='z')
		{
			str[i]=str[i]-'a'+'A';
		}
		i++;
	}
}
	//samechar??????samecount?????
	char samechar[1000];
	int samecount[1000]={0};
	char tmp;
	tmp=str[0];
	//jishu?samechar?????
	int jishu=0;
	int i1;
	for(i1=0;str[i1]!='\0';i1++)
	{
		if(tmp==str[i1])
		{
			samechar[jishu]=tmp;
			samecount[jishu]++;
		}
		else
		{
			tmp=str[i1];
			jishu++;
			samechar[jishu]=tmp;
			samecount[jishu]++;
		}
	}
	//????
	int i2;
	for(i2=0;i2<=jishu;i2++)
	{
		printf("(%c,%d)",samechar[i2],samecount[i2]);
	}
	return 0;
}
main()
{
  char c[1001],b;
  int j,a=1;
  scanf("%s",c);
  for(j=1;;j++)
  {
    if(c[j]==c[j-1] && c[j]!='\0' || c[j]==c[j-1]+32 || c[j]==c[j-1]-32)
    {
       a++;
    }
    if(c[j]!=c[j-1] && c[j]!='\0' && c[j]!=c[j-1]+32 && c[j]!=c[j-1]-32)
    {
      if(c[j-1]>='A' && c[j-1]<='Z')
        printf("(%c,%d)",c[j-1],a);
      if(c[j-1]>='a' && c[j-1]<='z')
        printf("(%c,%d)",c[j-1]+'A'-'a',a);
      a=1;    
    } 
    if(c[j]=='\0')
    {
      if(c[j-1]>='A' && c[j-1]<='Z')
        printf("(%c,%d)",c[j-1],a);
      if(c[j-1]>='a' && c[j-1]<='z')
        printf("(%c,%d)",c[j-1]+'A'-'a',a);
      break;
    }
  }                

}
int main()
{
    char str[200];
    cin >> str;
    int len = strlen(str);
    int i,j=0;
    for (i = 0;i < len; i++)
    {
        if (str[i] >='a' && str[i] <= 'z' )
        {
                   str[i] = str[i] - ('a' - 'A');
        }
    }
    char letter[200]={' '};
    int length[200];
    for (i=0;i<=199;i++)
    {
        length[i]=1;
    }
    letter[0] = str[0];
    for (i = 1;i < len; i++)
    {
        if (str[i] == str[i-1] )
        {
            length[j]++;
        }
        else
        {
            j++;
            letter[j]= str[i];
        }
    }
    int kinds = j;
                     
    for(i=0;i<=j;i++)
    {
        cout << "(" << letter[i] << "," << length[i] << ")" ;
    }
    cout << endl;    return 0;
}
//*************************************************
//***?????????***
//***??????***
//***???2013.1.13***
//*************************************************
int main ()
{
	char a[1001],t;
	int num,i = 0;
	cin >> a;
	t = a[0];
	num = 1;
	while(a[i++] != '\0')
	{
		if (a[i] == a[i - 1] || fabs(a[i] - a[i - 1]) == 'a' - 'A')
		{
			num ++;
		}
		else
		{
			if (a[i - 1] >= 'a' && a[i - 1] <= 'z')
				a[i - 1] += 'A' - 'a';
			cout << "(" << a[i - 1] << "," << num << ")";
			num = 1;
			t = a[i]; 
		}
	}
	cout << endl;
	return 0;
}
main()
{
     char a[1000],b[1000];
     int c[1000],j=0;                                                             /*b???? c????????? j???j?*/
     b[0]=0;
     c[1]=0;
     scanf("%s",a);
     for(int i=0;;i++)
     {
          if(a[i]=='\0') 
          {    printf("(%c,%d)",b[j],c[j]);
               break;
          }
          if(a[i]==b[j]||a[i]==b[j]+32) c[j]=c[j]+1;
          else
          {
          if(j>0) printf("(%c,%d)",b[j],c[j]);
          j=j+1;
          c[j]=1;
          if(a[i]<=90) b[j]=a[i];
          else b[j]=a[i]-32;
          }                      
     }
               
}
main()
{
char a[1001],t[1001];
scanf("%s",a);
int b[1001],i,j,k,h,p=0;
b[0]=1;
k=strlen(a);
for(h=0;h<=k-1;h++)
{
    if(a[h]>='a'&&a[h]<='z') a[h]=a[h]+('A'-'a');
}
if (k==1) printf("(%c,1)",a[0]);
else
{
for(i=0;i<=k-2;i++)
{
 t[p]=a[i]  ;
 if(a[i]==a[i+1])  
 {
     b[p]++;
 }
 else 
 {
     p++;
     t[p]=a[i+1];
     b[p]=1;
 }
}
for(j=0;j<=p;j++) printf("(%c,%d)",t[j],b[j]);
}
}
int main()
{
	int m,k;

	int i,j;

	int count=1;

	char me[1001];
	int mem[1001]; 

	char s[1001];
	cin.getline(s,sizeof(s));

	memset(mem,0,sizeof(mem));

	j=1;
	me[1]=s[0];



	for(i=0;s[i]!=0;i++)
	{

		if(s[i]==me[j] || s[i]-'a'==me[j]-'A'|| s[i]-'A'==me[j]-'a')
		{
			mem[j]++;
		}
		else{
			j++;
		me[j]=s[i];
		mem[j]++;
		count++;
		}
	}

	for(i=1;i<=count;i++)
	{
		if(me[i]>='a' && me[i]<='z')
		{
			me[i]=me[i]-'a'+'A';
		}
	}

	
	for(i=1;i<=count;i++)
	{
		cout<<"("<<me[i]<<","<<mem[i]<<")";
	}



		
	
	
	
	
	




	return 0;
}
int main()
{
	char a[1000], c;
	int n = 0;
	cin >> a;
	if (a[0] >= 'a' && a[0] <= 'z')
		c = a[0] - 'a' + 'A';
	else
		c = a[0];
	cout << "(" << c << ","; 
	for (int i = 0; a[i] != '\0'; i++)
	{
		if (a[i] == c || a[i] == c - 'A' + 'a')
		{
			n++;
		}
		else
		{
			if (a[0] >= 'a' && a[0] <= 'z')
				c = a[i] - 'a' + 'A';
			else
				c = a[i];
			cout << n << ")(" << c << ",";
			n = 1;
		}
	}
	cout << n << ")" << endl;
	return 0;
}
int main()
{
	
	int i,j,a,e,f,d,h;
    int k,m,n;
	int y[100][100];
	char x[10000];
	a=1;
	scanf("%s",x);
	for(i=0;x[i];i++){
		
			if(x[i]<='z'&&x[i]>='a')
				x[i]=x[i]+'A'-'a';
	}
	for(i=0;x[i];i++){
		if(x[i]==x[i+1])a++;
		else {
			printf("(%c,%d)",x[i],a);
			a=1;
		}
		}
	return 0;
}
int main()
{
	char a[1001];
	scanf ("%s",a);
	int i;
	for (i=0;i<strlen(a);i++)
	{
		if (a[i]>='a'&&a[i]<='z')
			a[i]=a[i]-'a'+'A';
	}
	int t=1;
	for (i=0;i<strlen(a);i++)
	{
		if (a[i]==a[i+1])
		{
			t++;
		}
		else
		{
			printf ("(%c,%d)",a[i],t);
			t=1;
		}
	}

}
int main()
{
	char a[1001], t;
	int i, count = 1;
	cin >> a;
	for (i = 0; i < strlen(a); i++)
	{
	
		t = a[i];
		if (a[i + 1] == t || a[i + 1] - t == 'A' - 'a' || a[i + 1] - t == 'a' - 'A')
			count++;
		else
		{
			if (t > 'Z')
				cout << "(" << (char)(t - 'a' + 'A');
			else
				cout << "(" << (char)t;
			cout <<  "," << count << ")" ;
			count = 1;
		}
	}
	return 0;
}
main()
{
      char a[1000];
      int l; 
      scanf("%s",a);
      l=strlen(a);
      int t=1; 
      for(int i=0;i<l;i++)
      {
              if(a[i]==a[i+1]||(a[i]+'a'-'A')==(a[i+1])||(a[i]+'A'-'a')==(a[i+1]))
              t++;
              else
              {
                  if(a[i]>='A'&&a[i]<='Z') 
                  printf("(%c,%d)",a[i],t); 
                  else
                  printf("(%c,%d)",a[i]-'a'+'A',t); 
                  t=1; 
              } 
      } 
      getchar();getchar(); 
      
}
int main()
{
	char s[10000];
	char a[10000];
	int i,j,k,l,m,n;
	int b[10000];
	char c[10000],d;
	l=0;
	scanf("%s",s);
	for(i=0;(d=s[i])!='\0';i++)
	{
		l=l+1;

	}
	
	n=1;k=0;j=0;
for(i=0;(d=s[i])!='\0';i++)
	{
	
		if(s[i]==s[i+1]||s[i]==s[i+1]-32||s[i]==s[i+1]+32)
		{n=n+1;if(s[i]>=97){a[j]=s[i]-32;}else a[j]=s[i];b[j]=n;}
		else {if(s[i+1]!='\0')
			
		{k=k+1;if(s[i]>=97){a[j]=s[i]-32;}else a[j]=s[i];b[j]=n;j=j+1;n=1;}
		else
		{k=k+1;if(s[i]>=97){a[j]=s[i]-32;}else a[j]=s[i];b[j]=n;j=j+1;}
		}
	}
for(i=0;i<k;i++)
{printf("(%c,%d)",a[i],b[i]);}

}
main()
{
	int n,length,count=0,i;
	char str[1001],cube;
	scanf("%s",str);
	length=strlen(str);
	for(i=0;i<length;i++)
	{
		if(str[i]>='a'&&str[i]<='z')
		str[i]=str[i]+'A'-'a';
	}
	cube=str[0];
	for(i=0;i<=length;i++)
	{
		if(str[i]==cube)
		count++;
		if(str[i]!=cube)
		{
			printf("(%c,%d)",cube,count);
			cube=str[i];
			count=1;
			
		}
	}
	
}
int main()
{
	int num;
	char a[1001], temp;
	cin.getline(a, 1001);
	char *p = a;
	while (*p != '\0')
	{
		num = 0;
		if (*p >= 65 && *p <= 90)
		{
			temp = *p;
			cout << "(" << *p << ",";
		}
		else if (*p >= 97 && *p <= 122)
		{
			*p = *p - 32;
			temp = *p;
			cout << "(" << *p << ",";
		}
		p++;
		while (*p == temp || *p == temp + 32)
		{
		    num++;
			p++;
		}
		cout << num + 1 << ")";
	}

	return 0;
}
int main()
{
    char n[1000];
    int x[1000],a,b,c,i,j,k,t=0;
    scanf("%s",n);
    i=0;
    for(j=0;j<1000;j++)
    {
                       x[j]=0;
                    if(n[j]!=0)i++;
                    else break;
    }
    for(j=0;j<i;j++)
    {
                    if((n[j]>='a')&&(n[j]<='z'))
                    n[j]=n[j]-32;
    }
    j=0;
    for(j=0;j<i;j++)
    {
                    while(n[j]==n[j+1])
                    {
                                       for(k=j;k<i;k++)
                                       n[k]=n[k+1];
                                       i--;
                                       x[t]++;
                    }
                    t++;
    }
    for(j=0;j<t;j++)
                    printf("(%c,%d)",n[j],x[j]+1);
}
main()
{
      int l,i,j=0,c[26]={0};
      char a[10000],b[10000];
      scanf("%s",a);
      l=strlen(a);
      if(a[0]>='a'&&a[0]<='z')
      a[0]=a[0]+'A'-'a';
      b[0]=a[0];
      c[0]=1;
      for(i=1;i<l;i++)
      {
                      if(a[i]>='a'&&a[i]<='z')
                      a[i]=a[i]+'A'-'a';
                      if(a[i]==a[i-1])
                      c[j]=c[j]+1;
                      else
                      {
                              printf("(%c,%d)",b[j],c[j]);
                              j=j+1;
                              b[j]=a[i];
                              c[j]=1;
                      }
      }
      printf("(%c,%d)",b[j],c[j]);
      getchar();
      getchar();
}
int main()
{
	char str[1002] = {'\0'};
	int counts = 1;
	for (int i = 0; str[i - 1] != '\n'; i ++)
	{
		str[i] = getchar();
		if (str[i] >= 'a' && str[i] <= 'z')
			str[i] = str[i] - 'a' + 'A';
	}
	for (int i = 0; str[i] != '\n'; i ++)
	{
		if (str[i] == str[i+1])
			counts ++;
		else
		{
			cout << "(" << str[i] << ',' << counts << ')';
			counts = 1;
		}
	}
	return 0;
}
char str[1001],letter[27],temp;
int i,start[27],l,s=1,op='A'-'a',
    opl='a'-'A';
int main()
{

    cin>>str;
    l=strlen(str);
    letter[1]=str[0];
    temp=letter[1];
    start[1]=0;
    for(i=0;i<l;i++)
    {
        if(str[i]==temp||str[i]==temp+op||str[i]==temp+opl)
        continue;
        else
        {
            s++;
            letter[s]=str[i];
            start[s]=i;
            temp=letter[s];
            }
        }
    for(i=1;i<=s;i++)
    {

        if(letter[i]>='a'&&letter[i]<='z')
           letter[i]=letter[i]+op;
        if(i<s)
        {
            cout<<"(";
        cout<<letter[i];
        cout<<",";
        cout<<start[i+1]-start[i];
        cout<<")";
        }
        if(i==s)
        {
            cout<<"(";
        cout<<letter[i];
        cout<<",";
        cout<<l-start[i];
        cout<<")";
        }
        }


    return 0;
}
main()
{
     int i,j,a=1;
     char str[1010];
      char str2[1010];
     scanf("%s",str);
     for (int j=0;;j++)
    { if (str[j]=='\0') { str2[j]='\0';break;}
     if (str[j]>='a' && str[j]<='z') str2[j]=str[j]-'a'+'A';
     else str2[j]=str[j];}
     
     for (i=0;i<strlen(str2);i++)
     {  
        
         if (str2[i]==str2[i+1])
         a++;
         else { printf("(%c,%d)",str2[i],a);a=1; continue;}
     }
         
       
    
}
main()
{
      char a[1001],c=1,i,n;
      gets(a);
      for(n=0;a[n]!='\0';n++)
      {
                               if(a[n]>='a'&&a[n]<='z')
                               a[n]+='A'-'a';
                               else
                               a[n]=a[n];
                               }
      for(i=0;a[i]!='\0';i++)
      {
                             if(a[i+1]==a[i])
                             c++;
                             else
                             {
                             printf("(%c,%d)",a[i],c);
                             c=1;
                             }
                             }
                             }
int main()
{
	int count = 1, flag = 1;
	char a, last = '0';
	while ((a = cin.get()) != '\n')
	{
		flag = 1;
		if (last >= 'a' && last <= 'z')
			if (a == last || a == last - 32)
			{
				count++;
				flag = 0;
			}
		if (last >= 'A' && last <= 'Z')
			if (a == last || a == last + 32)
			{
				count++;
				flag = 0;
			}
		if (flag)
		{
			if (last != '0')
				cout << count << ")";
			switch (a)
			{
			case 'a': cout << "(A,"; break;
			case 'A': cout << "(A,"; break;
			case 'b': cout << "(B,"; break;
			case 'B': cout << "(B,"; break;
			case 'c': cout << "(C,"; break;
			case 'C': cout << "(C,"; break;
			case 'd': cout << "(D,"; break;
			case 'D': cout << "(D,"; break;
			case 'e': cout << "(E,"; break;
			case 'E': cout << "(E,"; break;
			case 'f': cout << "(F,"; break;
			case 'F': cout << "(F,"; break;
			case 'g': cout << "(G,"; break;
			case 'G': cout << "(G,"; break;
			case 'h': cout << "(H,"; break;
			case 'H': cout << "(H,"; break;
			case 'i': cout << "(I,"; break;
			case 'I': cout << "(I,"; break;
			case 'j': cout << "(J,"; break;
			case 'J': cout << "(J,"; break;
			case 'k': cout << "(K,"; break;
			case 'K': cout << "(K,"; break;
			case 'l': cout << "(L,"; break;
			case 'L': cout << "(L,"; break;
			case 'm': cout << "(M,"; break;
			case 'M': cout << "(M,"; break;
			case 'n': cout << "(N,"; break;
			case 'N': cout << "(N,"; break;
			case 'o': cout << "(O,"; break;
			case 'O': cout << "(O,"; break;
			case 'p': cout << "(P,"; break;
			case 'P': cout << "(P,"; break;
			case 'q': cout << "(Q,"; break;
			case 'Q': cout << "(Q,"; break;
			case 'r': cout << "(R,"; break;
			case 'R': cout << "(R,"; break;
			case 's': cout << "(S,"; break;
			case 'S': cout << "(S,"; break;
			case 't': cout << "(T,"; break;
			case 'T': cout << "(T,"; break;
			case 'u': cout << "(U,"; break;
			case 'U': cout << "(U,"; break;
			case 'v': cout << "(V,"; break;
			case 'V': cout << "(V,"; break;
			case 'w': cout << "(W,"; break;
			case 'W': cout << "(W,"; break;
			case 'x': cout << "(X,"; break;
			case 'X': cout << "(X,"; break;
			case 'y': cout << "(Y,"; break;
			case 'Y': cout << "(Y,"; break;
			case 'z': cout << "(Z,"; break;
			case 'Z': cout << "(Z,"; break;
			}
			last = a;
			count = 1;
		}
	}
	cout << count << ")" << endl;
	return 0;
}
int main()
{
	char s[5000];
	int n=0;
	cin.getline(s,1500);
	for(int i=0;i<strlen(s);i++)
	{
		if(i==0)
		{
			cout<<"(";
			if(s[i]>='a')
				s[i]=s[i]-'a'+'A';
			cout<<s[i]<<",";
			n++;
		}
		else{
			if(s[i]>='a')
				s[i]=s[i]-'a'+'A';
			if(s[i]==s[i-1])
				n++;
			else
			{
				cout<<n<<")("<<s[i]<<",";
				n=1;
			}
		}
	}
	cout<<n<<")";
	return 0;
}
main()
{
    char a[1000];
    char b[1000];
    scanf("%s",a);
    int i,m,k,p;
    m='A'-'a';
    for(i=0;a[i]!='\0';i++)
    {
        if(a[i]>='a'&& a[i]<='z')
        b[i]=a[i]+m;
        else
        b[i]=a[i];
    }
    b[i]='\0';
    p=1;
    for(k=0;b[k+1]!='\0';k++)
    {
        if(b[k]==b[k+1])
        {
            p=p+1;
        }
        else
        {
            printf("(%c,%d)",b[k],p);
            p=1;
        }
    }
    printf("(%c,%d)",b[k],p);
}
main ()
{
  char a[10000];
  gets (a);
  int i;
  for (i=0;a[i]!='\0';i++)
  {
    if (a[i]<='z'&&a[i]>='a')
    {
	  a[i]=a[i]+('A'-'a');	
	}
  }
    int count =1;
     for (i=0;a[i]!='\0';i++)
     {
       if (a[i+1]==a[i])
      {
			 count++;
	  }
	   else
	   {
			printf ("(%c,%d)",a[i],count);
			count=1;
	   }
	 }
  	
	
	
	
	
	
	
	
	
}
/*
 * ??????.cpp
 *
 *  Created on: 2013-1-11
 *      Author: ??
 *     ??????????????????????????????????????????????????????
 *     ????????????????????????????"AAABBBBCBB"??????(A,3)(B,4)(C,1)(B,2)????
 *     ??????????????????????
                   ???????????????????????????
 *
 */
int main()
{
	int i,s=0;
	char str[1100],t;
	cin>>str;
	for(i=0;i<strlen(str);i++)
	{
		if(str[i]>96)str[i]-=32;
		if(str[i]==t)s++;
		else{
			if(i!=0)cout<<s<<')';
			cout<<'('<<str[i]<<',';
			t=str[i];
			s=1;
		}
	}
	cout<<s<<')'<<endl;;
	return 0;
}
/*
 * ??????.cpp
 *
 *  Created on: 2011-12-31
 *      Author: ???
 */

int main() {
	char a[1000];
	cin >> a;
	int i = 0, j, len = strlen(a);
	while (i < len) {
		if (a[i] >= 'a')
			a[i] = a[i] - 32;
		j = i;
		while (true) {
			if (a[i + 1] >= 'a')
				a[i + 1] = a[i + 1] - 32;
			if (a[i + 1] == a[j])
				i++;
			else
				break;
		}
		cout << "(" << a[j] << "," << i - j + 1 << ")";
		i++;
	}
	return 0;
}
main()
{
      char s[1000];
      int l,i,j=1;
      gets(s);
      l=strlen(s);
      for(i=0;i<l;i++)
      {
      if(s[i+1]==s[i]||s[i+1]==s[i]+32||s[i+1]==s[i]-32)
      j++;
      else
      {
          if(s[i]>='a'&&s[i]<='z')
          {printf("(%c,%d)",s[i]-32,j);
          j=1;}
          else
          {printf("(%c,%d)",s[i],j);
          j=1;}
      }
      }
      getchar();
      getchar();
      return 0;
      }
int main()
{
  char str[1001];
  int i,j=0;
  scanf("%s",str);
  for (i=0;str[i]!='\0';i++)
  {
    if ((str[i]==str[i+1])||(str[i]==str[i+1]-'a'+'A')||(str[i]==str[i+1]+'a'-'A'))
      j++;
    else
      {if (str[i]>='Z') printf("(%c,%d)",(str[i]-'a'+'A'),j+1);
         else  printf("(%c,%d)",str[i],j+1);
       j=0;
      }
  }
  return 0;
}
main()
{
      char a[1001];
      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);
                     }
       }      
}
main()
{
      char in[1000];
      int i,num=1,a,b;
      scanf("%s",in);
      for(i=0;in[i]!='\0';i++)
      {
           a=in[i];
           b=in[i+1];
           if(a==b || a-b==32 ||a-b==-32) num++;             
           else
           {
               if(in[i]<91) printf("(%c,%d)",in[i],num);
               else printf("(%c,%d)",in[i]-32,num);
               num=1;
           }
      }
   
}
int main()
{
char a[10000];
cin>>a;
int size=strlen(a);
int i,k;
for(i=0;i<size;i++)
if(a[i]>'Z')
a[i]=a[i]-('a'-'A');
for(i=0;i<size;)
{
   int j=0;
   for(k=0;k<size-i;k++)
   {
   if(a[i+k+1]==a[i+k])
	   j++;

   else if( a[i+k+1]=='\0')
   {
   j++;
   cout<<'('<<a[i+k]<<','<<j<<')';
   i=size;
   }
   else
   {
        cout<<'('<<a[i+k]<<','<<j+1<<')';
        i=i+j+1;
        break;
   }
   }
}
return 0;
}
int ss(char a[1001],int n)
{
	int b,i=0,c;
	char d;
	b=a[n];
	c=a[n];
	while(a[n]!='\0'&&(b==c||(b-32)==c||b==(c-32)))
	{
		i++;
		n++;
		c=a[n];
	}
	if(b>=97)
	{
		d=b-32;
		cout<<"("<<d<<","<<i<<")";
	}
	else
	{
		d=b;
		cout<<"("<<d<<","<<i<<")";
	}
	return i;
}
int main()
{
	char a[1001];
	int b,i=0,m=0,o;
	cin>>a;
	while(a[m]!='\0')
	{
		m++;
	}
	while(i<m)
	{
		o=ss(a,i);
		i=i+o;
	}
	
	return 0;
}
int main()
{
    char string[1001];
    gets(string);
    int n;
    n=strlen(string);
    int i;
    int m=1;
    for(i=0;i<n;i++)
    {
                    if(string[i]>=97)
                    string[i]=string[i]-32;
    }
    for(i=0;i<n;i++)
    {
                    if(string[i]==string[i+1])
                    {
                        m++;
                    }
                    else
                    {
                        
                         printf("(%c,%d)", string[i], m);
                         m=1;
                    }
    }
    
    return 0;
}
void str(char s[])
{
    int i;
	for(i=0;s[i];i++)
	{
	    if(('a'<=s[i])&&(s[i]<='z'))
			s[i]=s[i]-'a'+'A';
	}
	return ;
}

int main()
{
    char s[1001];
	int i,j,n;

	scanf("%s",s);

	str(s);

	for(i=0;s[i];i=j)
	{
	
		    n=1;
	        for(j=i+1;s[j]==s[i];j++)
			{
		        n++;
			    s[j]='a';
			}
		    printf("(%c,%d)",s[i],n);
		
	}

	return 0;
}
int main()
{
	char str[1000];
	int count = 0, i;
	cin >> str;
	for (i = 0; str[i] != '\0'; i++)
	{
		if (str[i] == str[i + 1] || str[i] == str[i + 1] + 'a' - 'A' || str[i] == str[i + 1] + 'A' - 'a')
			count++;
		else
		{
			count++;
			if (str[i] >= 'A' && str[i] <= 'Z')
				cout << "(" << str[i] << "," << count << ")";
			else
			{
				str[i] += 'A' - 'a';
				cout << "(" << str[i] << "," << count << ")";
			}
			count = 0;
		}
	}
	cout << endl;
	return 0;
}
int main()
{
	char x[1000];
	int i,changdu,num=0;
	scanf("%s",x);
	changdu=strlen(x);
	for(i=0;i<changdu;i++)
	{
		if(x[i]>='a'&&x[i]<='z')
			x[i]-=32;
	}
	if(changdu==1)printf("(%c,%d)",x[0],1);
	for(i=0;i<changdu-1;i++)
	{
		if(x[i]==x[i+1])num++;
		if(x[i]!=x[i+1])
		{
			printf("(%c,%d)",x[i],++num);
			num=0;
		}
		if((x[i]==x[i+1])&&(i==changdu-2))printf("(%c,%d)",x[i],++num);
		if((x[i]!=x[i+1])&&(i==changdu-2))printf("(%c,%d)",x[i+1],1);
	}
	printf("\n");
	return 0;
}
int main()
{
	char ch[1001];
	int num[1001] = {0};
	int i, j = 0, nlen;
	cin.getline(ch, 1001);
	nlen = strlen(ch);
	for (i = 0; i < nlen; i++)
	{
		if ((ch[i] == ch[i + 1]) || ((ch[i] - ch[i + 1]) == ('a' - 'A')) || ((ch[i] - ch[i + 1]) == ('A' - 'a')))
			num[j]++;
		else
		{
			num[j]++;
			j++;
		}
	} 
	for (i = 0, j = 0; i < 1001; i++)
	{
		if (num[i] != 0)
		{
			j = j + num[i];
			cout << '(' ;
			if (ch[ j - num[i]] >= 'A' && ch[j - num[i]] <= 'Z')
				cout << ch[j - num[i]];
			else if (ch[ j - num[i]] >= 'a' && ch[ j - num[i]] <= 'z')
				cout <<(char)(ch[ j - num[i]] - 'a' + 'A');
			cout << ',' << num[i] << ')';
		}
	}
	return 0;
}
main()
{     
      char s[1001];
      char c; 
      int i;
      int n=1;
      gets(s);
      for(i=0;(s[i])!='\0';i++)
      {
       if (s[i]>='a'&&s[i]<='z')
       s[i]=s[i]-'a'+'A';
      }
      for(i=0;(s[i])!='\0';i++)
      {
        if (s[i]==s[i+1])
           n=n+1;
        else 
        {
        printf("(%c,%d)",s[i],n);
        n=1;
        }
      }
}
int main()
{
char s[1000];
int a[1000],i;
scanf("%s",s);
for(i=0;i<strlen(s);i++)
if(s[i]>='a'&&s[i]<='z')
s[i]=s[i]-'a'+'A';
for(i=0;i<strlen(s);i++)
a[i]=1;
for(i=1;i<strlen(s);i++)
if(s[i]==s[i-1])
a[i]=a[i-1]+1;
for(i=0;i<strlen(s);i++)
if(s[i]!=s[i+1])
printf("(%c,%d)",s[i],a[i]);
}
int main(){
	int n=1,i,j,m=0;
	char k[1001],y[27]="abcdefghijklmnopqrstuvwxyz",z[27]="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	int s[26];
	scanf("%s",k);
    for(i=0;i<strlen(k);i++){
    for(j=0;j<26;j++){
    if(k[i]==y[j])
    k[i]=z[j];}}
	for(i=0;i<strlen(k);i=i+n){
    printf("(%c,",k[i]);
    for(n=0;n<(strlen(k)-i);n++){
    if(k[i+n]==k[i])
    m++;
    else
    break;}
    printf("%d)",m);
    m=0;}
}
int main()
{
    char s[1001];
    cin>>s;
    int len=strlen(s);
    int i=0,j,k;
    int flag=0;
    while(i<len)
    {
        flag=0;
        while(1)
        {
            if(s[i]==s[i+1]||s[i]==s[i+1]+32||s[i+1]==s[i]+32)   {flag++;i++;}      //??????????
            else
            {
                cout<<"("<<(char)(s[i]<90?s[i]:s[i]-32)<<","<<flag+1<<")";       //???????????????????
                i++;
                break;
            }
        }
    }
    return 0;
}