semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	void change(char x[1000],int l);
	char c[1000];
	int i=0,j,k=1;
	do
	{
		c[i]=getchar();
		i++;
	}while(c[i-1]>30);
	change(c,i);
	for(j=0;j<i-1;j++)
	{
		if(c[j]==c[j+1])
				k++;
		else 
		{
			printf("(%c,%d)",c[j],k);
			k=1;
		}
	}
	return 0;
}
void change(char x[1000],int l)
{
	int n;
	for(n=0;n<l;n++)
		if(x[n]<121&x[n]>96)x[n]=x[n]-32;
}
int main()
{
	int i;
	char line[1001];
	cin >>line;
	for (i=0;i<strlen(line);i++)
	{
		if (line[i]>=97 && line[i]<=122)
			line[i]=line[i]-32;
	}                    //??????????????
	int count[1000]={0},num=0;  //count??????,num?????????
    char temp,ch[1000];    //temp???????????,ch????????
	ch[0]=temp=line[0];
	count[0]=1;
	for (i=1;i<strlen(line);i++)
	{
		if (line[i]==temp)
			count[num]++;   //??????????1
		else
		{
			ch[num+1]=line[i];
			count[num+1]=1;
			num++;
			temp=line[i];
		}                 //??????????????
	}    
	for (i=0;i<=num;i++)
		cout <<'('<<ch[i]<<','<<count[i]<<')';  //??
	cout <<endl;
	return 0;
}
int main()
{
	char a[1100];
	cin>>a;
	char c[1100];
	int n,p=0;
	int b[1100];
	n=strlen(a);
	for(int i=0;i<n;i++)
		b[i]=1;
	for(int i=0;i<n;i++)
	{
		if(a[i]-'a'>=0)
			a[i]=a[i]-32;
	}
	for(int i=1;i<n;i++)
	{
		if(a[i]==a[i-1])
		{b[p]++;c[p]=a[i];}
		else
		{p++;c[p]=a[i];}
	}
	c[0]=a[0];
	for(int j=0;j<=p;j++)
		cout<<"("<<c[j]<<","<<b[j]<<")";
	return 0;
}
int main()
{
	char a[1002];
	gets(a);
	int suma,i;
    suma=strlen(a);
    for(i=0;i<suma;i++)
    {
    	if(a[i]>='a' && a[i]<='z')
    	{
    		a[i]=a[i]-'a'+'A';
    	}
    }
    char b ;
    b=a[0];
    int c=0;
    for(i=0;i<suma;i++)
    {
    	if(a[i]==b)
    	{
    		c++;
    	} 
    	else
    	{
    		printf("(%c,%d)",b,c);
    		b=a[i];
    		c=1;
    	}
    }
    printf("(%c,%d)",b,c);
}
char str[1000];
int len;

int operation(int start)
{
	int i = start;
	int count = 0;
	for( ; str[i] == str[start]; i++)
		count++;
	cout << "(" << str[start] << "," << count << ")";

	return count;
}

int main()
{
	int i;
	cin >> str;
	len = strlen(str);
	for(i = 0; i < len; i++)
	{
		if(str[i] > 90)
			str[i] -= 32;
	}
	for(i = 0; i < len; i++)
		i += operation(i) - 1;
	cout <<endl;

	return 0;
}
main()
{
      char c[1200],m;
      scanf("%s",c);
      int i,j,a = 0,b,l;
      l = strlen(c);
      if(c[0]>='a' && c[0]<='z')
          m = c[0] -'a'+'A';
      else
         m = c[0];
      a=1;
    
      for(i=1;i<l;i++)
      {
          if(c[i] == c[i-1] || c[i] == c[i-1]+32  || c[i] == c[i-1] -32)
              a++;
          else
           {
             printf("(%c,%d)",m,a);
             a = 0;
             if(c[i]>='a' && c[i]<='z')
             m = c[i] -'a'+'A';
             else m = c[i];
             a++;
           }
      }
      printf("(%c,%d)",m,a);
      getchar();
      getchar();
      getchar();
      getchar();
}
struct word
{
	char a;
	int b;
}w[1000];

