semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	char str[1001];
	int len,count=0;
	int i;
	char c;
	cin>>str;
	len=strlen(str);
	for(i=0;i<len;i++)
	{
		if(str[i]>='a'&&str[i]<='z')
			str[i]-=32;
	}
	c=str[0];
	for(i=0;i<len;i++)
	{
		if(str[i]==c)
		{
			count++;
		}
		else
		{
			cout<<"("<<str[i-1]<<","<<count<<")";
			c=str[i];
			count=1;
		}
	}
	i--;
	cout<<"("<<str[i]<<","<<count<<")";
	cout<<endl;
	
	return 0;
}
int main()
{
    char a[100];
    int n,i,count=1,j=0;
    scanf("%s",&a);
    while(a[j]!='\0')
    {             
     if(a[j]>='a'&&a[j]<='z') a[j]=a[j]-32; 
     j++;             
     }
    for(i=0;a[i]!='\0';i++)
    {
    if(a[i]==a[i+1])
      count+=1;
      else {printf("(%c,%d)",a[i],count);count=1;continue;}
     }
}
main()
{
      char s[100000];
      scanf("%s",s);
      int i,a[strlen(s)],c;
      for (i=0;i<strlen(s);i++)
      a[i]=0;
      a[0]=1;
      c=0;
      char b[strlen(s)];
      for (i=0;i<strlen(s);i++)
      b[i]='\0';
      b[0]=s[0];
      for (i=1;i<strlen(s);i++)
      {
          if (s[i]==s[i-1]||s[i]-s[i-1]=='a'-'A'||s[i-1]-s[i]=='a'-'A')
          {
                           a[c]++;
          }
          else 
          {
               c++;
               a[c]++;
               b[c]=s[i];
          }
      }
      for (i=0;i<=c;i++)
      if(b[i]>='a'&&b[i]<='z')
      b[i]=b[i]+'A'-'a';
      for (i=0;i<=c;i++)
      printf("(%c,%d)",b[i],a[i]);      

}
main()
{
int j=1,i=0;
char s[1001],s2[1001];
gets(s);
for(;i<=1000;i++)
{
   if('a'<=s[i]&&s[i]<='z')
   s2[i]=(s[i]-'a'+'A');
   else s2[i]=s[i];
   }
                 
for(i=0;i<=1000&&(s2[i]!='\0');i++)
{
    if(s2[i]==s2[i+1])
    j++;
    else 
    {
     printf("(%c,%d)",s2[i],j);
     j=1;
     }
}
}
int main()
{
    char a[1001];
    cin >> a;
    int i,j,k;
    int f=1,f2=0;
    for (i=0;i<strlen(a);i++)
    {
        if (a[i]=='a') a[i]='A';
        if (a[i]=='b') a[i]='B';
        if (a[i]=='c') a[i]='C';
        if (a[i]=='d') a[i]='D';
    }
    for (i=1;i<strlen(a);i++)
    {
        if(a[i]==a[i-1])
        {f++;
        f2++;}
        else
        {
            cout <<"("<<a[i-1]<<","<<f<<")";
            f=1;
            f2=0;
        }
    }
 
    cout <<"("<<a[strlen(a)-1]<<","<<f<<")";
    return 0;
}
int main()
{
	int i, j, count = 1;
	char a[1005], x;
	cin >> a;
	for(i = 0; i < strlen(a); i++)
	{
		if(a[i] > 96 && a[i] < 123)
			a[i] -= 32;
	}
	for(i = 0; i < strlen(a);)
	{
		x = a[i];
		for(j = i + 1; j < strlen(a); j++)
	    {
		    if(x != a[j])
			{
				cout << "(" << a[i] << "," << j - i << ")";
				break;
			}
    	}
		if(j == strlen(a))
		{
			cout << "(" << a[i] << "," << j - i << ")";
		}
		i = j;
	}

	return 0;   
}
int main()
{
char s[1000];
int a[1000],t,len;
char b[1000],k;
int i,j;

for(i=0;i<1000;i++)
a[i]=0;

gets(s);
len=strlen(s);



for(i=0;i<len;i++)
{
                  if(s[i]-'Z'>0)
                  s[i]=s[i]+'A'-'a';
                  //printf("%c",s[i]);
                  
}

k=s[0];
b[0]=s[0];
a[0]=1;
j=0;
if(len==1)
printf("(%c,%d)",b[0],a[0]);
else
 {       
 for(i=1,j=0;i<len;i++)    
    {
                          if(k==s[i])//||k==(s[i]+'A'-'a')||k==(s[i]-'A'+'a'))
                          a[j]++;
                          else
                          {
                              j++;
                              a[j]=1;
                              k=s[i];
                              b[j]=s[i];
                          } 
                          
                          
    }
     
 for(i=0;i<=j;i++)
 printf("(%c,%d)",b[i],a[i]);    
 }
}
int main()
{
	char str[1001], s[30]={"ABCDEFGHIJKLMNOPQRSTUVWXYZ"};
	int num, i = 0, l, m;
	cin >> str;
	l = strlen(str);
	while(i < l)
	{
		num=1;
		while(str[i+1]==str[i]||str[i+1]==str[i]+32||str[i+1]==str[i]-32)
		{
			i++;
			num++;
		}
		if(str[i]-'0' <= 'Z'-'0')
		{
			cout << "(" << str[i] <<"," << num << ")";
		}
		else
		{
			m ='A'-'a'+str[i] -65;
			cout << "(" << s[m] <<"," << num << ")";
		}
		i++;
	}

	return 0;
}
main()
{
      char s[10000];
      int i;
      gets(s);
      int l=strlen(s);
        for(i=0;i<l;i++)
        for(int j='a';j<='z';j++)
        if(s[i]==j) s[i]=j-32;
        char max=s[0];int k=0;
      for(i=0;i<=l;i++)
      {
      if(s[i]==max) k++;
      else 
       {
           printf("(%c,%d)",max,k);
           max=s[i];
           k=0;
           i--;
           }

}
      getchar();getchar();
      }
