semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main(){
  int n,i;
  char *p;
  scanf("%d\n",&n);
  char s[n][81];
  for(i=0;i<n;i++)
    gets(s[i]);
  for(i=0;i<n;i++){
    int a=1;
    p=s[i];
    if(*p>='A'&&*p<='Z'||*p=='_'||*p>='a'&&*p<='z'){
      p++;
      while(*p!=0){
        if(*p<'0'||*p>'9'&&*p<'A'||*p>'Z'&&*p!='_'&&*p<'a'||*p>'z'){
          a=0;
          break;
          }
        p++;
        }
      }
    else
      a=0;
    if(a==1)  
    printf("yes\n");
    if(a==0)
    printf("no\n");
    }
   
  }
int main ()
{
	int i,n,len[1000],m[1000],j,l=0;
	char s[1000][21];
	scanf("%d",&n);

    for(i=0;i<n;i++)
	{	l=0;
		scanf("%s",s[i]);
		len[i]=strlen(s[i]);
		if ((s[i][0]>='A' && s[i][0]<='Z')||(  s[i][0]>='a' && s[i][0]<='z')|| (s[i][0]=='_'))
		{
		  m[i]=0;
		}
                   else m[i]=1;	
        		for(j=1;j<len[i];j++)
		{

       
           if ((s[i][j]>='A' && s[i][j]<='Z')|| ( s[i][j]>='a' && s[i][j]<='z')|| (s[i][j]=='_')||(s[i][j]<='9'&&s[i][j]>='0'))
		   {
		      l++;
		   }
		}
				if(l==len[i]-1 && m[i]==0)
			  printf("yes\n");
		else printf("no\n");
	}
	return 0;
	}
