semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
char l(char c);

int main()
{
    char s[1001];
    cin>>s;
    char c=l(s[0]);
    int m=1;
    for (int i=1;i<=strlen(s);i++)
    {
    if (c==l(s[i]))
    m++;
    else
    {cout<<'('<<c<<','<<m<<')';
    c=l(s[i]);m=1;
    }
    }
    cout<<endl;
    
}


char l(char c)
{
     if (c>='a'&&c<='z')
     return c+'A'-'a';
     else
     return c;
}
main()
{ int j,n;
      char str1[1001],str2[1001];
 gets(str1);
 for(j=0;;j++) 
 {if(str1[j]=='\0')
          { str2[j]='\0'; break;}
  if(str1[j]>='a'&&str1[j]<='z')
  str2[j]=str1[j]-'a'+'A';
  else str2[j]=str1[j];}

 for(j=0;;j=j+n)
 {if(str1[j]=='\0')
          { str2[j]='\0'; break;}
 
  for(n=0;;n++)
 if(str2[j]!=str2[j+n])
  {printf("(%c,%d)",str2[j],n);
 break;}}

   
}
int main()
{
	char s[1000]={" "};
	int n,i=0,j,p=1;
	gets(s);
	n=strlen(s);
	while(i<n)
	{
		if(s[i+1]==s[i]||s[i+1]==s[i]-32||s[i+1]==s[i]+32)
		{
			p++;
			i++;
		}
		else
		{
			if(s[i]>='a'&&s[i]<='z')
				s[i]=s[i]-32;
			
			
			printf("(%c,%d)",s[i],p);
			i++;
			p=1;
		}
	}return 0;
}
int main()
{
    char a[1001];
    gets(a);
    int t=1;
    int l=strlen(a);
    for(int j=1;j<=l;j++)
    {
       if(a[j]!=a[j-1] && a[j]-a[j-1]!= 'A'-'a' && a[j]-a[j-1]!= 'a'-'A')
       {
             if(a[j-1]>='a')
                  a[j-1]=a[j-1]+'Z'-'z';
             printf("(%c,%d)",a[j-1],t);
             t=1;
       }
       else
       t++;
    }
}
main()
{
      char c;
      char x;
      int n=0;
      c=getchar();
      n=1;
      while(1)
      {
              if(c>='a'&&c<='z') c=c-32;
              x=getchar();
              if(x>='a'&&x<='z') x=x-32;
              if(x=='\n')
              {
                         printf("(%c,%d)",c,n);
                         break;
              }
              if(x==c) n++; 
              else
              {
                  printf("(%c,%d)",c,n);
                  c=x;
                  n=1;
              }
      }
}
int main()
{
	char str[1005];
	char temp;
	int length=1;
	int i=1;
	cin>>str;
	int n;
	n=strlen(str);
	for(i=1;i<n;i++)
	{
		if((str[i]-str[i-1]==0)||(str[i]-str[i-1]==32)||(str[i]-str[i-1]==-32))	//????????????????????????????
		{
			length++;
		}
		else
		{
			if(str[i-1]<95)	//??
				cout<<"("<<str[i-1]<<","<<length<<")";
			else	//??
			{
				temp=str[i-1]-32;
				cout<<"("<<temp<<","<<length<<")";
			}
			length=1;
		}
	}
	//????????????1???1?
	if(str[n-1]<95)	//??
		cout<<"("<<str[n-1]<<","<<length<<")";
	else	//??
	{
		temp=str[n-1]-32;
		cout<<"("<<temp<<","<<length<<")";
	}
	return 0;
}
main()
{
  char s[1000];
  int i,n=1;
  gets(s);
  if (s[0]>='a') s[0]+='A'-'a';
  for (i=1;s[i];i++)
  {
    if (s[i]>='a') s[i]+='A'-'a';
    if (s[i]==s[i-1]) n++;
    else
    {
      printf("(%c,%d)",s[i-1],n);
      n=1;
    }
  }
  printf("(%c,%d)",s[i-1],n);
}
char before[1050]={0},after[1050]={0};  //??????????? 
int record[1050]={0};  //?????????????? 