int main()
{
	int i,k,num=0,temp,t=0;
	char c[1111];
	cin>>c;
	k=strlen(c);
	for(i=0;i<k;i++)
		if(c[i]>='a')
			c[i]=c[i]-32;
	i=0;
	temp=c[0];
	while(i<k)
	{
		if(c[i]==temp)
			num++;
		if(c[i]!=temp)
		{
			w[t].a=c[i-1];
			w[t].b=num;
			num=1;
			temp=c[i];
			t++;
		}
		i++;
	}
	w[t].a=c[i-1];
	w[t].b=num;
	for(i=0;i<=t;i++)
		cout<<'('<<w[i].a<<','<<w[i].b<<')';
	return 0;
}
int main ()
{
   char a[5000] , t;
   int la , i , j;
   scanf ( "%s" , a );
   la = strlen ( a );
   for ( i = 0 ; i < la ; i ++ )
    if ( 'a' <= a[i] && a[i] <= 'z' )
     a[i] = a[i] - 'a' + 'A';
   for ( i = 0 ; i < la ; )
    {
     t = a[i++] , j = 1;
     for ( ; a[i] == t ; i ++ , j ++ );
     printf ( "(%c,%d)" , t , j );
    }
  // getchar (); getchar ();
   return 0;
}
main()
{
    char a[1000];
    gets (a);
    int temp=1;
    int i;
    for (i=0;i<=strlen(a)-1;i++)
        if (((a[i]>='a')&&(a[i]<='z')))
        {a[i]+='A'-'a';}
    if(strlen(a)==1)
    printf("(%c,%d)",a[0],1);
    else
    {
    for (i=1;i<=strlen(a)-1;i++)
    {
        if (a[i]==a[i-1])
        temp++;
        else
        {
            printf("(%c,%d)",a[i-1],temp);
            temp=1;
        }
        if (a[i+1]==0)
            printf("(%c,%d)",a[i],temp);
    }
    }
    return 0;
}
int main()
{
    char a[1000],b[10];
    int num[10]={1,1,1,1,1,1,1,1,1,1};
    scanf("%s",&a);
    int i=0;
    while (a[i]!='\0')
    {
          if (a[i]>='a' && a[i]<='z')
          a[i]=a[i]-'a'+'A';
          i++;
    }
    int j=0;
    b[j]=a[0];
    for (int i=1;i<=999;i++)
    {
        if (a[i]==a[i-1])
        num[j]++;
        else
        {
            j++;
            b[j]=a[i];
        }
        if (a[i]=='\0')
        break;
    }
    for (int i=0;i<=j-1;i++)
    printf("(%c,%d)",b[i],num[i]);
    printf("\n");

}
int main()
{
    char st[1010], ch;
    int i, j, k;

    gets(st);
    for(i=0; st[i]!='\0'; i++)
    {
        if(st[i]>='a' && st[i]<='z')
            st[i]=st[i]-'a'+'A';
    }
    ch = st[0];
    k = 1;
    for(i=1; st[i]!='\0'; i++)
    {
        if(st[i] != ch)
        {
            printf("(%c,%d)", ch, k);
            ch = st[i];
            k = 1;
        }
        else
        {
            k++;
        }
    }
    printf("(%c,%d)\n", ch, k);
    return 0;
}
main()
{
char b[1001];
gets(b);
int n,i;
n=1;
for(i=0;b[i]!='\0';i++)
{
if((b[i]>='a')&&(b[i]<='z'))
b[i]=b[i]+'A'-'a';
else
b[i]=b[i];
}
if(b[1]!=b[0])
printf("(%c,%d)",b[0],n);
for(i=1;b[i]!='\0';i++)
{
if(b[i]==b[i-1])
{
n=n+1;
if((b[i]!=b[i+1])||(b[i+1]=='\0'))
{
printf("(%c,%d)",b[i],n);
n=1;
}
}
else
{
    if((b[i]!=b[i+1])||(b[i+1]=='\0'))
    printf("(%c,%d)",b[i],n);
    else
    continue;
}
}
}
int main()
{ 
    {
        char a[500];
        char b[100];
        int c[100];
        cin.getline(a, 500);
        int len = strlen(a);
        b[0] = a[0];
        c[0] = 1;
        for (int i = 1; i < 100; i++)
            c[i] = 0;
        int j = 0; 
        for (int i = 1; i < len; i++)
        {
            if (a[i] != b[j] && a[i] != b[j] + 32 && a[j] != b[j] - 32)
            {   
               j++;
               b[j] = a[i];
               c[j]++;
            }
            else if (a[i] == b[j] || a[i] == b[j] + 32 || a[i] == b[j] - 32)
            {
                 c[j]++;
            }
        }
        for (int i = 0; i <= j; i++)
            if (b[i] >= 'a' && b[i] <= 'z')
               b[i] -= 32;
        for (int i = 0; i <= j; i++)
            cout << '(' << b[i] << ',' << c[i] << ')';
        cout << endl;
    }
    
    char a;
    while (cin.get(a))
    {
        cin.get();
        if (a != '?') 
           break;
        cout << "?" << endl; 
        char a[500];
        char b[100];
        int c[100];
        cin.getline(a, 500);
        int len = strlen(a);
        b[0] = a[0];
        c[0] = 1;
        for (int i = 1; i < 100; i++)
            c[i] = 0;
        int j = 0; 
        for (int i = 1; i < len; i++)
        {
            if (a[i] != b[j] && a[i] != b[j] + 32 && a[j] != b[j] - 32)
            {   
               j++;
               b[j] = a[i];
               c[j]++;
            }
            else if (a[i] == b[j] || a[i] == b[j] + 32 || a[i] == b[j] - 32)
            {
                 c[j]++;
            }
        }
        for (int i = 0; i <= j; i++)
            if (b[i] >= 'a' && b[i] <= 'z')
               b[i] -= 32;
        for (int i = 0; i <= j; i++)
            cout << '(' << b[i] << ',' << c[i] << ')';
        cout << endl;
    }
    

    return 0;
}
//********************************
//*???2.cpp   **
//*?????? 1200012768 **
//*???2012.12.18  **
//*?????????  **
//********************************
int main()
{
	char ch[1001];
	int c1 = 1, c2 = 1, i, temp = -1;
	cin >> ch;
	int len = strlen(ch);
	int num[len];
	for (i = 0; i < len; i++)
		if (ch[i] <= 'Z')
			num[i] = ch[i] - 'A';
		else
			num[i] = ch[i] - 'a';
	for (i = 0; i < len; i++)
	{
		if (temp == -1)
		{
			temp = num[i];
			if (i == len - 1)
				cout << "(" << (char)(temp + 65)<< "," << c1 << ")";
		}
		else if (num[i] == temp)	
		{
			c1++;
			if (i == len - 1)
				cout << "(" << (char)(temp + 65)<< "," << c1 << ")";
		}
		else
		{
			cout << "(" << (char)(temp + 65)<< "," << c1 << ")";
			c1 = 1, temp = num[i];
			if (i == len - 1)
				cout << "(" << (char)(temp + 65)<< "," << c1 << ")";
		}
	}
	return 0;
}
main()
{
      char a,str[1000];
      int i,k;
      gets(str);
      a = str[0];
      k = 1;
      
      if(('a' <= a) && (a <= 'z'))
      a = a + 'A' - 'a';
      
      for(i = 1;str[i] != '\0';i++)
      {
          
          if((str[i] == a) || (str[i] == a - 'A' + 'a'))    
          k++;
          else
          {
              printf("(%c,%d)",a,k);
              a = str[i];
              if(('a' <= a) && (a <= 'z'))
              a = a + 'A' - 'a';
              k = 1;
          }
      }
      printf("(%c,%d)",a,k);

}
int main()
{
	int i,len,s,t=0;
	char a[1000];
	gets(a);
	len=strlen(a);
	s=a[0];
	for(i=0;i<len;i++)
	{
		
		

		if(s==a[i]||s==a[i]+32||s==a[i]-32)
			t++;
		else 
		{
			if(s>'Z')
				printf("(%c,%d)",s-32,t);
			else
					printf("(%c,%d)",s,t);
			s=a[i];
			t=1;
		}
		
	}
	if(s>'Z')
				printf("(%c,%d)",s-32,t);
			else
					printf("(%c,%d)",s,t);

return 0;

}
int main ()
{
	char a[1001],b[1001];
	char tmp[1000];
	int cnt[1000];
	int i,j,len;
	cin>>a;
	len=strlen(a);
	memset(tmp,'#',sizeof(tmp));
	memset(cnt,0,sizeof(cnt));
	for(i=0;i<len;i++)
	{
		if(a[i]>='A' && a[i]<='Z')
			b[i]=a[i];
		else
			b[i]=a[i]-'a'+'A';
	}
	b[len]='\0';
	j=0;
	for(i=0;i<len;i++)
	{
		if(i==0)
		{
			tmp[j]=b[i];
			cnt[j]++;
		}
		else
		{
			if(b[i]==tmp[j])
			{
				cnt[j]++;

			}
			else
			{
				j++;
				tmp[j]=b[i];
				cnt[j]++;
			}
		}
	}
	for(i=0;i<=j;i++)
	{
		cout<<'('<<tmp[i]<<','<<cnt[i]<<')';
	}
	return 0;
}
main()
{
     char str[1001];
     int a=1,i;
     scanf("%s",str);
     for(i=0;i<strlen(str);i++)
     {
         if(str[i]<='z' && str[i]>='a') str[i]=str[i]-'a'+'A';                     
     }
     for(i=1;i<=strlen(str);i++)
     {
         if(str[i]==str[i-1]) a++;
         else {printf("(%c,%d)",str[i-1],a);a=1;}            
     }
}
char change(char ch)
{
	if (ch >= 'a' && ch <= 'z')
		return ch - 'a' + 'A';
	else
		return ch;
}