int main()
{
    int i, j, n;                
    char s[MAX+1];               
    scanf("%d", &n);             
    for (i = 0; i < n; i++) {  
        scanf("%s", s);         
        for (j = 0; s[j]; j++) { 
            if (!((s[j] == '_') ||    
                  (s[j] >= 'A' && s[j] <= 'Z') ||  
                  (s[j] >= 'a' && s[j] <= 'z') ||   
                  (s[j] >= '0' && s[j] <= '9' && j > 0)))
                                               
                break;          
        }
        if(s[j]==0){
          printf(  "yes\n"); }
       if(s[j]!=0){
         printf(  "no\n"); }
    }   
    return 0;
}
int main(){
int n,result=0;
char x[1000][21];
scanf("%d",&n);
 for(int i=0;i<n;i++){
    scanf("%s",x[i]);
 }
  for(int j=0;j<n;j++){
    if(((x[j][0]>='a')&&(x[j][0]<='z'))||((x[j][0]>='A')&&(x[j][0]<='Z'))||(x[j][0]=='_')){
      for(int k=1;x[j][k]!='\0';k++){
        if(((x[j][k]>='a')&&(x[j][k]<='z'))||((x[j][k]>='0')&&(x[j][k]<='9'))||((x[j][k]>='A')&&(x[j][k]<='Z'))||(x[j][k]=='_')) {
        }


        else{
            result=1;
        }
      }
    }
     else{
          result=1;
      }
   if(result==0){printf("yes\n");}else{printf("no\n");};
  result=0;
  }
 return 0;
}
int main(){
 char str[100][22];
 int len,n,m;
    scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%s",&str[i]);
		len=strlen(str[i]);
		m=0;
		if(((str[i][0]>='A')&&(str[i][0]<='Z'))||((str[i][0]>='a')&&(str[i][0]<='z'))||(str[i][0]==95)){
		for (int j=1;j<len;j++)
		{
			if((('A'<=str[i][j])&&(str[i][j]<='Z'))||(('a'<=str[i][j])&&(str[i][j]<='z'))||(str[i][j]==95)||((48<=str[i][j])&&(str[i][j]<=57))){
		    continue;
			}else{
				printf("no\n");
                m=1;
				break;
			}
		}
		if(m==0){
			printf("yes\n");}
		}else{
			printf("no\n");
		}
	}
	return 0;
}
int judge(char c[])
{
	int j=1,k=1;
	if((c[0]<='Z'&&c[0]>='A')||(c[0]<='z'&&c[0]>='a')||c[0]=='_')
		while(c[k]!='\0')
			if((c[k]<='Z'&&c[k]>='A')||(c[k]<='z'&&c[k]>='a')||c[k]=='_'||(c[k]<='9'&&c[k]>='0'))
			k++;
			else {j=0;break;}
	else j=0;
	return(j);
}
void main()
{
	int i,n;
	char c[21]={0};
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%s",c);
		if(judge(c)==1)printf("yes\n");
		else printf("no\n");
	}
}
int main(){
int n,m;
char sb[24];
scanf("%d",&n);
for(int i=0;i<n;i++){
m=0;
scanf("%s",sb);
for(int k=0;sb[k]!='\0';k++){
if(!((sb[k]=='_')||(sb[k]>='0'&&sb[k]<='9')||(sb[k]>='a'&&sb[k]<='z')||(sb[k]>='A'&&sb[k]<='Z'))){
m=1;
}
}
if(!(sb[0]=='_'||(sb[0]>='a'&&sb[0]<='z')||(sb[0]>='A'&&sb[0]<='Z'))){
m=1;
}
if(m==1) printf("no\n");
else printf("yes\n");
}
return 0;
}
void p(char a[],int n)
{
	int i,j;
	if(a[0]!='_'&&(a[0]<'a'||a[0]>'z')&&(a[0]<'A'||a[0]>'Z'))
		printf("no\n");
	else
	{
		for(j=1;j<n;j++)
			if(a[j]!='_'&&(a[j]<'a'||a[j]>'z')&&(a[j]<'A'||a[j]>'Z')&&(a[j]<'0'||a[j]>'9'))
			{
				printf("no\n");
				break;
			}
		if(j==n)
			printf("yes\n");
	}
}
int main()
{
	int n,i,m;
	char a[30],b;
	scanf("%d",&n);
	b=getchar();
	for(i=0;i<n;i++)
	{	
		scanf("%s",a);
		m=strlen(a);
		p(a,m);
	}
}
int main ()
{
    char zs[max+1];
    int n,i,j,c;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%s",zs);
		c = 0;

        if(((zs[0]>='a')&&(zs[0]<='z'))||((zs[0]>='A')&&(zs[0]<='Z'))||zs[0]=='_')
            {
				for(j=1;zs[j]!='\0';j++)
				{

				  if(((zs[j]>='a')&&(zs[j]<='z'))||((zs[j]>='A')&&(zs[j]<='Z'))||(zs[j]=='_')||((zs[j]>='0')&&(zs[j]<='9')))
					   c++;
				}
				 if(c==strlen(zs)-1)
					printf("yes\n");
				 else
					printf("no\n");
            
            }
        else	
        {
            printf("no\n");
        }

    }

    return 0;
}
void main()
{
	int n,i,j,flag;
	char str[100][25];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%s",str[i]);
	}
	for(i=0;i<n;i++)
	{
		if((str[i][0]>='a'&&str[i][0]<='z')||(str[i][0]>='A'&&str[i][0]<='Z')||str[i][0]=='_')
			flag=0;
		else flag=1;
		if(flag==0)
		{
			for(j=1;str[i][j]!='\0';j++)
			{
				if((str[i][j]>='0'&&str[i][j]<='9')||(str[i][j]>='a'&&str[i][j]<='z')||(str[i][j]>='A'&&str[i][j]<='Z')||str[i][j]=='_')
					flag=0;
				else 
				{
					flag=1;
					break;
				}
			}
		}
		if(flag==0)
			printf("yes\n");
		else printf("no\n");
	}
}
int main(){
	char a[100][21];
	int i,n,j,b;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s",&a[i]);
	}
	for(i=0;i<n;i++){
		b=strlen(a[i]);
		for(j=0;j<b;j++){
			if(!((a[i][j]=='_')||(a[i][j]>='A'&&a[i][j]<='Z')||(a[i][j]>='a'&&a[i][j]<='z')||(a[i][j]>='0'&&a[i][j]<='9'&&j!=0))){
				a[i][0]='n';
				a[i][1]='o';
				a[i][2]='\0';
				break;
			}
			
		}

		
	}
	for(i=0;i<n;i++){
	if(strcmp(a[i],"no")!=0){
		a[i][0]='y';
		a[i][1]='e';
		a[i][2]='s';
		a[i][3]='\0';
	}
	}
	for(i=0;i<n;i++){
		printf("%s\n",a[i]);
	}
	return 0;
}
int main(){
	int n, i, c, j;
	char s[30];
	scanf("%d", &n);
	for(i=1;i<=n;i++){
		scanf("%s",s);
		c=0;
		j=0;
		if((s[0]=='_')||('a'<=s[0]&&s[0]<='z')||('A'<=s[0]&&s[0]<='Z')){
			for(j=1;s[j]!='\0';j++){
				if(('0'<=s[j]&&s[j]<='9')||(s[j]=='_')||('a'<=s[j]&&s[j]<='z')||('A'<=s[j]&&s[j]<='Z')){
					c++;
				}
			}
			if(c==j-1){
				printf("yes\n");
			}
			else 	printf("no\n");
		}
	else printf("no\n");	 
	}
	
		return 0;
	}