int main()
{int i,j,k;
 cin>>before;
 i=j=0; 
 while(before[i]!='\0')  //????????? 
   {after[j]=before[i]; //???? 
    for(;(before[i]==before[i+1])||(before[i]==before[i+1]+'A'-'a')||(before[i]==before[i+1]-'A'+'a');i++) record[j]++;  //????????? 
    record[j]++;
    i++; 
    j++; //??????????? 
    } 
 for(i=0;after[i]!='\0';i++) //????
  {if(after[i]>='a'&&after[i]<='z') after[i]=after[i]-'a'+'A';  //?????
   cout<<'('<<after[i]<<','<<record[i]<<')'; 
   } 
return 0;
 }
//??? ???????? ?????   

int main()
{
char str[1001];
int i,j,k,time=1;
scanf("%s",str);
if(str[0]>=97)
str[0]-=32;
for(i=1;str[i];i++)
{    
     if(str[i]>=97)
     str[i]-=32;
     if(str[i]==str[i-1])
     {time++;}
     else
     {printf("(%c,%d)",str[i-1],time);time=1;}
}
printf("(%c,%d)",str[i-1],time);

return 0;
}
char   da[30]={"ABCDEFGHIJKLMNOPQRSTUVWXYZ"};
char xiao[30]={"abcdefghijklmnopqrstuvwxyz"};
char a[1000];
int num(char p)
{
	int m;
	for(m = 0;m < 26;m++)
		if(p == da[m] || p==xiao[m])
			return m;
		return 1000;
}
int main()
{
	
	cin >> a;
	int i,j,len=1;
	for(i = 0; a[i] != '\0' ;i++)
	{
		for(j = i+1;;j++)
		{
			if(num(a[j])==num(a[i]))
				len++;
			else
				break;

		}
		cout << "(" << da[num(a[i])] << ","<<len<<")";
		len = 1;
		i = j - 1;
	}
	return 0;
}
struct letters
{
	char name;
    int time;
};
void main()
{
	int l,i,k=0;char t;
	char seq[1001]={0};
	struct letters let[100]={0};
	gets(seq);
    l=strlen(seq);
	let[0].name=(seq[0]>90)?seq[0]-32:seq[0];
	let[0].time++;
	for(i=1;i<l;i++)
	{
		t=seq[i];
		if(t>90)
			t-=32;
        if(t==seq[i-1]||t==seq[i-1]-32)
	        let[k].time++;
		else
		{
			k++;
			let[k].name=t;
	        let[k].time++;
		}

	}
    for(i=0;i<=k;i++)
	    printf("(%c,%d)",let[i].name,let[i].time);
	
}
int main()
{
  char a[1100];
  cin.getline(a,1100);
  int i,j=0,k=0,l;
  l=strlen(a);
  int b[1100]={0};
  char c[1100]={0};
  c[0]=a[0];
  char t=a[0];
  b[0]=1;
  for(i=1;i<l;i++)
  {
    if((a[i]==t)||((a[i]-'a')==(t-'A'))||((a[i]-'A')==(t-'a')))
    {
       b[k]++;
    }
    else
    {
      k++;
      b[k]=1;
      c[k]=a[i];
      t=a[i];
    }
  }
  for(i=0;i<=k;i++)
  {
    cout << "(" ;
    if(c[i]>96)
    {
      int m=c[i]-'a';
      char t=m+'A';
      cout << t << ",";
    }
    else
    {
      cout << c[i] << ",";
    }
    cout << b[i] << ")";
  }
  cin.get();cin.get();cin.get();
  return 0;
}
int main()
{
	char a[1000];
	int n = 1, i, j;
	cin >> a;
	for (i = 0; a[i] != '\0'; i++)
	{
		if ((a[i] - 'a') == (a[i+1] - 'a') ||(a[i] - 'a') == (a[i+1] - 'A')||(a[i] - 'A') == (a[i+1] - 'a')||(a[i] - 'A') == (a[i+1] - 'A'))
			n++;
		else 
		{
			if((a[i] >= 'a') && (a[i] <= 'z'))
			cout << "("<< (char)(a[i] - 'a'+'A')<< "," << n << ")";
			else 
				cout << "("<< a[i]<< "," << n << ")";
			n = 1;
		}
	}
	return 0;
}
int main(){
	int i,sum,l;
	char s[1000];
	cin>>s;
	l=strlen(s);
	for(i=0;i<l;i++){
		if(s[i]>='a'&&s[i]<='z')s[i]-=32;
	}
	for(i=0;i<l;i++){
		if(s[i]=='\0')break;
		sum=1;
		while(s[i]==s[i+1]){
			i++;
			sum++;
		}
		 cout<<"("<<s[i]<<","<<sum<<")";
	}
	return 0;
}
int main()
{
	char ch[1001];
	int count=1,i,j;
	cin>>ch;
	for(int i=0;ch[i]!='\0';i++)
	{
		if(ch[i]>='a'&&ch[i]<='z')
			ch[i]-=32;
	}
	for(j=0,i=0;;)
	{
		if(ch[j]=='\0')
		{
			cout<<"("<<ch[i]<<","<<count<<")";break;
		}
		else
		{
			for(j=i+1;ch[j]!='\0';j++)
			{
				if(ch[j]==ch[i])
				{
					count++;
				}
				else
				{
					cout<<"("<<ch[i]<<","<<count<<")";
					count=1;i=j;break;
				}
			}
		}
	}
	return 0;
}
int main(){
	int count,number[500],i,p,len,judge;
	char input[1000],name[500];
	gets(input);
	count=0;
	len=strlen(input);
	for(i=0;i<len;i++){name[i]=0;number[i]=0;if(input[i]>96){input[i]-=32;}}
	for(i=0;i<len;i++){
	judge=0;
	if(input[i]==name[count-1]){judge=1;number[count-1]++;}
	if(judge==0){name[count]=input[i];number[count]++;count++;}	
	}
	count--;
	for(i=0;i<=count;i++){printf("(%c,%d)",name[i],number[i]);}
return 0;

}
int main()
{
	int i, l, n = 1;
	char str[1001];
	
	gets(str);
	l = strlen(str);
	if(l == 1)
		printf("(%c,%d)", str[0] % 32 + 64, 1);
	else
		for(i = 1; i < l; i++)
		{
			if((str[i] % 32) == (str[i - 1] % 32))
				n++;
			else
			{
				printf("(%c,%d)", str[i - 1] % 32 + 64, n);
				n = 1;
			}
			if(i == l - 1)
				printf("(%c,%d)", str[i] % 32 + 64, n);
		}
	return 0;
}
int main()
{
	char str[1010], mark;
	int i, j, sum;
	cin >> str;
	i = j = 0;
	do{
		sum = 0;
		do{
			j++;
		    sum++;
		}while(str[i] - 'A' == str[j] - 'A' 
			|| str[i] - 'A' == str[j] - 'a'
			|| str[i] - 'a' == str[j] - 'A');
		if (str[i] >= 'a' && str[i] <= 'z')
			mark = str[i] - 'a' + 'A';
		else
			mark = str[i];
		cout << "(" << mark << "," << sum << ")";
		i = j;
	}while(str[i] != '\0');
	return 0;
}
int main()
{
	char a[1000], temp;
	int i, n, alen, count = 0;
	cin.getline(a, 1000);
	alen = strlen(a);
	for(i = 0 ; i < alen ; i++)
	{
		if(a[i] >= 97 && a[i] <= 122)
		{
			a[i] -= 32;
		}
	}
	temp = a[0];
	for(i = 0 ; i < alen ; i++)
	{
		do
		{
			if(a[i] == temp)
			{
				count++;
			}
			if(a[i] != temp)
			{
				cout << "(" << temp << "," << count << ")";
				temp = a[i];
				count = 1;
			}
			i++;
		}while(a[i] != '\0');
		cout << "(" << temp << "," << count << ")";
	}
	return 0;

}
int main()
{
	char str[1000];
	cin>>str;
	char flag;
	int count=0;
	for(int i=0;str[i]!='\0';i++)
	{
		if(str[i]>='a')
			str[i]-='a'-'A';
	}
	flag=str[0];
	for(int i=0;str[i]!='\0';i++)
	{
		if(str[i]!=flag)
		{
			printf("(%c,%d)",flag,count);
			flag=str[i];
			count=1;
		}
		else
			count++;
	}
		printf("(%c,%d)",flag,count);
	return 0;
}
int main()
{
    char str[1000];
    int ji[1000];
    int i,j,n;
    cin>>str;
    for(i=0;i<1000;i++)
    {ji[i]=1;}
    n=strlen(str);
    for(i=0;i<n;i++)
    {
    if(str[i]>='a')
    {str[i]=str[i]-'a'+'A';}
    }
    for(i=0;i<n;i++)
    {
                    if(str[i]==str[i+1])
                    {
                                        for(j=i+1;j<n;j++)
                                        {str[j]=str[j+1];}
                                        n--;
                                        ji[i]++;
                                        i--;
                    }
    }
    for(i=0;i<n;i++)
    {cout<<"("<<str[i]<<","<<ji[i]<<")";}
    return 0;
}
int main()
{
    char string[1000];
    gets(string);
    int m,i;
    m=1;
    for(i=0;(string[i]!='\0');i++)
    {
                                  if(string[i]>='a')string[i]=string[i]+'A'-'a';
                                  else ;
                                  if(string[i]==string[i+1]||string[i]==string[i+1]+'A'-'a')m=m+1;
                                  else
                                  {
                                      printf("(%c,%d)",string[i],m);
                                      m=1;
                                  }
    }
    return 0;
}
int main()
{
	//cout<<'Z'-0<<endl;
	char a[1000],b[1000]={0};//cout<<b[100]<<endl;
	int sum[1000]={0},i=0,j=0,t=0;
	cin.getline(a,1000);
	for(i=0;i<strlen(a);i++)
	{
		//cout<<"12345"<<endl;
		if(a[i]==a[i+1]||a[i]==a[i+1]+32||a[i]==a[i+1]-32)
		{
			sum[j]=sum[j]+1;
			//cout<<"ok"<<endl;
		}
		else
		{
			sum[j]++;
			b[j]=a[i];
			if(b[j]>90)
			{
				b[j]=b[j]-32;
			}
			j++;
		}
		//cout<<j<<sum[j]<<endl;
		//cout<<a[i]<<endl;
	}
	//cout<<sum[1]<<endl;
	do
	{
		//cout<<"1234567"<<endl;
		cout<<"("<<b[t]<<","<<sum[t]<<")";
		t++;
	}while(sum[t]!=0);
	cout<<""<<endl;
	return 0;
}
int main()
{
    int sum = 0;
    char a[1001] = {0};
    cin >> a;
    int i, count = 0;
    int k;
    k = strlen(a);
    char b = toupper(a[0]);
    for(i = 0; i < k; i++)
    {
        if(a[i] == b || toupper(a[i]) == b)
            sum++;
        else
        {
            cout << "(" << b << "," << sum << ")";
            sum = 1;
            b = toupper(a[i]); 
        }   
    }
    cout << "(" << b << "," << sum << ")"; 
    return 0;
}
int main()
{ 
    char a[1100];
    scanf("%s",a);
    int i=1,j=0;
    int len=strlen(a);
    int count=1;
    while(j<len)
    {                 
     if(toupper(a[i])==toupper(a[j]))
     count++;
     else
     {   
      printf("(%c,%d)",toupper(a[j]),count);
      j+=count;
      count=1;
     }
     i++;
    }
}
main()
{
      int i,j,k,l,n,m;
      char a[1000];
      gets(a);
      l=strlen(a);
      for(i=0;i<l;i++)
      {
        if(a[i]>='a'&&a[i]<='z')
        a[i]=a[i]-'a'+'A';
      }
      k=1;
      for(i=0;i<l;i++)
      {
         if(a[i]==a[i+1])
           k++;
         else
         {
             printf("(%c,%d)",a[i],k);
             k=1;
         }
      }
getchar();
getchar();
}
void main ()
{
     char s[1000],c[1000];
     int i,j,l,d=0,t[1000]={0};
     scanf ("%s",s);
     l=strlen(s);
     c[0]=s[0];
     t[0]=1;
     for (i=1;i<l;i++)
     {
         if (s[i]==s[i-1]||s[i]==s[i-1]+32||s[i]==s[i-1]-32)
         {
         t[d]++;
         }
         else 
         {
              d++;
              c[d]=s[i];
              t[d]++;
         }
     }
     for (i=0;i<=d;i++)
     {
     if (c[i]<=90)
     printf("(%c,%d)",c[i],t[i]);
     else
     printf("(%c,%d)",c[i]-32,t[i]);
     }
     
}
int main()
{
	char a[1010];
	cin>>a;
	int i = 0;
	int count = 1;
	while( a[i] != '\0' )
	{
		if(a[i+1] == a[i] || a[i+1] - 'a' == a[i] - 'A' || a[i+1] - 'A' == a[i] - 'a' )	
		{
			count ++;
		}
		else
		{
			if(a[i] >= 'a' && a[i] <= 'z')
			{
				cout<<'(';
				cout<<(char)('A' + a[i] - 'a')<<',';
				cout<<count;
				cout<<')';
				count = 1;
			}
			else
			{
				cout<<'(';
				cout<<a[i]<<',';
				cout<<count;
				cout<<')';
				count = 1;
			}
		}
			i++;
	}
	cout<<endl;
	
	return 0;
}
int main ()
{
	char text[1000];
	cin >> text;
	int index[40] = {0}, count[40] = {0}, temp = 1, len, sort = 0;
	len = strlen(text);
	int i,j,k;

	for (i = 1; i < len; i++)
	{
		if (toupper(text[i]) != toupper(text[i-1]))
		{
			count[sort] = temp;
			sort++;
			index[sort] = i;
			temp = 1;
		}
		else
			temp ++;
	}
	count[sort] = temp;

	for (i = 0; i <= sort; i++)
	{
		cout << "(" << (char)toupper (text[index[i]]) << "," << count[i] << ")";
	}
	cout << endl;

	return 0;
}
main()
{
      char l[1000];
      int i,count=1;
      scanf("%s",l);
      for(i=0;l[i]!='\0';i++)
      {
                          if((l[i+1]==l[i])||(l[i+1]==l[i]+32)||(l[i+1]==l[i]-32))
                          count=count+1;
                          else
                          {
                              if(l[i]>='a'&&l[i]<='z')
                              {
                                printf("(%c,%d)",l[i]-32,count);
                                count=1;
                               } 
                              else
                              {
                                printf("(%c,%d)",l[i],count);
                                count=1;
                               }
                          }
      }
      return 0;
}
main()
{
    char a[1000];
    int length,i,n;
    gets(a);
    length=strlen(a);
    for(i=0;i<length;i++)
    {
        if((a[i]>='a')&&(a[i]<='z'))
        a[i]=a[i]-DLTA;
        else
        ;
    }

                                         //make all letter capital
    n=1;
    for(i=0;i<length-1;i++)
    {
        if(a[i]==a[i+1])
        {
            n=n+1;
        }
        else
        {
            printf("(%c,%d)",a[i],n);
            n=1;
        }
    }
    n=1;
    for(i=length-1;a[i]==a[i-1];i--)
    {
        n=n+1;
    }
    printf("(%c,%d)",a[length-1],n);
}
int main()
{
    char c[1001]={'\0'};
    cin.getline(c, 1000, '\n');
    int i=0;
    while(1)
    {
        int m=1;
        if(c[i]=='\0')
            break;
        while(c[i]==c[i+1]||c[i]-'a'==c[i+1]-'A'||c[i]-'A'==c[i+1]-'a')
        {
            m++;
            i++;
        }
        if(c[i]-'a'>=0)
            c[i]='A'+c[i]-'a';
        cout<<'('<<c[i]<<','<<m<<')';
        m=1;
        i++;
    }
    return 0;}