int main()
{
	char a[1010];
	cin>>a;
	int l,m=1,A=0;
	l=strlen(a);
	struct
	{
		char c;
		int d;
	}b[27];
	for(int i=0;i<l;i++)
	{
		if(a[i]>=97)
			a[i]-=32;
	}
	b[1].c=a[0],b[1].d=1;
	for(int i=1;i<l;i++)
	{
		if(a[i]==a[i-1])
			b[m].d++;
		else
		{
			b[++m].c=a[i];
			b[m].d=1;
		}
	}
	for(int i=1;i<=m;i++)
		cout<<"("<<b[i].c<<","<<b[i].d<<")";
	return 0;
}
char a[1001];
int main()
{
	cin>>a;
	int len=strlen(a),i=0;
	for(i=0;i<len;i++)
	{
		if(a[i]>='a'&&a[i]<='z')
			a[i]=a[i]+'A'-'a';
	}
	int num=1;
	for(i=0;i<len;i++)
	{
		if(a[i+1]==a[i])
		{
			num++;
		}
		if(a[i+1]!=a[i])
		{
			cout<<"("<<a[i]<<","<<num<<")";
			num=1;
		}
	}

	return 0;
}
// 2011???.cpp : ??????????????
//
int main()
{
	char str[10000];
	char now;
	int len;
	cin>>str;
	len=strlen(str);
	int num=1;
	int time=0;
	for(int j=0;j<len;j++)
	{
		if(str[j]<'z'+1&&str[j]>'a'-1) str[j]=str[j]+'A'-'a';
	}
	now=str[0];
	cout<<'('<<now<<',';
	for(int i=1;i<len;i++)
	{
		if(str[i]==str[i-1]) num=num+1;
		else
		{
			cout<<num<<')';
			now=str[i];
			num=1;
			cout<<'('<<now<<',';
		}
	}
	cout<<num<<')'<<endl;
	return 0;
}
int main()
{
	char s[1000],x,a[1000];
	int i,j,k,t,c[1000]={0};
	scanf("%s",s);
	k=strlen(s);
	for(i=0;i<k;i++)
	{
		if(s[i]>='a'&&s[i]<='z')
		{
			s[i]-=32;
		}
	}
	a[0]=s[0];
	x=s[0];
	for(i=1,t=1;i<k;i++)
	{
		if(x!=s[i])
		{
			c[t]=i;
			x=s[i];
			a[t]=s[i];
			t++;
		}
	}
	c[t]=k;
	for(i=0;i<=t-1;i++)
	{
		printf("(%c,%d)",a[i],c[i+1]-c[i]);
	}
	return 0;
}
int main()
{
	char str[1010], a;
	int c = 1;
	cin>>str;
	for(int i = 1; i < strlen(str); i++)
	{
		if(str[i] != str[i - 1] && str[i] != str[i - 1] + 32 && str[i] != str[i - 1] - 32)
		{
			if(str[i - 1] < 'Z')   a = str[i - 1];   
			else   a = str[i - 1] - 32;
			cout<<'('<<a<<','<<c<<')';
			c = 1;
		}
		else  c++;
	}
	if(str[strlen(str) - 1] < 'Z')   a = str[strlen(str) - 1];   
	else   a = str[strlen(str) - 1] - 32;
	cout<<'('<<a<<','<<c<<')'<<endl;
	return 0;
}
int main() {
	char a[100], *p, *q, b[100];
	int lenth, i = 0, j,count[100] = {0};
	for (i = 0; i < 100; i++) {
		count[i] = 1;
	}
	i = 0;
	cin.getline(a, 100);
	lenth = strlen(a);
	for (p = a; p <= lenth + a; p++) {
		for (q = p + 1;*q == *p || fabs(*p - *q) == 32 ; q++) {
				b[i] = *p;
				count[i]++;
		}
		if (count[i] != 1) {
			p = q - 1;
			i++;
		} else {
			b[i]=*p;
			i++;
		}
	}
	for (j = 0; j < i; j++) {
		if (b[j] >= 'a' && b[j] <= 'z') {
			b[j] = b[j] - 32;
		}
	}
	for (j = 0; j < i-1; j++) {
		cout << "(" << b[j] << "," << count[j] << ")";
	}
	return 0;
}
int main()
{
	char a[1001];
	char temp;
	int i, j, l, count = 0;
	cin.getline(a, 1000);
	l = strlen(a);
	a[l] = '.';
	for(i = 0; i <= l - 1; i++)
	{
		if(a[i] >= 'a' && a[i] <= 'z')
		{
			a[i] = a[i] + ('A' - 'a');
		}
	}
	temp = a[0];
	for(i = 0; i <= l; i++)
	{
		if(a[i] == temp)
		{
			count++;
		}
		if(a[i] != temp)
		{
			cout << "(" << temp << "," << count << ")";
			temp = a[i];
			count = 1;
		}
	}
	cin.get();
	return 0;
}
int main()
{
    char s[1000];
	int len,i,j,t;
	cin>> s;
	len=strlen(s);
	i=0;t=0;
	while(i<len)
	{
		if(s[i+1]==s[i]||s[i+1]==s[i]+32||s[i+1]==s[i]-32){i++;t++;continue;}
		if(s[i+1]!=s[i])
		{
			if(s[i]>='a'){s[i]=s[i]-32;cout<<"("<<s[i]<<","<<t+1<<")";t=0;i=i+1;continue;}
			if(s[i]<'a'){cout<<"("<<s[i]<<","<<t+1<<")";t=0;i=i+1;continue;}
		}
	}
	return 0;
}
int main()
{
	char str[1000], t;
	int i, count = 0;
	cin.getline(str,1000);
	int len = strlen(str);
	for (i = 0; i < len; i++)
	{
		if (str[i] >= 97)
			str[i] -= 32;
	}
	t = str[0];
	i = 0;
	while (i < len)
	{
		if (t == str[i])
			count++;
		else
		{
			cout << "(" << t << "," << count << ")";
			count = 1;
			t = str[i];
		}
		i++;
	}
	cout << "(" << t << "," << count << ")" << endl;
	return 0;
}
struct yasuo
{
	char d;
	int m;
}b[1010];
int main()
{
	int n,i,k=0;
	char a[1010];
	gets(a);
	n=strlen(a);
	for(i=0;i<=n-1;i++)
         {         
                   if(a[i]>=97)
                       a[i]=a[i]-32; 
          }
	for (i=0;i<=n-1;i++)
	{
		b[k].d=a[i];
		b[k].m=1;
		while(a[i+1]==a[i])
		{
			b[k].m++;
			i++;
		}
		k++;
	}
	for(i=0;i<=k-1;i++)
	{
	    printf("(%c,%d)",b[i].d,b[i].m);
	}
	return 0;
}
int main()
{
    char letter[1000];
    int nletter[1000];
    char str[1000];

    memset(letter,'\0',1000);
    memset(str,'\0',1000);

    for(int i=0;i<=1000-1;i++)nletter[i]=1;

    cin>>str;
    int len=strlen(str);
    int n=0;

    letter[0]=str[0];

    for(int i=0;i<=len-1;i++)
    {
        if(letter[n]!=str[i+1]&&(letter[n]!=str[i+1]+'A'-'a')&&(letter[n]!=str[i+1]-'A'+'a'))
        {
            letter[++n]=str[i+1];
        }
        else
        {
            nletter[n]++;
        }
    }
    for(int i=0;i<=n-1;i++)
    {
        if(letter[i]>'Z')letter[i]+=('A'-'a');
    }

    for(int i=0;i<=n-1;i++)
    {
        cout<<"("<<letter[i]<<","<<nletter[i]<<")";
    }
    cout<<endl;
    return 0;
}
int main()
{
	char a[1100]={'\0'};
	cin>>a;
	char b=a[0];
	int i=0,count=0;
	while (1)
	{
		if (a[i]==b||a[i]==b-32||a[i]==b+32)
		{
			count++;
			i++;
		}
		else if (a[i]!=b&&a[i]!=b-32&&a[i]!=b+32)
		{
			if (a[i-1]<97)
			{
				char c=a[i-1];
				cout<<"("<<c<<","<<count<<")";
			}
			else if (a[i-1]>=97)
			{
				char d=a[i-1]-32;
				cout<<"("<<d<<","<<count<<")";
			}
			count=0;
			b=a[i];
		}
		if (a[i]=='\0')
		{
			if (a[i-1]<97)
			{
				char e=a[i-1];
				cout<<"("<<e<<","<<count<<")";
			}
			else if (a[i-1]>=97)
			{
				char f=a[i-1]-32;
				cout<<"("<<f<<","<<count<<")";
			}
			break;
		}
	}
}
typedef struct 
{
	char c;
	int count;
} letterCount; //????????????????