int ismin(char x)
{
    if(x=='a'||x=='b'||x=='c'||x=='d'||x=='e'||x=='f'||x=='g'||x=='h'||x=='i'||x=='j'||x=='k'||x=='l'||x=='m'||x=='n'||x=='o'||x=='p'||x=='q'||x=='r'||x=='s'||x=='t'||x=='u'||x=='v'||x=='w'||x=='x'||x=='y'||x=='z')
        return 1;
    else
        return 0;
}
int ismax(char x)
{
    if(x=='A'||x=='B'||x=='C'||x=='D'||x=='E'||x=='F'||x=='G'||x=='H'||x=='I'||x=='J'||x=='K'||x=='L'||x=='M'||x=='N'||x=='O'||x=='P'||x=='Q'||x=='R'||x=='S'||x=='T'||x=='U'||x=='V'||x=='W'||x=='X'||x=='Y'||x=='Z')
        return 1;
    else
        return 0;
}
int isalpha(char x)
{
    if(ismin(x)||ismax(x))
        return 1;
    else
        return 0;
}
int isalnum(char x)
{
    if(x=='1'||x=='2'||x=='3'||x=='4'||x=='5'||x=='6'||x=='7'||x=='8'||x=='9'||x=='0'||isalpha(x))
        return 1;
    else
        return 0;
}
int istrue(char buf[30])
{  
    int i=1;
    if(isalpha(buf[0])||buf[0]=='_') 
    {
        while(buf[i]!='\0')
        {
            if(isalnum(buf[i])||buf[i]=='_'){
                i++;
                continue;
            }else{
                return 0;
            }
        }
        return 1;
    }else
        return 0;
}
int main()
{
    char buf[30];
    int i,n;
    scanf("%d\n",&n);
    for(i=0;i<n;i++)
    {
        scanf("%s",&buf);
        if(istrue(buf)==1)
            printf("yes\n");
        else
            printf("no\n");
    }
    return 0;
}
int flag(char a[])
{
    int i,k=1;
    if (a[0]<65||(a[0]>90&&a[0]<95)||(a[0]>95&&a[0]<97)||a[0]>122) {return 0;}
    else 
    {
         for (i=1;i<strlen(a);i++)
         if(a[i]<48||(a[i]>57&&a[i]<65)||(a[i]>90&&a[i]<95)||(a[i]>95&&a[i]<97)||a[i]>122) {return 0;}
    }
    return 1;
}
void main ()
{
     int i,j,n;
     char a[21];
     scanf ("%d",&n);
     for (i=0;i<n;i++)
     {   scanf(" ");
         gets(a);
         if (flag(a)) printf ("yes\n");
         else printf ("no\n");
     }
     
}
int main()
{
    int n,i,k,s;
    scanf("%d",&n);
    char zfc[100];
    for(k=0;k<n;k++){
        scanf("%s",zfc);
        for(i=0;i<strlen(zfc);i++){
            s=1;
        if((i==0&&(zfc[0]=='_'||(zfc[0]>='a'&&zfc[0]<='z')||(zfc[0]>='A'&&zfc[0]<='Z')))||(i!=0&&((zfc[i]=='_'||(zfc[i]>='0'&&zfc[i]<='9')||(zfc[i]>='a'&&zfc[i]<='z')||(zfc[i]>='A'&&zfc[i]<='Z')))))
        {s=1;
        }else{s=0;
        break;}
        }
        if(s==1){printf("yes\n");}else{printf("no\n");}
            }
            
            return 0;
            }