int main()
{
	int i, num = 1, len;
	char str[100];
	cin.getline(str, 100);
	len = strlen(str);
	cout << "(" << change(str[0]) << ",";
	for(i = 1; i < len; i++)
	{
		if(change(str[i]) == change(str[i - 1]))
			num++;
		else
		{
			cout << num << ")(" << change(str[i]) << ",";
			num = 1;
		}
	}
	cout << num << ")" << endl;
	/*if(change(str[len - 1]) == change(str[len - 2]))
		cout << num + 1 << ")" << endl;
	else
		cout << num << ")(" << change(str[len - 1]) << ",1)" << endl;*/
	return 0;
}
main()
{
      int i,l,d[1000],k=0;
      char a[1000],c[1000];
      scanf("%s",a);
      l=strlen(a);
      for(i=0;i<l;i++)
      {
           if(a[i]>='a')
           a[i]=a[i]-'a'+'A';
           if(i==0)
           {
           c[k]=a[i];
           d[k]=1;
           }
           else
           {
               if(a[i]==a[i-1])
               d[k]++;
               if(a[i]!=a[i-1])
               {
                   k++;
                   d[k]=1;
                   c[k]=a[i];
               }
           }
      }
      for(i=0;i<=k;i++)
      {
          printf("(%c,%d)",c[i],d[i]);
      }
      getchar();
      getchar();
      getchar();
}
main()
{
      int i,j,n;
      int count;
      char a[1000];
      gets(a);
      n=strlen(a);
      for(i=0;i<n;i++)
      {
                      if(a[i]>='a'&&a[i]<='z')
                      a[i]=a[i]-'a'+'A';
      }
     
      
     
               count=0;
            for(j=0;j<n;j++)
                      {  
                                      if(a[j]==a[0])
                                      count++;
                                      else  if(a[j]!=a[0])
                                      break;   
                      }
                      printf("(%c,%d)",a[0],count);   
      
      for(i=1;i<n;i++)
      {
                      count=0;
                      if(a[i]!=a[i-1])
                                      
                      
                      {
                      for(j=i;j<n;j++)
                      {
                                      if(a[i]!=a[j])
                                      break;   
                                      if(a[i]==a[j])
                                      count++;
                                      
                      }
                      printf("(%c,%d)",a[i],count);
                      }
      }
      getchar();
      getchar();
      getchar();
       getchar();
      getchar();
      getchar();
}
int main()
{
 char str[1000];
 scanf("%s",str);
 int sum,i;
 sum=1;
 for(i=1;i<=strlen(str);i++)
 { if(str[i]==str[i-1]||(str[i]-'a')==(str[i-1]-'A')||(str[i]-'A')==(str[i-1]-'a'))
   sum++;
   else
   { if(str[i-1]>='a')
   printf("(%c,%d)",str[i-1]-32,sum);
    else printf("(%c,%d)",str[i-1],sum);
    sum=1;
   }

}
 
}
int main()
{
	char a[1000] , judge;
	int num=0;
	while (cin.getline(a , 1000 , '\n'))
	{
	  num=0;
	  int len;
	  len=strlen(a);
	  if (a[0]>=65 && a[0]<=90)
	      judge=a[0];
	  else judge=(char)(a[0]-32);
	  if (len==1) cout<<"("<<judge<<",1)";
	  else 
	  {
	  for (int i=0;i<len;i++)
	  {
	   if ((a[i]==judge || a[i]==(char)(judge+32)) && i!=len-1)
		   num=num+1;
	   else 
	   {
		   if (a[i]!=judge && i!=len-1)
		   {
	         if (a[i-1]>=65 && a[i-1]<=90)
		        cout<<"("<<a[i-1]<<","<<num<<")";
		     else cout<<"("<<(char)(a[i-1]-32)<<","<<num<<")";
		     num=1;
		     if (a[i]>=65 && a[i]<=90)
	           judge=a[i];
	         else judge=(char)(a[i]-32);
		   }
		   else if (a[i]==judge && i==len-1)
		   {
		      if (a[i]>=65 && a[i]<=90)
		        cout<<"("<<a[i]<<","<<num+1<<")";
		     else cout<<"("<<(char)(a[i]-32)<<","<<num+1<<")";
		   }
		   else 
		   {
		      if (a[i-1]>=65 && a[i-1]<=90)
		        cout<<"("<<a[i-1]<<","<<num<<")";
		     else cout<<"("<<(char)(a[i-1]-32)<<","<<num<<")";
			 if (a[i]>=65 && a[i]<=90)
		        cout<<"("<<a[i]<<",1)";
		     else cout<<"("<<(char)(a[i]-32)<<",1)";
		   }
	   }
	  }
	  }
	  cout<<endl;
	}
	return 0;
}
int main()
{
	int num=0;
	char st[1100];
	cin>>st;
	for(int i=0;i<strlen(st);i++)
	{
		if(st[i]>='a'&&st[i]<='z')
			st[i]=st[i]+'A'-'a';
	}
	for(int i=0;i<strlen(st);i++)
	{
		if(st[i]==st[i+1])
		{
			num++;
		}
		else
		{
			cout<<"("<<st[i]<<","<<num+1<<")";
			num=0;
		}
	}
	return 0;
}
int main()
{
    char word[1000] ;
    cin>> word ;
    int length = strlen(word );
    for (int i = 0 ; i< length ; i++)
    {
        if (word[i] >= 'a' && word[i] <= 'z' )
            word[i]+=('A' - 'a') ; // ???????
    }
    char temp = word [0] ;
    int counts = 1 ;
    for (int i = 1 ; i< length ; i++)
    {
        if (word[i] != temp )
        {
            printf("(%c,%d)" ,temp ,counts );
            temp = word[i] ;
            counts = 1 ;
        }
        else
        {
            counts++;
        }
    }
    printf("(%c,%d)" ,temp ,counts );
    return 0;
}
int main(){
char a[1000];
int c,i,c1,c2,d=1;
scanf("%s",a);
c=strlen(a)-1;
for(i=0;i<=c;i++){
  c1=a[i];
  c2=a[i+1];
  if(c1>90)
	  c1=c1-32;
  if(c2>90)
	  c2=c2-32;
  if(c1==c2)
	  d++;
  else{
  printf("(%c,%d)",c1,d);
  d=1;
  }
}
return 0;}
int main()
{
	int i, j=0, len=0, count[1000]={0};
	char str[1000], copy[1000]={'a'};
	cin.getline(str,10001,'\n');
	len=strlen(str);
	for(i=0;i<len;i++)
		if(str[i]>='a'&&str[i]<='z')
			str[i]=str[i]+'A'-'a';
	for(i=0;i<len;i++)
	{
		if(i==0)
		{
			copy[j]=str[i];
			count[j]=1;
		}
		if(str[i]==str[i-1]&&i!=0)
			count[j]++;
		if(str[i]!=str[i+1])
		{
			copy[++j]=str[i+1];
			count[j]=1;
		}
	}
	for(i=0;i<j;i++)
		cout<<'('<<copy[i]<<','<<count[i]<<')';
	cout<<endl;
	return 0;
}
main(){
char a[1001];
char k[2];
k[1]='\0';
scanf("%s",a);
int i;
for(i=0;a[i]!='\0';i++){
if((a[i]>='a')&&(a[i]<='z'))
a[i]=a[i]+'A'-'a';
else
continue;
}
i=0;
int j=1;
while(a[i]!='\0'){


if(a[i]==a[i+1])
{
j++;
i++;
}


else{

k[0]=a[i];
printf("(%s,%d)",k,j);

i++;
j=1;
}

}
}
void main()
{
	char str[1000], letter[1000]={'\0'};
	int i, j, times[1000];
	for(i=0; i<1000; i++)
		times[i]=1;
	scanf("%s",str);
	for(i=0, j=0; str[i]!='\0'; i++)
	{
		if(str[i]==str[i+1] || str[i]==str[i+1]+32 || str[i]==str[i+1]-32)
		{
			times[j]++;
		}
		else
		{
			if(str[i]>=65 && str[i]<=90)
				letter[j]=str[i];
			else
				letter[j]=str[i]-32;
			j++;
		}
	}
	for(j=0; letter[j]!='\0'; j++)
		printf("(%c,%d)",letter[j],times[j]);
	printf("\n");
}
int main()
{
	char a[1000]={'\0'};
	cin>>a;
	int i=0;
	while (a[i]!='\0')
	{
		if(a[i]>='a'&&a[i]<='z')
			a[i]=a[i]-32;
		i++;
	}
	i=1;
	int times=1;
	while (a[i]!='\0')
	{
		if (a[i]==a[i-1])
		times++;
		else 
		{
			cout<<'('<<a[i-1]<<','<<times<<')';
			times=1;
		}
		i++;
	}
	cout<<'('<<a[i-1]<<','<<times<<')';
	return 0;
}
int main()
{
int x,y=0;
char a[999];
gets(a);
for(;a[y]!='\0';y++)
{
x=1;
for(;;y++)
{
if(a[y]==a[y+1]||(a[y]-a[y+1])==('A'-'a')||(a[y+1]-a[y])==('A'-'a'))
x++;
else
break;
}
if(a[y]<'Z')
printf("(%c,%d)",a[y],x);
else
printf("(%c,%d)",(a[y]+'A'-'a'),x);
}

}
main()
{  
   char s[1010];
   scanf("%s",s);
   char x;
   int c=1;
   int l=strlen(s);
   int i;
   for(i=0;i<l;i++)
   {
      if('a'<=s[i]&&s[i]<='z')   s[i]=s[i]-'a'+'A';                  
   }
   for(i=0;i<l-1;i++)
   {
      x=s[i];
      if(s[i]==s[i+1]&&i==l-2)  {c++;printf("(%c,%d)",x,c);}
      if(s[i]==s[i+1]) c++;
      else {printf("(%c,%d)",x,c);c=1;}               
   }
   if(s[l-2]!=s[l-1])  printf("(%c,1)",s[l-1]);
}
char f(char x)
{
    
     if(x>='a')
     return x-'a'+'A';
     else
     return x;
     }