int main()
{
	int i,j;
	char str[MAXLENGTH];
	letterCount lc[MAXLENGTH]; //?????
	//??
	fgets(str, MAXLENGTH, stdin);

	//???????????
	for (i = 0; i < MAXLENGTH; i++)
	{
		if(str[i] == '\n')
			break;
		if (str[i] >=97 && str[i] <= 122)
			str[i] = str[i] - 32;
	}

	//???????
	j = 0; //????????
	i = 0; //?????

	lc[j].c = str[0];
	lc[j].count = 1;
	while (true)
	{
		if (str[i] == str[i + 1])
		{
			lc[j].count++;
			i++;
		}
		else
		{
			if (str[i + 1] == '\n')
				break;

			j++;
			lc[j].c = str[i + 1];
			lc[j].count = 1;
			i++;
		}
	}
	
	//??
	for (int i = 0; i <=j; i++)
	{
		printf("(%c,%d)", lc[i].c, lc[i].count);
	}
	printf("\n");
	return 0;
}
int main()
{
	int i,t;
	char a[1000],b;
	cin>>a;
	for(i=0;i<strlen(a);i++)
	{
		if(a[i]>96)
		{
			a[i]=a[i]-32;
		}
	}
	b=a[0];
	t=1;
	for(i=1;i<strlen(a)+1;i++)
	{
		if(a[i]==b)
		{
			t=t+1;
		}
		else
		{
			cout<<"("<<b<<","<<t<<")";
			b=a[i];
			t=1;
		}
	}
	cout<<endl;
	return 0;
}
int main()
{
	char a[1000];
	int num[1000] = {0},i,j,len;
	cin>>a;
	len = strlen(a);
	for(i = 0;i < len ;i ++)
	{
		if(a[i] > 'Z')
		{
			a[i] = a[i] - 'a' + 'A';
		}
	}
	for(i =0; i < len ;i ++)
	{
		j = i;
		while(a[j] == a[i])
		{
			j ++;
			num[i] ++;
		}
		cout<<"("<<a[i]<<","<<num[i]<<")";
		i = j - 1;
	}
	return 0;
}
main()
{
	char s[1001];
	int i,t,j,k;
	scanf("%s",s);
	k=strlen(s);
	for(i=0;i<k;i++)
	{
		if(s[i]>='a'&&s[i]<='z')
		s[i]=s[i]-'a'+'A';
	}
	t=1;
	for(i=0;i<k;i++)\
	{
		
		if(s[i]==s[i+1])
		t++;
		else {
		printf("(%c,%d)",s[i],t);t=1;continue;}
	}	
}
int main()
{
char a[1000];
int count=1;
int j,k;
scanf("%s",a);
for(j=0;a[j]!='\0';j++)
{
    if(a[j]>='a'&&a[j]<='z')
    {
        a[j]=a[j]+'A'-'a';                        
    }                       
}
for(k=0;a[k]!='\0';k++)
{                                            
    if(a[k]==a[k+1])
    {
        count++;         
    }
    else
    {
        printf("(%c,%d)",a[k],count);
        count=1;
    }
}
return 0;
}
int main()
{
	int i,len,sum;
	char temp,str[1000]={0};
	gets(str);
	len=strlen(str);
	for(i=0;i<len;i++)
		if(str[i]>=97)
			str[i]=str[i]-32;
	temp=str[0];
	sum=0;
	for(i=1;i<len;i++){
		if(str[i]!=temp){
			printf("(%c,%d)",str[i-1],sum+1);
			sum=0;
			temp=str[i];
		}
		else
			sum++;
	}
	printf("(%c,%d)",temp,sum+1);
	return 0;
}
void main()
{
	int i,j,c,d=1;
	char a[10000];
	scanf("%s",a);
	c=strlen(a);
	for(i=0;i<c;i++)
		if(a[i]>96&&a[i]<123)a[i]=a[i]-32;
	for(i=0;i<c;i++)
			if(a[i]==a[i+1])d++;
			else printf("(%c,%d)",a[i],d),d=1;
}
int main()
{
 char a[1005];
 int l,i;
 gets(a);
 l = strlen(a);
 int t = 1;
 if(a[0]>='a' && a[0]<='z')
       a[0] = a[0] - 'a' + 'A';
 char p = a[0];
 for(i = 1;i <= l; i++)
 {
     if(a[i]>='a' && a[i]<='z')
       a[i] = a[i] - 'a' + 'A';
    if(a[i] != p)
    {
      printf("(%c,%d)",p,t);
      t = 1;
      p = a[i];       
    }
    else t++;
 }

 return 0;    
}
int main()
{
    char a[1002], t;
    int i, j = 0, k, num[1002], m[1002];
    
    for(i = 0; i <= 1000; i++)
    num[i] = 1;
    
    cin.getline(a, 1001);
    
    m[0] = 0;
    for(i = 0; a[i] != '\0'; i++)
    {
          if( (a[i] == a[i + 1])||(fabs(a[i] - a[i + 1]) == 32) )
          {
                  num[j]++;
                  m[j] = i;
          }
          else
          {
              m[j] = i;
              j++;
          }
    }
    
    for(i = 0; i < j; i++)
    {
          if( (a[m[i]] >= 'a')&&(a[m[i]] <= 'z') )
          {
                     t = a[m[i]] - 32;
                     cout << "(" << t << "," << num[i] << ")";
          }
          else
          {
              t = a[m[i]];
              cout << "(" << t << "," << num[i] << ")";
          }
    }
    
    return 0;
}
int main ()
{
  char str[1000];
  scanf("%s",str);
  int a,b;char n;
  a=0;b=1;
  while (str[a]!='\0') 
    {
        str[a]=toupper(str[a]);
        a++;
    }
  a=0;
  while(str[a]!='\0')
  {
    n=str[a];
    if (n==str[a+1])
    b=b+1;
    else
    {printf("(%c,%d)",n,b);b=1;}  
      a++;}
  

}
char l(char c)
{
if (c>='a'&&c<='z')
     return c+'A'-'a';
else
     return c;
}