int main()
{
int n,i,c,a;
scanf("%d",&n);
char szpand[n][20];
for(i=0;i<n;i++){
scanf("%s",szpand[i]);
}
int flag;
for(i=0;i<n;i++){
    flag=1;
    if(szpand[i][0]=='0'||szpand[i][0]=='1'||szpand[i][0]=='2'||szpand[i][0]=='3'||szpand[i][0]=='4'||szpand[i][0]=='5'||szpand[i][0]=='6'||szpand[i][0]=='7'||szpand[i][0]=='8'||szpand[i][0]=='9')
    flag=0;
    for(c=0;c<strlen(szpand[i]);c++){
        a=szpand[i][c];
        if(a>=123&&a<=127||a>=91&&a<=94||a==96||a>=58&&a<=64||a<=47)
{flag=0;break;}
    }
if(!flag)
printf("no\n");
else
printf("yes\n");
}

return 0;
}
void main()
{
	char c[20][50];
	int i,j,n,t;
	scanf("%d",&n);
	for(i=0;i<=n-1;i++){
		scanf("%s",c[i]);
		}
	for(i=0;i<=n-1;i++){
		if(!((c[i][0]>='a'&&c[i][0]<='z')||(c[i][0]>='A'&&c[i][0]<='Z')||c[i][0]=='_')){
			t=0;
			}
		else{ 
			for(j=1;c[i][j
				]!='\0';j++){
				if(!((c[i][j]>='a'&&c[i][j]<='z')||(c[i][j]>='A'&&c[i][j]<='Z')||(c[i][j]>='0'&&c[i][j]<='9')||c[i][j]=='_')){
					t=0;
					break;
					}
				t=1;
				}
			}
		if(t==1){
			printf("yes\n");
		}
		if(t==0){
			printf("no\n");
		}
	}
}
void main()
{
	int i,b,n,l,m;
	char a[21];
	scanf("%d",&n);
	for(b=0;b<n;b++)
	{
		scanf("%s",a);
		l=strlen(a);
		for(i=0;i<l;i++)
		{
			m=(int)(a[i]);
			if(i==0)
			{
				if((m>=65&&m<=90)||(m>=97&&m<=122) || a[i]=='_')
				{
					continue;
				}
				else
				{
					break;
				}
			}
			if(i!=0)
			{
				if((m>=65&&m<=90)||(m>=97&&m<=122) || (a[i]=='_')||(m>=48&&m<=57))
				{
					continue;
				}
				else
				{
					break;
				}
			}
		}
	    if(i==l)
		{
		    printf("yes\n");
		}
	    else
		{
		    printf("no\n");
		}
	}
}
int main()
{
	int n,i,k,t=0;
	char str[100][20];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%s",str[i]);
	}
	for(i=0;i<n;i++)
	{
		if(str[i][0]>='0'&&str[i][0]<='9')
		{
			printf("no\n");
			continue;
		}
		int m=strlen(str[i]);
		t=0;
		for(k=0;k<m;k++)
		{
			
			if((str[i][k]=='_')||((str[i][k]>='a')&&(str[i][k]<='z'))||((str[i][k]>='A')&&(str[i][k]<='Z'))||(str[i][k]>='0')&&(str[i][k]<='9'))
			{
				t++;
			}
			else
			{
				printf("no\n");
				break;
			}
			if(t==m)
			{
				printf("yes\n");
				break;
			}
		}
		
	}
	return 0;
}
int main()
{
	int i,n,len,j;
	char str[21]={0};
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
loop:		scanf("%s",str);
		len=strlen(str);
		if(str[0]=='_' || (str[0]>='a' && str[0]<='z') || (str[0]>='A' && str[0]<='Z'))
		{}
		else
		{
			printf("no\n");
			continue;
		}
		for(j=1;j<len;j++)
		{
			if(str[j]=='_' || (str[j]>='a' && str[j]<='z') || (str[j]>='A' && str[j]<='Z') || (str[j]>='0' && str[j]<='9'))
			{}
			else
			{	
				printf("no\n");
				i++;
				if(i<n)
					goto loop;
				else
					return 0;
			}
		}
		printf("yes\n");
	}
	return 0;
}
int main(){
    int n,i,j,p=1,l[100];
    char c[100][20];
    scanf("%d",&n);
    for(i=0;i<n;i++){
    scanf("%s",c[i]);
    l[i]=strlen(c[i]);        
           }
    for(i=0;i<n;i++){
    if(c[i][0]<'A'||(c[i][0]>'Z'&&c[i][0]<'a'&&c[i][0]!='_')||c[i][0]>'z')
    {p=0;
    printf("no\n");
     }
    else if((c[i][0]>='a'&&c[i][0]<='z')||(c[i][0]>='A'&&c[i][0]<='Z')||(c[i][0]>='0'&&c[i][0]<='9'))
    {p=1;
    
      for(j=1;j<l[i];j++)
    {if(c[i][j]<'0'||(c[i][j]>'9'&&c[i][j]<'A')||(c[i][j]>'Z'&&c[i][j]<'a'&&c[i][j]!='_')||c[i][j]>'z')
    {p=0;
    printf("no\n");
    break;}      
                 }         
                 }    
    if(p==1)
    printf("yes\n");
    p=1;
                     }
    return 0;
    }