int main()
{
    int i,j,k,m,n;
    int l,r;
    char s[1100];
    cin >>s;
    m=strlen(s);
    i=0;
    while (i<m)
    {
        j=i;
        l=(int)s[i];
        r=(int)s[j];
        while (l==r || (l-32)==r || (l+32)==r)
        {
            j++;
            r=(int)s[j];
        }
        cout <<"(";
        if (l<97) cout <<s[i];
        else cout <<(char)(l-32);
        cout <<","<<j-i<<")";
        i=j;
    }
    cout <<endl;

    return 0;
}
main()
{
      int f(int x);
      char str[1001];
      int i,m;
      char c;
      m=1;
      scanf("%s",str);
      for(i=0;(c=str[i])!='\0';i++)
        str[i]=f(str[i]);
      for(i=0;(c=str[i])!='\0';i++)
        if(str[i+1]==str[i])
        m=m+1;
        else {
             printf("(%c,%d)",str[i],m);
             m=1;
             }
}
int f(int x)
{
    if(x>='a'&&x<='z') x=x-'a'+'A';
    return(x);
}
int main()
{
	char ch[1002]={'\0'};
	cin>>ch;
	int len;
	len=strlen(ch);
	int i=0,num=0;
	char temp=ch[0];
	

	
for(i=0;i<len+1;i++)
		if(ch[i]==temp||ch[i]==(temp+32)||ch[i]==(temp-32))num++;
		else {
			if(97<=temp&&temp<=122)cout<<"("<<(char)(temp-32)<<","<<num<<")";
			else cout<<"("<<(char)temp<<","<<num<<")";
			temp=ch[i];num=1;}
		

  //cout<<(int)'A'<<endl;
  	return 0;
}
int main()
{
    char a[1100]={'\0'};
    int i,j,max;
    cin>>a;
    for(i=0;i<strlen(a);i++)
       if(a[i]>='a'&&a[i]<='z')
          a[i]=a[i]-32;
    for(i=0;i<strlen(a);i++)
    {
       for(j=0;j<strlen(a)-i;j++)
       {
          if(a[i]==a[i+j])
             max=j+1; 
          else break;                         
       }
       cout<<"("<<a[i]<<','<<max<<")";
       i=i+max-1; 
    }
    return 0;
}
int main()
{
	char a[2000];
	char t;
	int i,cnt=0;
	cin.getline(a,2000);
	for(i=0;a[i]!='\0';i++)
	{
		if(a[i+1]-a[i]==0||a[i+1]-a[i]=='a'-'A'||a[i+1]-a[i]=='A'-'a')
			cnt++;
		else
		{
			if(a[i]>='a'&&a[i]<='z')
			{
				t=a[i]-32;
				cout<<"("<<t<<","<<cnt+1<<")";
			}
			else
			{
				t=a[i];
				cout<<"("<<t<<","<<cnt+1<<")";
			}
			cnt=0;
		}
	}
	return 0;
}
int main()