int main( )
{
int  a,b,i;
char str[1000];
scanf("%s", str);
a=f(str[0]);
b=1;

for(i = 1; i < strlen(str); i++)
{
      if (a==f(str[i]))
      b++;
      else
      {
          printf("(%c,%d)",a,b);
          a=f(str[i]);
          b=1;
      }
      }
printf("(%c,%d)",a,b);


}
int main()
{
 char str[1000];
 int i,j,k,t,m;
 char c,x;
 for(i=0;;i++)
 {
  scanf("%c",&str[i]);
  if(str[i]=='\n')
   break;
 }
 x=str[0];
 m=x;
 if(m>=97)
 {
	 m=m-32;
	 x=m;
 }
 t=0;
for (j=0;j<i;j++)
{
 c=str[j];
 k=c;
if(k>=97)
 {
  k=k-32;
  c=k;
}
 if(c==x)
 {
	 t=t+1;
 }
 if(c!=x)
 {
	 printf("(%c,%d)",x,t);
	 t=1;
	 x=c;
 }
}
printf("(%c,%d)",x,t);
return 0;
}
main()
{
      char a[1000];
      scanf("%s",a);
      int i=0,j=0,k=0,m;
      while(a[i]!='\0')
      {
             if(a[i]>='a'&&a[i]<='z')
             a[i]=a[i]-'a'+'A';
             i++;
      }
      while(a[j]!='\0')
      {
                       m=1;
                       for(k=j;a[k]!='\0';k++)
                       {
                                              if(a[k]==a[k+1])
                                              m=m+1;
                                              else
                                              {printf("(%c,%d)",a[k],m);
                                              j=k+1;
                                              break;}
                       }
                       
      }
            
      printf("\n");       
      
}
char UpperCase(char chr)
{
	if (chr>='a'&&chr<='z')
		return 'A'-'a'+chr;
	else return chr;
}
int main()
{
	char str[1000];
	int count=1;
	cin>>str;
	char chr=str[0];
	for (int i=1;str[i]!=0;i++)
	{
		if (UpperCase(chr)==UpperCase(str[i]))
			count++;
		else
		{
			printf("(%c,%d)",UpperCase(chr),count);
			count=1;
		}

		chr=str[i];

	}
	printf("(%c,%d)",UpperCase(chr),count);

	return 0;
}
/*
 * 2.cpp
 *
 *  Created on: 2011-12-31
 *      Author: 2011
 */