int main(){
	int x, y,i,d;
	scanf("%d",&y);
	char h[21];
	for(x=0;x<y;x++){
	scanf("%s",h);
         d=0;
  if((h[0]>='a'&&h[0]<='z')||(h[0]>='A'&&h[0]<='Z')||(h[0]=='_')){
             d++;
}
	for(i=1;i<strlen(h);i++){
		if((h[i]>='a'&&h[i]<='z')||(h[i]>='A'&&h[i]<='Z')||(h[i]=='_')||(h[i]>='0'&&h[i]<='9')){
			d++;
		}
	}
	if(d==strlen(h)){
		printf("yes\n");
	}else{
		printf("no\n");
	}
	}
	return 0;
}
int judge(char c[21],int n)
{
    int i;
    i=0;
    if  (c[0]>='a'&&c[0]<='z'||c[0]>='A'&&c[0]<='Z'||c[0]=='_')
    {
        while  ((c[i]>='a'&&c[i]<='z'||c[i]>='A'&&c[i]<='Z'||c[i]=='_'||c[i]>='0'&&c[i]<='9')&&i<n)
        i++;
        if  (i==n)
        return 1;
        else
        return 0;
    }
    else
    return 0;
}

main()
{
      char c[21];
      int n,m,i;
      
      scanf("%d\n",&n);
      for  (i=1;i<=n;i++)
      {
           gets(c);
           m=strlen(c);
           if(judge(c,m))
           printf("yes\n");
           else
           printf("no\n");
      }

}
void main()
{
	int i,j=1,n,m;
	char a[100][21];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%s",a[i]);
		if((a[i][0]>='a'&&a[i][0]<='z')||(a[i][0]>='A'&&a[i][0]<='Z')||a[i][0]=='_')
		{
			m=0;
			for(j=1;a[i][j]!='\0';j++)
			{
				if((a[i][j]>='a'&&a[i][j]<='z')||(a[i][j]>='A'&&a[i][j]<='Z')||a[i][j]=='_'||(a[i][j]>='0'&&a[i][j]<='9'))continue;
				else {printf("no\n");m=1;break;}
			}
			if(m=1&&j==strlen(a[i]))printf("yes\n");
		}
		else printf("no\n");
	
	}

}
int main()
{
    char c[100][100];
	int m,i,a[100];
	unsigned j;
	cin>>m;
	for(i=0;i<m;i++)
		a[i]=1;
	for(i=0;i<m;i++)
	{
		cin>>c[i];
	}
	for(i=0;i<m;i++)
	{
		for(j=0;j<strlen(c[i]);j++)
		{
			if(c[i][0]!='_'&&(c[i][0]<'A'||c[i][0]>'z'||c[i][0]>'Z'&&c[i][0]<'a'))
			{
				a[i]=0;
				break;
			}
			if(c[i][j]!='_'&&(c[i][j]<'A'||c[i][j]>'z'||c[i][j]>'Z'&&c[i][j]<'a')&&(c[i][j]<'0'||c[i][j]>'9'))
			{
				a[i]=0;
				break;
			}
		}
	}
	for(i=0;i<m;i++)
	{
		if(a[i]==0)cout<<"no"<<endl;
		else cout<<"yes"<<endl;
	}
	return 0;
}
int main()
{
	int n;
	cin>>n;
	while(n>0)
	{
		char str[30];
		cin>>str;
		int i;
		int flag=1;
		if(str[0]=='_'||(str[0]>=65&&str[0]<=90)||(str[0]>=97&&str[0]<=122))
		{
			for(i=1;i<strlen(str);i++)
			{
				if(str[i]=='_'||str[i]>=65&&str[i]<=90||str[i]>=97&&str[i]<=122||str[i]>=48&&str[i]<=57)
					continue;
				else {cout<<"no"<<endl;flag=0;break;}
			}
		}
		else {cout<<"no"<<endl;flag=0;}
		if(flag==1)
			cout<<"yes"<<endl;
		n--;
	}
	return 0;
}
int is_legal(char name[20], int length);
int first_lg(char trig);
int illegal_sym(char name[20], int length);
main()
{
      int n;
      int length;
      int i;
      char name[100][20];
      int ok[100];

      scanf("%d", &n);
      
      for(i = 0;i <= n - 1;i ++)
      {
            scanf("%s", &name[i]);
            length = strlen(name[i]);
      
            ok[i] = is_legal(name[i], length);
      }
      
      for(i = 0;i <= n - 1;i ++)
      {
       if(ok[i]) printf("yes\n"); else printf("no\n");
       }
}