int main()
{
    char s[1001];cin>>s;
    char c=l(s[0]);
    int t=1;
    for (int i=1;i<=strlen(s);i++)
    {if (c==l(s[i]))
    t++;
    else
    {
    cout<<'('<<c<<','<<t<<')';
            c=l(s[i]);
    t=1;
        }
    }
    cout<<endl;
    return 0;
}
int main ()
{
    char a[1000];
    int i,n,m,g,h;
    scanf("%s",a);
    n=strlen(a);
    for(h=0;h<n;h++)
    {
                    if(a[h]>'Z')
                    a[h]=a[h]-'a'+'A';
    }
    for(i=0;i<n;)
    {
                    m=1;
                    for(g=i+1;g<n;g++)
                    {
                                      if(a[i]==a[g])
                                          m+=1;
                                      else
                                      {
                                          printf("(%c,%d)",a[i],m);
                                          i=g;
                                          break;
                                      }
                    }
                    i=g;                    
    }
    printf("(%c,%d)",a[i-1],m);
    return 0;
}
int main()
{
	int n, i, sum, p, q;
	char a[1001], b[1001];
	cin >> a;
	sum = 0;
	n = strlen(a);
	for(i = 0; i < n - 1; i ++)
	{
		if(a[i + 1] == a[i] || a[i + 1] - a[i] == 32 || a[i] - a[i + 1] == 32)
			sum ++;
		else
		{
			if(a[i] > 'Z')
			{
				p = a[i] - '0';
				q = p - 32;
				b[i] = q + '0';
				cout << "(" << b[i] << "," << sum + 1 << ")";
			}
			else
				cout << "(" << a[i] << "," << sum + 1 << ")";	
			sum = 0;
		}
	}
	sum = 1;
	for(i = n - 1; i > 0; i --)
	{
		if(a[i] == a[i - 1] || a[i] - a[i - 1] == 32 || a[i - 1] - a[i] == 32)
		{
			sum ++;
		}
		else
			break;
	}
	if(a[n - 1] > 'Z')
	{
		p = a[n - 1] - '0';
		q = p - 32;
		b[n - 1] = q + '0';
		cout << "(" << b[n - 1] << "," << sum << ")";
	}
	else
		cout << "(" << a[n - 1] << "," << sum << ")";	
	return 0;
}
void strupr(char a[])
{
    int i;
    for(i=0;a[i]!='\0';i++)
    {
        if (a[i]>='a'&&a[i]<='z')
        {
            a[i]=a[i]+'A'-'a';
        }
    }
}
 int main()
{
    int i,m,n=1;
    char a[1001];
    gets(a);
    strupr(a);
    for(i=1;a[i-1]!='\0';i++)
    {
        if (a[i]==a[i-1])
        {
            n++;
        }
        else
        {
            printf("(%c,%d)",a[i-1],n);
            n=1;
        }

    }

    return(0);
}
int main()
{
    int d = 26, p = 1;
    char c;
    while(scanf("%c", &c), c!= '\n'){
        if(c >= 'A' && c <= 'Z') c = c - 'A';
        if(c >= 'a' && c <= 'z') c = c - 'a';
        if(d >= 26) d = c;
        else if(d != c){
            printf("(%c,%d)", d+'A', p);
            p = 1;
            d = c;
        }
        else p++;
    }
     printf("(%c,%d)", d+'A', p);
   return 0;
}
int main()
{
    char a[1001];
    int i,j,l,y;
    int x[100]={0};
    scanf("%s",a);  
    l=strlen(a);
    for(i=0;i<l;i++)
    {if(a[i]>='a'&&a[i]<='z') a[i]=a[i]-'a'+'A';}
    for(i=0;i<l;i++)
    {y=a[i]-'A';
     x[y]++;
     if(a[i]==a[i+1]) continue;
     else
     {printf("(%c,%d)",a[i],x[y]);
       x[y]=0;
      }}
    getchar();
    getchar();
    getchar();
}
int main()
{
	int i,j;
    char c,s[1000];
    scanf("%s", s);
    for (i=0;i<=999;i++)
    {
		if (s[i]>'Z')
        s[i]=s[i]-32;
		}
        c=s[0];j=1;
        for (i=1;i<=strlen(s);i++)
        {
			if (s[i]==c)
            j++;
            else 
            {  
				printf("(%c,%d)",c,j);
	            j=1;c=s[i];
	  
            }

        }
        return 0;

}
main()
{
      int a[1000]={0},b[1000],l,i,p=0;
      char zm[1000];
      scanf("%s",zm);
      l=strlen(zm);
      b[0]=zm[0];
      for(i=1;i<l;i++)
      {
                      if(zm[i]==zm[i-1]||zm[i]==zm[i-1]-'a'+'A'||zm[i]==zm[i-1]-'A'+'a')
                      a[p]=a[p]+1;
                      else
                      {
                          p=p+1;
                          b[p]=zm[i];
                      }
      }
      for(i=0;i<=p;i++)
      {
                       if(b[i]<='z'&&b[i]>='a')
                       b[i]=b[i]-'a'+'A';
      }
      for(i=0;i<=p;i++)
      {
                       printf("(%c,%d)",b[i],a[i]+1);
      }
}
int main()
{
    char string[1000];
    gets(string);
    int l,i,j,count;
    l=strlen(string);
    for(i=0;i<l;i++)
    {      
           if(string[i]<'A'||string[i]>'Z')
           string[i]=string[i]-'a'+'A';
    }
    for(i=0;i<l;i++)
    {
                    count=0;
                    for(j=i;j<l;j++)
                    {
                                    if(string[i]==string[j])
                                    count++;
                                    else
                                    break;
                    }
                    if(count!=0)
                    {
                    printf("(%c,%d)",string[i],count);
                    i=i+count-1;
                    }
    }
    getchar();
    getchar();
}
int main()
{
	char str[2000];
	int i, t = 0;
	cin >> str;
	for (i = 0; str[i] != '\0'; i++)
	{
		if (str[i] >= 'a' && str[i] <= 'z')
		{
			str[i] = str[i] - 'a' + 'A';
		}
	}
	for (i = 0; str[i] != '\0'; i++)
	{
		if (str[i] == str[i + 1])
		{
			t++;
		}
		else
		{
			t++;
			cout << "(" << str[i] << "," << t << ")";
			t = 0;
		}
	}
	cout << endl;
	return 0;
}
main()
{
      int i,j,k,t;
      int a=1;
      char c[1001];
      scanf("%s",c);
      for(i=1;i<=1000;i++)
      {    
         if(c[i]>=65&&c[i]<97)
         {
             if(c[i]!=c[i-1]&&(c[i]!=c[i-1]-32))
             {
                 if(c[i-1]<97)
                 printf("(%c,%d)",c[i-1],a);
                 else
                 printf("(%c,%d)",c[i-1]-32,a);
                 a=1;
             }
             else
             {
                  a++;
             }
         }
         if(c[i]>=97&&c[i]<=122)
          {
              if(c[i]!=c[i-1]&&c[i]!=(c[i-1]+32))
              {
                  if(c[i-1]<97)
                  printf("(%c,%d)",c[i-1],a);
                  else
                  printf("(%c,%d)",c[i-1]-32,a);
                  a=1;
             }
             else
             {
                  a++;
             }
          }
          if(c[i]=='\0')
          {
              if(c[i-1]<97)
              printf("(%c,%d)",c[i-1],a);
              else
              printf("(%c,%d)",c[i-1]-32,a);
              break;
          }
    }
      
}
int main ()
{
char str[1000],i,m=1,n;
scanf ("%s",str);
for (i=0;i<=100;i++)
{
if (str[i]<='z' && str[i]>='a')
str[i]=str[i]+'A'-'a';
}
i=0;
for (i=0;i<=999;i++)
{
    if (str[i]=='\0')
    {n=i-1;break;}
}
for (i=0;i<=n;i++)
{
    if (str[i]==str[i+1])
    {m=m+1;}
    else
    {printf ("(%c,%d)",str[i],m);m=1;continue;}

}
return 0;
}
int main()
{
	char line[110]={'\0'},out[110]={'\0'};
	int i,n=0,num[110]={0};
	cin.getline(line,110);
	for(i=0;i<strlen(line);i++)
	{
		if(line[i]>='a'&&line[i]<='z')
			line[i]=line[i]-'a'+'A';
	}
    out[0]=line[0];
	num[0]=1;
	for(i=1;i<strlen(line);i++)
	{
		if(out[n]==line[i])
			num[n]++;
		else
		{
			n++;
			out[n]=line[i];
			num[n]++;
		}
	}
	for(i=0;i<=n;i++)
		cout<<"("<<out[i]<<","<<num[i]<<")";
		return 0;
}
int main()
{   
	int i,j,p,q,count=0;
	char f[1000];
	cin.getline(f,1000);
	for(i=0;i<1000;i++)
	{if(f[i]>='a' && f[i]<='z')f[i]=f[i]-'a'+'A';}
	for(p=0;p<strlen(f);p++)
	{   
		if(f[p]=='\0')break;
		if(f[p]=='0')continue;
	    for(q=p+1;q<strlen(f);q++)
			{
			  if(f[q]==f[p]){count++;f[q]='0';}
              else {break;}
			}
		cout<<"("<<f[p]<<","<<count+1<<")";
		f[p]='0';
		count=0;
	}
	return 0;
}
int main()
{
	char c, t;
	int i = 0;
	c = cin.get();
	if (c >= 97)
		c -= 32;
	t = c;
	while (c != '\n')
	{
		if (c >= 97)
			c -= 32;
		if (t == c)
			i++;
		else
		{
			cout << "(" << t << "," << i << ")";
			i = 1;
			t = c;
		}
		c = cin.get();
	}
	cout << "(" << t << "," << i << ")" << endl;
	return 0;
}
int main()
{
    char s[1000],ss[1000];int i,j,l,c[1000];
    scanf("%s",s);
    for(i=0;s[i]!='\0';i++)
    {
    if(s[i]>='a'&&s[i]<='z')
        s[i]=s[i]-32;
    if(s[i]>='A'&&s[i]<='Z')
       s[i]=s[i];
    } 
    ss[0]=s[0];
    j=0;
    for(i=0;s[i]!='\0';i++)
      {
    if(s[i]==ss[j])
       c[j]++;
    else
       {j++;
       ss[j]=s[i];
       c[j]++;}
       }
    for(i=0;i<=j;i++)
      printf("(%c,%d)",ss[i],c[i]);
    getchar();getchar();
       
}
char c[1001]={"\0"};
char temp[1001]={"\0"};
int deal();
int deal1();
int main()
{
	cin>>c;
	deal();
	deal1();
	return 0;
}
int deal()
{
	int i;
	for (i=0;c[i]!='\0';i++)
		if ((c[i]>='a')&&(c[i]<='z'))
			c[i]=c[i]-'a'+'A';
	return 0;
}
int deal1()
{
	int i;
	char word=c[0];
	int times[1001]={0};
	int l=0;
	temp[0]=word;
	for (i=0;c[i]!='\0';i++)
	{
		if (c[i]==word)
		{
			times[l]++;
		}
		else
		{
			l++;
			times[l]=1;
			temp[l]=c[i];
			word=temp[l];
		}
	}
	for (i=0;times[i]!=0;i++)
		cout<<'('<<temp[i]<<','<<times[i]<<')';
	cout<<endl;
	return 0;
}
/*********************88??????**********************
??
??????????????????????????????????????????????????????????????????????????????????"AAABBBBCBB"??????(A,3)(B,4)(C,1)(B,2)??????????????????????????
???????????????????????????
????
??????????0?????1000????????????
????
????????????????(A,3)(B,4)(C,1)(B,2)????????????????????????????
????
aaabbbcccd
?
aAABBbBCCCaaaaa
????
(A,3)(B,3)(C,3)(D,1)
?
(A,3)(B,4)(C,3)(A,5)
********************************************************/
char la(char temp)
{
    if (temp>='A' &&temp<='Z')
        return temp;
    else if (temp>='a'&&temp<='z')
        return temp-'a'+'A';
    else
        cout<<"errer,not ??"<<temp<<endl;
    return temp;
}
int main()
{
    char a[1000];
    cin>>a;
    int length=strlen(a);
    char follow=la(a[0]);
    int same=1;
    for (int i=1 ; i<length ; i++)
    {
        if (la(a[i])==follow)
        {
            same++;
        }
        else
        {
            cout<<"("<<follow<<","<<same<<")";
            same=1;
            follow=la(a[i]);
        }
    }
    cout<<"("<<follow<<","<<same<<")";
    return 0;
}
int main()
{
	char a[1100]={0};
	int i, ans=1;
	cin >> a;
	for (i=0; i<(int)strlen(a); i++)
		if ((a[i]>='a')&&(a[i]<='z'))
			a[i]=a[i]-'a'+'A';
	cout << '(' << a[0] << ',';
	for (i=1; i<(int)strlen(a); i++)
	{
		if (a[i]==a[i-1])
			ans++;
		else
		{
			cout << ans << ")(" << a[i] << ',';
			ans=1;
		}
	}
	cout << ans << ')' << endl;
	return 0;
}