{
char a[1000],b[1000]={1},c[1000]={0};
scanf("%s",a);
for(int w=0;a[w]!='0';w++)
{
    if((a[w]>='a')&&(a[w]<='z'))
    a[w]=a[w]-'a'+'A';
    else a[w]=a[w];}
int j=0;
c[0]=a[0];
for(int i=0;a[i]!='\0';i++)
{
if(a[i]==a[i+1])
{
b[j]=b[j]+1;}
else {c[j]=a[i];
j++;
b[j]=1;
}}
for(int k=0;c[k]!='\0';k++)
printf("(%c,%d)",c[k],b[k]);}
main()
{
      int i,a[1000],x;
      char s[1001];
      scanf("%s",s);
      x=strlen(s);
      for(i=0;i<1000;i++)
      a[i]=1;
      for(i=1;i<=x;i++)
      {
                      if((s[i]-'A')==(s[i-1]-'A'-32))
                      a[s[i]-'A']++;
                      else if((s[i]-'A'-32)==(s[i-1]-'A'))
                      a[s[i]-'A'-32]++;
                      else if((s[i]-'0')==(s[i-1]-'0'))
                      {
                           if((s[i]-'0')<43)
                           a[s[i]-'A']++;
                           else 
                           a[s[i]-'A'-32]++;
                           }
                           
                      else
                      {
                          if((s[i-1]-'0')<43)
                          {
                          printf("(%c,%d)",s[i-1],a[s[i-1]-'A']);
                          a[s[i-1]-'A']=1;
                          }
                          else
                          {
                          printf("(%c,%d)",s[i-1]-'A'-32+'A',a[s[i-1]-'A'-32]);
                          a[s[i-1]-'A'-32]=1;
                          }
                          }
                          }
                          
                                             
                                             }