int main(){
	char a[1005]={0};
	int b[1005]={0},c[1005]={0},d[1005]={0};
	int i,j=0,temp,lenA;
	cin.getline(a,1000);
	lenA=strlen(a);
	for(i=0;i<lenA;i++){
		if((a[i]-'A')>=0&&(a[i]-'A')<=26)
			b[i]=a[i]-'A';
		if((a[i]-'a')>=0&&(a[i]-'a')<=26)
			b[i]=a[i]-'a';
	}
	temp=b[0];
	c[0]=b[0];
	d[0]=1;
	for(i=1;i<lenA;i++){
		if(b[i]==temp)
			d[j]++;
		else{
			temp=b[i];
			j++;
			c[j]=b[i];
			d[j]=1;
		}
	}
	for(i=0;i<=j;i++)
		cout<<'('<<(char)(c[i]+'A')<<','<<d[i]<<')';
	return 0;
}
int main()
{
	char str[1000],*p,temp;
	int i,count=0;
	p=str;
	cin>>str;
	temp=*str;
	if(temp>'Z')
		temp-=32;
	count++;
	while(*++p!=0)
	{
		if(*p==temp||*p-32==temp)
			count++;
		else
		{
			printf("(%c,%d)",temp,count);
			count=1;
			temp=*p;
			if(temp>'Z')
				temp-=32;
		}
	}
	printf("(%c,%d)",temp,count);
	return 0;
}
int main()
{
	char a[1100];
	gets(a);
	int i,j,k,count=0;
	char b=0;
	i=0;
	while(1)
	{
		if(i>strlen(a))break;
		if(a[i]<='z'&&a[i]>='a')a[i]+='A'-'a';
		if(b==0){b=a[i];count=1;i++;continue;}
		if(a[i]==b)
			count++;
		else
		{
				
				cout<<"("<<b<<","<<count<<")";b=a[i];count=1;
			}
		i++;
	}

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

       if(s[i+1]==s[i]||s[i+1]==s[i]-32)
			{
				sum++;
			continue;
			}
			else {
				printf("(%c,%d)",s[i]-32,sum);
			     sum=1;
				 continue;
			     }
		}
	}
		return 0;
}
main()
{
      char a[1010],m=0;
      int i,j;
      scanf("%s",a);
      for(i=0;i<999;)
      {
                         for(j=i;j<999;j++)
                         {
                                           if(a[i]==a[j]||a[i]==a[j]+'A'-'a'||a[i]==a[j]-'A'+'a')
                                           m++;
                                           else
                                           break;}
                                           if(a[i]>='a'&&a[i]<='z')
                                           a[i]=a[i]+'A'-'a';
                                           printf("(%c,%d)",a[i],m);
                                           i=i+m;
                                           m=0;
                                           if(a[i]==0)
                                           break;
                                           }
                                           
                                           }