int is_legal(char name[20], int length)
{
    //printf("First char:%d\n", first_lg(name[0]));
    //printf("General:%d\n", illegal_sym(name, length));
    if(!first_lg(name[0])) return FALSE;
    if(!illegal_sym(name, length)) return FALSE;
    return TRUE;
}

int first_lg(char trig)
{
    int is1, is2, is3;
    char ch;
    
    ch = (toupper(trig));
    
    is1 = (ch > 'Z');
    is2 = (ch < 'A');
    
    if(trig == '_') return TRUE;
    if(is1 + is2 != 0) return FALSE;
    return TRUE;
}

int illegal_sym(char name[20], int length)
{
    int i;
    char ch;
    int is_al, is_num, is_dash;
    int is;
    for(i = 0;i <= length - 1;i ++)
    {
          ch = toupper(name[i]);
          is_al = (ch <= 'Z') && (ch >= 'A');
          is_num = (ch <= '9') && (ch >= '0');
          is_dash = (ch == '_');
          is = (is_al || is_num || is_dash);
          
          if(!is)
          {
                 //printf("Bug section:%d\nchar:%c\n", i + 1, ch);
                 return FALSE;
          }
    }
    return TRUE;
}
int main()
{
	int n,i,j,p=0;
	char s[30];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s",s);
		int z=strlen(s);
		for(j=0;j<z;j++)
		{
			if(j==0&&(s[j]>'/'&&s[j]<':')){
				printf("no\n");
				break;}
			if(s[j]>'/'&&s[j]<':')
				p++;
			else 
				p+=0;
			if(s[j]>'@'&&s[j]<'[')
					p++;
			else 
				p+=0;
			if(s[j]>'a'&&s[j]<'z')
					p++;
			else 
				p+=0;
			if(s[j]=='a'||s[j]=='z')
					p++;
			else 
				p+=0;
			if(s[j]=='_')
					p++;
			else 
				p+=0;
			
		}
		
		
		if(p==z)
			printf("yes\n");
		else if(p!=0)
			printf("no\n");
		p=0;
	}
	return 0;
}
int main(){
	char s[10000][21];
	int n,i,j;
    int c[10000]={0},d[10000]={0};
    scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s",&(s[i]));  
	}
	for(i=0;i<n;i++){
		if(s[i][0]=='_'||(s[i][0]>='a'&&s[i][0]<='z')||(s[i][0]>='A'&&s[i][0]<='Z')){
			d[i]++;
		}
        else{
			c[i]=1;
		}
		for(j=0;s[i][j]!='\0';j++){
			if((s[i][j]>='a'&&s[i][j]<='z')||(s[i][j]>='A'&&s[i][j]<='Z')||(s[i][j]>='0'&&s[i][j]<='9')||s[i][j]=='_'){
				continue;
			}
		    else{
				c[i]=1;
			}
		}
	}
	for(i=0;i<n;i++){
	if(c[i]==0){
			printf("yes\n");
		}
		else{
			printf("no\n");
		}

	}
	return 0;
}
char juzi[1000];
int islegal(char juzi[],int n)
{
	int q;
	if((juzi[0]>'z'||juzi[0]<'a')&&(juzi[0]>'Z'||juzi[0]<'A')&&juzi[0]!='_')
		return 0;
	for(q=1;q<n;q++)
	{
		if((juzi[q]>'z'||juzi[q]<'a')&&(juzi[q]>'Z'||juzi[q]<'A'))
		{
			if(juzi[q]>'9'||juzi[q]<'0')
			{
				if(juzi[q]!='_')
					return 0;
			}
		}
	}
	return 1;
}


	
	
	
void main()
{	
	int n;
	char m[6];
	gets(m);
	n=atoi(m);
	while(n--)
	{
		gets(juzi);
		int len=strlen(juzi);
		if(islegal(juzi,len)==1)
			printf("yes\n");
		else
			printf("no\n");
	}
}
int main()
{
	int n; 
	
	cin >> n;
	for(int i=0; i<n; i++) {
		char str[100];
		cin >> str;
		if(strlen(str) > 20) {
			cout << "no" << endl;
			continue;
		}
		int j;
		if(str[0] >= '0' && str[0] <= '9') {
			cout << "no" << endl;
			continue;
		}
		for(j=0; j<strlen(str); j++) {
			if(str[j] >= 'A' && str[j] <= 'Z' || 
				str[j] >= 'a' && str[j] <= 'z' ||
				str[j] >= '0' && str[j] <= '9' ||
				str[j] == '_' ) {
				continue;
			} else {
				cout << "no" << endl;
				break;
			}
		}
		if(j == strlen(str)) cout << "yes" << endl;
	}


	return 0;
}
int main(){
	int n,m,i,j,a[2000];
	char b[21];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s",b);
		m=strlen(b);
		for(j=0;j<m;j++){
			if(j==0&&((b[j]>=65&&b[j]<=90)||(b[j]>=97&&b[j]<=122)||b[j]=='_'))
				a[i]=1;
			else if(j!=0&&((b[j]>=65&&b[j]<=90)||(b[j]>=97&&b[j]<=122)||(b[j]>=48&&b[j]<=57)||b[j]=='_'))
				a[i]=1;
			else{
				a[i]=0;
				break;
			}
		}
	}
	for(i=0;i<n;i++){
		if(a[i])
			printf("yes\n");
		else
			printf("no\n");
	}
	return 0;
}
int main(){
    char zfc[100][21];
    int n,i,k;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {scanf("%s",zfc[i]);
    }
    for(i=0;i<n;i++)
    {if((zfc[i][0]>='A'&&zfc[i][0]<='Z')||zfc[i][0]>='a'&&zfc[i][0]<='z'||zfc[i][0]=='_')
    {   int m=strlen(zfc[i]),c=0;
        for(k=1;k<m;k++)
        {
        if((zfc[i][k]>='0'&&zfc[i][k]<='9')||(zfc[i][k]>='A'&&zfc[i][k]<='Z')||(zfc[i][k]>='a'&&zfc[i][k]<='z')||zfc[i][k]=='_')
        {
            c++;
        }
    
        }if(c==(m-1)){
            printf("yes\n");
        }else{printf("no\n");}
    }else{
        printf("no\n");      
         }
    }
      return 0;  
    
}
int main()
{
int n;
scanf("%d",&n);
char s[100];
int m;
int i;
int p;
for(i=1;i<=n;i++)
{
	scanf("%s",s);
	for(m=0;s[m];m++)
	{
		if((s[0]=='_')||(s[0]>='A'&&s[0]<='Z')||(s[0]>='a'&&s[0]<='z'))
			p=1;
		else
		{
			p=0;
			break;
		}
		if((s[m]=='_')||(s[m]>='A'&&s[m]<='Z')||(s[m]>='a'&&s[m]<='z')||(s[m]>='0'&&s[m]<='9'))
			p=1;
		else
		{
			p=0;
			break;
		}
	}
	if(p==1)
		printf("yes\n");
	else
		printf("no\n");

}
			
		

return 0;
}
int main()
{
	int n;
	scanf("%d",&n);
	int i = 0;
	char p[22];
	int j;
	int error;
	do
	{
		scanf("%s",p);
		j = 0;
		error = 0;
		do 
		{
			if ( j == 0 )
			{
				if ( p[j] < 'a' || p[j] > 'z')
				{
					if ( p[j] < 'A' || p[j] > 'Z' )
					{
						if ( p[j] != '_')
						{
							printf("no\n");
							error = 1;
							break;
						}
					}
				}
			}

				
			if ( p[j] < 'a' || p[j] > 'z')
			{
				//printf("a%c\n",p[j]);
				if ( p[j] < 'A' || p[j] > 'Z' )
				{
					//printf("A%c\n",p[j]);
					if ( p[j] < '0' || p[j] > '9' )
					{
						if ( p[j] != '_')
						{
							printf("no\n");
							error = 1;
							break;
						}
					}
				}
			}
			j++;
		}while ( p[j] != '\0' );
		if ( error == 0 )
		{
			printf("yes\n");
		}
		i++;
	}while ( i < n );
	return 0;
}
int main()
{
	int i,j,n,count;
	cin>>n;
	char s[25];	
	for(i=0;i<n;i++)
	{
		cin>>s;
		if((s[0]>='a'&&s[0]<='z')||(s[0]>='A'&&s[0]<='Z')||(s[0]=='_'))
		{
			count=1;
		}
		else
		{
			count=0;
		}
		for(j=1;j<strlen(s);j++)
		{
			if((s[j]>='0'&&s[j]<='9')||(s[j]>='a'&&s[j]<='z')||(s[j]>='A'&&s[j]<='Z')||(s[j]=='_'))
			{
				count+=1;
			}
		}
		if(count==strlen(s))
		{
			cout<<"yes"<<endl;
		}
		else
		{
			cout<<"no"<<endl;
		}
	}
	return 0;
}
int main(){
	int n,i,j,a=1;
	char z[100][21];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s",z[i]);
	}
	for(i=0;i<n;i++){
		if(z[i][0]=='_'||(z[i][0]>='A'&&z[i][0]<='Z')||(z[i][0]>='a'&&z[i][0]<='z')){
			for(j=1;z[i][j]!='\0';j++){
				if(z[i][j]=='_'||(z[i][j]>='A'&&z[i][j]<='Z')||(z[i][j]>='a'&&z[i][j]<='z')||(z[i][j]>='0'&&z[i][j]<='9')){
					a=a*1;
				}else{
					a=a*0;
				}
			}
		}else{
			a=a*0;
		}
		if(a==1){
			printf("yes\n");
		}else{
			printf("no\n");
			a=1;
		}
	}
	return 0;
}
int main()
{
	int n,i,j,l;
	char word[100];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%s",word);
		l=strlen(word);
		if(word[0]<='z'&&word[0]>='a'||word[0]<='Z'&&word[0]>='A'||word[0]==' '||word[0]=='_')
			;
		else
			{
				printf("no\n");
				continue;
			}
		for(j=1;j<l;j++)
		{
				if(word[j]<='9'&&word[j]>='0'||word[j]<='z'&&word[j]>='a'||word[j]<='Z'&&word[j]>='A'||word[j]==' '||word[j]=='_')
					;
				else
				{
					printf("no\n");
					goto MQ;
				}
				
		}
		printf("yes\n");
MQ:;
	}
	return 0;
}
void main()
{
	char c[20];
	int n,i,j,m;
	scanf("%d",&n);
	getchar();
	for(j=0;j<n;j++)
	{
		gets(c);
		m=0;
		if(c[0]<65||(c[0]>90&&c[0]<95)||c[0]==96||c[0]>122)
			printf("no\n");
		else
		{
			for(i=1;c[i]!='\0';i++)
			{
				if(c[i]<48||(c[i]>57&&c[i]<65)||(c[i]>90&&c[i]<95)||c[i]==96||c[i]>122)
					m=m+1;
			}
			if(m==0)
				printf("yes\n");
			else
				printf("no\n");
		}
	}
}
int main ()
{
	int n,i,j,leng;
	scanf ("%d",&n);
	char s[100][20];
	for (i=0;i<n;i++)
	{
		scanf ("%s",s[i]);
	}
	for (i=0;i<n;i++)
	{
		leng=strlen(s[i]);
		for (j=0;j<leng;j++)
		{
			if (s[i][j]!='_'&&j==0&&(s[i][j]<'A'||(s[i][j]>'Z'&&s[i][j]<'a')||(s[i][j]>'z')))
			{
				printf ("no\n");
				break;
			}
            if (j!=0)
			{
			   if (s[i][j]!='_'&&s[i][j]<'0'||(s[i][j]>'9'&&s[i][j]<'A')||(s[i][j]>'Z'&&s[i][j]<'a')||(s[i][j]>'z'))
			   {
				  printf ("no\n");
				  break;
			   }
			}
		}
		if (j==leng)printf("yes\n");
	}
	return 0;
}
int decide(char k)
{
	if ((isdigit(k)==0)&&(isalpha(k)==0)&&(k!=95))
		return 0;
	else
		if (isdigit(k)==1)
			return 2;
		else
			return 1;
}