main()
{
    char a[1000],c;
    int i,j,t;
    scanf("%s",a);
    for(i=0,t=0;a[i]!='\0';i++,t++)
    {
        if(a[i]>='a'&&a[i]<='z')
        a[i]=a[i]+'A'-'a';
    }
    if(t==1)
    {j=1;
    printf("(%c,%d)",a[0],j);}
    else
    {
        for(i=0,j=1;i<t;i++)
        {
        if(a[i+1]==a[i])
            j++;
        else
        {
            printf("(%c,%d)",a[i],j);
            j=1;
        }
        }
    }
}
/*
 * ??(12-5) ??????
 *
 *  Created on: 2013-1-12
 *      Author: zhuyongfu
 */


int main(){
	char s1[1001],s2[1001];
	int l,i,num = 1;
	cin >> s1;
	l = strlen(s1);
	for(i = 0;i < l;i++)
	{
		if(s1[i] > 90)
			s2[i] = s1[i] - 32;
		else
			s2[i] = s1[i];
	}
	if(l == 1)
	{
		cout << '(' << s2[0] << ',' << num << ')';
		return 0;
	}
	for(i = 1;i < l;i++)
	{
		if(s2[i] != s2[i - 1]&&i != l - 1)
		{
			cout << '(' << s2[i - 1] << ',' << num << ')';
			num = 1;
		}
		if(s2[i] != s2[i - 1]&&i == l - 1)
		{
			cout << '(' << s2[i - 1] << ',' << num << ')';
			num = 1;
			cout << '(' << s2[i] << ',' << num << ')';
		}
		if(s2[i] == s2[i - 1]&&i != l - 1)
			num++;
		if(s2[i] == s2[i - 1]&&i == l - 1)
		{
			num++;
			cout << '(' << s2[i - 1] << ',' << num << ')';
		}
	}
	return 0;
}
main()
{
      char s[1000];
      int i,l,c;
      scanf("%s",&s);
      l=strlen(s);
      c=0;
      for(i=0;i<=l-1;i++)
      {
          if((s[i]>='a')&&(s[i]<='z'))
          s[i]=s[i]-'a'+'A';
      } 
      for(i=0;i<=l-1;i++)
      {   if((s[i]==s[i+1])&&(i<l)) 
          {c=c+1;}
          else 
          if((s[i]==s[i+1])&&(s[i+2]=='\0')) printf("(%c,%d)",s[i],c);
          else
          {printf("(%c,%d)",s[i],c+1);
           c=0;}
      }
      getchar();
      getchar();
}
int main()
{
	int i,now;
	char c,x;
	c=' ';now=1;
	scanf("%c",&c);
	if (c>=97) c=c-32;
	do{
		scanf("%c",&x);
		if (x==c||x-c==32) {
			now++;
		}
		else {
			printf("(%c,%d)",c,now);
			now=1;
			c=x;
			if (c>=97) c=c-32;
		}
	}
	while (c!='\n');
return 0;
}
main()
{
      char c[1024];
      int i,j,n,d;
      scanf("%s",c);
      d='A'-'a';
      for(i=0;i<=1024;i+=n)
      {
                              n=0;
                              if('a'<=c[i]&&c[i]<='z')
                              {
                                                      c[i]+=d;
                                                      for(j=i;j<=1024;j++)
                                                      {
                                                                          if(c[j]==c[i]||c[j]==c[i]-d) n++;
                                                                          else break;
                                                      }
                                                      printf("(%c,%d)",c[i],n); 
                              }
                              else if('A'<=c[i]&&c[i]<='Z')
                              {
                                   for(j=i;j<=1024;j++)
                                                      {
                                                                          if(c[j]==c[i]||c[j]==c[i]-d) n++;
                                                                          else break;
                                                      }
                                                      printf("(%c,%d)",c[i],n); 
                              }
                              else break;
      }
}
main()
{     int a,b,c,d;
      c=1;
      char str1[999],str2[999];
      scanf("%s",str1);
      a=strlen(str1);
      for(d=0;d<=a-1;d++)
      {
          if(str1[d]>='a' && str1[d]<='z')
          str2[d]=str1[d]-'a'+'A';
          else
          str2[d]=str1[d];
      }
      for (b=0;b<=a-1;b++)
      {   
          if(str2[b]==str2[b+1])
          c++;
          else
          {
              printf("(%c,%d)",str2[b],c);
              c=1;
          }
      }

}
int main()
{
    char s[1000];
    scanf("%s",s);
    int l=strlen(s);
    int a=s[0],n=1;
    for(int i=1;i<l;i++)
    {
            if(s[i]==a||s[i]==a+32||s[i]==a-32)
            n++;
            else
            {
                if(a>'Z')
                a=a-'a'+'A';
                printf("(%c,%d)",a,n);
                a=s[i];
                n=1;
            }
    }
    if(a>'Z')
    a=a-'a'+'A';
    printf("(%c,%d)",a,n);
    getchar();
    getchar();
}
int main()
{
	char a[1000];
	int i,n=0; 
	scanf("%s",a);                               //??????????????????? 
	for(i=0;i<1000;i++)
	{
		if(a[i]!=0)
			n++;
		else
			break;
	}
	
	int b[1000]={0},j,k=0,m;
	for(j=0;j<n;j++)                       //???j<n?????a[n]?a[n-1]????     
	{
		if(a[j+1]==a[j] || a[j+1]==a[j]-'a'+'A' || a[j]==a[j+1]-'a'+'A')
			b[k]++;
		else
		{
			b[k]=b[k]+1;
			if(a[k]>='a'&&a[k]<='z')
				m=a[k]-'a'+'A';
			else
				m=a[k];
			printf("(%c,%d)",m,b[k]);
			k=j+1;
		}
	}
	return 0;
}
int main()
{
	char input[1005], reserve[1005];
	int i, j = 0, num[1005] = {0}, flag = 0;
	cin >> input;
	if( input[0] >= 'a')
	{
		input[0] -= ('a' - 'A');
	}
	reserve[0] = input[0];
	num[0] = 1;
	for( i = 1; input[i]!='\0'; i++ )
	{
		if( input[i] >= 'a')
		{
			input[i] -= ('a' - 'A');
		}
		if( input[i] == input[i - 1] )
		{
			num[j]++;
		}
		else
		{
			j ++;
			reserve[j] = input[i];
			num[j]++;
		}
	}
	reserve[j +1] = '\0';
	for( i = 0; reserve[i] != '\0'; i++ )
	{
		if( flag == 0 )
		{
			cout << "(" << reserve[i] << "," << num[i] << ")";
			flag = 1;
		}
		else
			cout << "(" << reserve[i] << "," << num[i] << ")";
	}

	return 0;
}
int main()
{
    int i,j,k,n;
    char a[1100],h;
    scanf("%s",a);
    for(i=0;a[i]!='\0';)
    {
        for(n=0,h=a[i],j=i;a[j]==h||(a[j]-h)==('A'-'a')||(h-a[j])==('A'-'a');j++)
        n=n+1;
        if(h<'Z')
        printf("(%c,%d)",h,n);
        else
        printf("(%c,%d)",(h-('a'-'A')),n);
        i=j;
    }
    getchar();
    getchar();
}