int main()
{
char a[1000];
	int e;
	int d[1000];
	for(int i=0;i<1000;i++)
	{
		scanf("%c",&a[i]);
		if(a[i]=='\n')
		{
			e=i;break;
		}
	}
	int k=0;
	for(int l=0;l<e;l++)
		d[l]=1;
	for(int j=1;j<e;j++)
	{
		if((a[j]==a[j-1]+'A'-'a')||(a[j]==a[j-1]-'A'+'a')||a[j]==a[j-1])
			d[k]++;
		else 
		{
			if(a[j-1]>='a')
				a[j-1]+='A'-'a';
			printf("(%c,%d)",a[j-1],d[k]);
			k++;
		}
	}
	if(a[e-1]>='a')
				a[e-1]+='A'-'a';
			printf("(%c,%d)",a[e-1],d[k]);
	return 0;
}
/*
 * word zip.cpp
 * ??:??????
 *  Created on: 2013-1-13
 *      Author: ???
 */



int main()
{
	char words[2000];
	cin.getline(words,sizeof(words));
	char *p=NULL,*q=NULL;
	p=words;
	q=words;
	while(1)
	{
		if(*q=='\0')
		{
			if(*p>=97)
			    *p=*p-32;
			cout<<"("<<*p<<','<<(q-p)<<")";
			cout<<endl;
			break;
		}
		if(*p==*q||fabs(*p-*q)==32)
			q++;
		else{
			if(*p>=97)
				*p=*p-32;
			cout<<"("<<*p<<','<<(q-p)<<")";
			p=q;}
	}
    return 0;
}
void change(char *a)
{
	char *p = a;
	while(*p != '\0')
	{
		if(*p >= 'a' && *p <= 'z')
			*p += 'A' - 'a';
		p++;
	}
	return;
}
int main()
{
	char str[1001];
	cin >> str;
	int count = 1;
	change(str);
	char *p = str;
	while(*p != '\0')
	{
		if(*p == *(p+1))
		{
			count++;
		}
		else
		{
			printf("(%c,%d)",*p,count);
			count = 1;
		}
		p++;
	}
	return 0;
}
int main()
{   
	char a[1001],c;
	int sum=1,i;
    
   while(cin >> a)
   {
    if(strlen(a)==1)
	{   
		c=a[0];
		if( (c>='a')&&(c<='z') )
					c=c-'a'+'A';
				   cout<< '('<<c<<','<<1<<')'<< endl;
		continue;
	}
	for( i=0;i<strlen(a);i++)
	{
		
		if( i>0 )
		{
			if( (a[i-1]==a[i])||(a[i-1]==a[i]-'A'+'a')||(a[i-1]==a[i]-'a'+'A') )
			{
				sum++;
				if(i==strlen(a)-1)
				{
					c=a[i-1];
				   if( (c>='a')&&(c<='z') )
					c=c-'a'+'A';
				   cout<< '('<<c<<','<<sum<<')';
				}
			}
			else
			{
				c=a[i-1];
				if( (c>='a')&&(c<='z') )
					c=c-'a'+'A';
				cout<< '('<<c<<','<<sum<<')';
				sum=1;
				if(i==strlen(a)-1)
				{
					c=a[i];
					if( (c>='a')&&(c<='z') )
					c=c-'a'+'A';
				cout<< '('<<c<<','<<sum<<')';
				}

			}
		}
	}
    cout << endl;
   }
	return 0;
}