#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ gets(char *);
scalar_t__ isalpha(char);
scalar_t__ isdigit(char);
int /*<<< orphan*/ printf(char *);
scalar_t__ scanf(char *, int *);
int strlen(char *);
int main() {
  int n, m, i, L, doudou;
  char ar[60];
  while (scanf("%d", &n) != EOF) {
    for (m = 1; m <= n; m++) {
      doudou = 0;
      gets(ar);
      L = strlen(ar);
      if (isalpha(ar[0]) || ar[0] == '_') {
        for (i = 1; i < L; i++) {
          if (isalpha(ar[i]) || (ar[i] == '_') || isdigit(ar[i]))
            doudou = 1;
          else {
            doudou = 0;
            break;
          }
        }
        if (doudou == 1)
          printf("yes\n");
        else
          printf("no\n");
      } else
        printf("no\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1080 <scanf@plt>
mov    0x2e62(%rip),%rcx
cmp    (%rcx),%rax
je     12ae <main+0x14e>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     12a9 <main+0x149>
movl   $0x0,-0x18(%rbp)
lea    -0x60(%rbp),%rdi
call   1060 <gets@plt>
lea    -0x60(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
movsbl -0x60(%rbp),%edi
call   1070 <isalpha@plt>
cmp    $0x0,%rax
jne    11de <main+0x7e>
movsbl -0x60(%rbp),%eax
cmp    $0x5f,%eax
jne    128a <main+0x12a>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    125e <main+0xfe>
movslq -0x10(%rbp),%rax
movsbl -0x60(%rbp,%rax,1),%edi
call   1070 <isalpha@plt>
cmp    $0x0,%rax
jne    1233 <main+0xd3>
movslq -0x10(%rbp),%rax
movsbl -0x60(%rbp,%rax,1),%eax
cmp    $0x5f,%eax
je     1233 <main+0xd3>
movslq -0x10(%rbp),%rax
movsbl -0x60(%rbp,%rax,1),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     123f <main+0xdf>
movl   $0x1,-0x18(%rbp)
jmp    124b <main+0xeb>
movl   $0x0,-0x18(%rbp)
jmp    125e <main+0xfe>
jmp    1250 <main+0xf0>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11e5 <main+0x85>
cmpl   $0x1,-0x18(%rbp)
jne    1279 <main+0x119>
lea    0xd94(%rip),%rdi
call   1050 <printf@plt>
jmp    1285 <main+0x125>
lea    0xd88(%rip),%rdi
call   1050 <printf@plt>
jmp    1296 <main+0x136>
lea    0xd77(%rip),%rdi
call   1050 <printf@plt>
jmp    129b <main+0x13b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1196 <main+0x36>
jmp    116f <main+0xf>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
lea    0xe8b(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1080 <scanf@plt>
mov    0x2e62(%rip),%rcx
cmp    (%rcx),%rax
jne    119c <main+0x3c>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x10(%rsp),%rbx
lea    0xe5b(%rip),%r13
lea    0xe57(%rip),%r14
jmp    11dd <main+0x7d>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0xe39(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1080 <scanf@plt>
mov    0x2e10(%rip),%rcx
cmp    (%rcx),%rax
je     118b <main+0x2b>
cmpl   $0x0,0xc(%rsp)
jle    11c0 <main+0x60>
mov    $0x1,%r15d
jmp    1206 <main+0xa6>
nopl   0x0(%rax)
mov    %r14,%rdi
call   1040 <puts@plt>
lea    0x1(%r15),%eax
cmp    0xc(%rsp),%r15d
mov    %eax,%r15d
jge    11c0 <main+0x60>
mov    %rbx,%rdi
call   1060 <gets@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebp
movsbl 0x10(%rsp),%edi
call   1070 <isalpha@plt>
test   %rax,%rax
jne    1231 <main+0xd1>
cmpb   $0x5f,0x10(%rsp)
mov    %r13,%rdi
jne    11f3 <main+0x93>
mov    %r13,%rdi
cmp    $0x2,%ebp
jl     11f3 <main+0x93>
mov    %ebp,%ebp
mov    $0x1,%r12d
jmp    1259 <main+0xf9>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%r12
cmp    %r12,%rbp
je     11f0 <main+0x90>
movsbl 0x10(%rsp,%r12,1),%edi
call   1070 <isalpha@plt>
test   %rax,%rax
jne    1250 <main+0xf0>
movzbl 0x10(%rsp,%r12,1),%eax
cmp    $0x5f,%al
je     1250 <main+0xf0>
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
jne    1250 <main+0xf0>
mov    %r13,%rdi
jmp    11f3 <main+0x93>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [5 x i8] c"yes\0A\00"
@.str.2 = [4 x i8] c"no\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [60 x i8]
store i32 0, i32* %1
br label %8
8: ; preds = %77, %0
%9 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%10 = load i64, i64* @EOF
%11 = icmp ne i64 %9, %10
br i1 %11, label %12, label %78
12: ; preds = %8
store i32 1, i32* %3
br label %13
13: ; preds = %74, %12
%14 = load i32, i32* %3
%15 = load i32, i32* %2
%16 = icmp sle i32 %14, %15
br i1 %16, label %17, label %77
17: ; preds = %13
store i32 0, i32* %6
%18 = getelementptr inbounds [60 x i8], [60 x i8]* %7, i64 0, i64 0
%19 = call i32 @gets(i8* %18)
%20 = getelementptr inbounds [60 x i8], [60 x i8]* %7, i64 0, i64 0
%21 = call i32 @strlen(i8* %20)
store i32 %21, i32* %5
%22 = getelementptr inbounds [60 x i8], [60 x i8]* %7, i64 0, i64 0
%23 = load i8, i8* %22
%24 = call i64 @isalpha(i8 signext %23)
%25 = icmp ne i64 %24, 0
br i1 %25, label %31, label %26
26: ; preds = %17
%27 = getelementptr inbounds [60 x i8], [60 x i8]* %7, i64 0, i64 0
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 95
br i1 %30, label %31, label %71
31: ; preds = %26, %17
store i32 1, i32* %4
br label %32
32: ; preds = %60, %31
%33 = load i32, i32* %4
%34 = load i32, i32* %5
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %63
36: ; preds = %32
%37 = load i32, i32* %4
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [60 x i8], [60 x i8]* %7, i64 0, i64 %38
%40 = load i8, i8* %39
%41 = call i64 @isalpha(i8 signext %40)
%42 = icmp ne i64 %41, 0
br i1 %42, label %57, label %43
43: ; preds = %36
%44 = load i32, i32* %4
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [60 x i8], [60 x i8]* %7, i64 0, i64 %45
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = icmp eq i32 %48, 95
br i1 %49, label %57, label %50
50: ; preds = %43
%51 = load i32, i32* %4
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [60 x i8], [60 x i8]* %7, i64 0, i64 %52
%54 = load i8, i8* %53
%55 = call i64 @isdigit(i8 signext %54)
%56 = icmp ne i64 %55, 0
br i1 %56, label %57, label %58
57: ; preds = %50, %43, %36
store i32 1, i32* %6
br label %59
58: ; preds = %50
store i32 0, i32* %6
br label %63
59: ; preds = %57
br label %60
60: ; preds = %59
%61 = load i32, i32* %4
%62 = add nsw i32 %61, 1
store i32 %62, i32* %4
br label %32
63: ; preds = %58, %32
%64 = load i32, i32* %6
%65 = icmp eq i32 %64, 1
br i1 %65, label %66, label %68
66: ; preds = %63
%67 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %70
68: ; preds = %63
%69 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %70
70: ; preds = %68, %66
br label %73
71: ; preds = %26
%72 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %73
73: ; preds = %71, %70
br label %74
74: ; preds = %73
%75 = load i32, i32* %3
%76 = add nsw i32 %75, 1
store i32 %76, i32* %3
br label %13
77: ; preds = %13
br label %8
78: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@str.3 = [3 x i8] c"no\00"
@str.4 = [4 x i8] c"yes\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [60 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [60 x i8], [60 x i8]* %2, i64 0, i64 0
%5 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %50, label %12
8: ; preds = %44, %12
%9 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = load i64, i64* @EOF
%11 = icmp eq i64 %9, %10
br i1 %11, label %50, label %12
12: ; preds = %0, %8
%13 = load i32, i32* %1
%14 = icmp slt i32 %13, 1
br i1 %14, label %8, label %15
15: ; preds = %12, %44
%16 = phi i32 [ %47, %44 ], [ 1, %12 ]
%17 = call i32 @gets(i8* %4)
%18 = call i32 @strlen(i8* %4)
%19 = load i8, i8* %4
%20 = call i64 @isalpha(i8 signext %19)
%21 = icmp ne i64 %20, 0
%22 = load i8, i8* %4
%23 = icmp eq i8 %22, 95
%24 = select i1 %21, i1 true, i1 %23
br i1 %24, label %25, label %44
25: ; preds = %15
%26 = icmp sgt i32 %18, 1
br i1 %26, label %27, label %44
27: ; preds = %25
%28 = zext i32 %18 to i64
br label %29
29: ; preds = %27, %41
%30 = phi i64 [ 1, %27 ], [ %42, %41 ]
%31 = getelementptr inbounds [60 x i8], [60 x i8]* %2, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = call i64 @isalpha(i8 signext %32)
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %41
35: ; preds = %29
%36 = load i8, i8* %31
%37 = icmp eq i8 %36, 95
br i1 %37, label %41, label %38
38: ; preds = %35
%39 = call i64 @isdigit(i8 signext %36)
%40 = icmp eq i64 %39, 0
br i1 %40, label %44, label %41
41: ; preds = %38, %35, %29
%42 = add nuw nsw i64 %30, 1
%43 = icmp eq i64 %42, %28
br i1 %43, label %44, label %29
44: ; preds = %38, %41, %15, %25
%45 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @str.3, i64 0, i64 0), %25 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @str.3, i64 0, i64 0), %15 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0), %41 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @str.3, i64 0, i64 0), %38 ]
%46 = call i32 @puts(i8* dereferenceable(1) %45)
%47 = add nuw nsw i32 %16, 1
%48 = load i32, i32* %1
%49 = icmp slt i32 %16, %48
br i1 %49, label %15, label %8
50: ; preds = %8, %0
ret i32 0
}