int main()
{
	int n,j,m,i;
	char a[500][20]={0};
	scanf("%d\n",&n);
	for (i=1;i<=n;i++)
	{
		gets(a[i]);
		m=strlen(a[i]);
		if (decide(a[i][0])!=1)
		{
			printf("no\n");
			continue;
		}
		else
		{
			j=1;
			while (j<m)
			{
				if (decide(a[i][j])==0)
					j=m+2;
				else
					j=j+1;
			}
			if (j==m)
				printf("yes\n");
			else
				printf("no\n");
		}
	}
return 0;
}
int main()
{
	int n,t;
	char a[100][21];
	cin>>n;
	cin.get();
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	for(int i=0;i<n;i++)
	{
		int tag=0;
		if(!((a[i][0]>='a'&&a[i][0]<='z')||(a[i][0]>='A'&&a[i][0]<='Z')||a[i][0]=='_'))
		{
			cout<<"no"<<endl;
			continue;
		}
		else
		{
			t=strlen(a[i]);
			for(int j=1;j<t;j++)
			{
				if((a[i][j]>='a'&&a[i][j]<='z')||(a[i][j]>='A'&&a[i][j]<='Z')||(a[i][j]>='0'&&a[i][j]<='9')||a[i][j]=='_')
					continue;
				else {
					tag=1;
					cout<<"no"<<endl;
					break;
			}
			}
			if(tag==0)
			 cout<<"yes"<<endl;
	}
	}
	return 0;
}