#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 */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
int strlen(char *);
void main() {
  int t, i, out = 0;
  char str[101];
  scanf("%d", &t);
  while (t--) {
    scanf("%s", str);
    for (i = 0; i < strlen(str); i++) {
      if (str[i] >= 43 && str[i] <= 122) {
        if (str[i] == 'D' || str[i] == '0' || str[i] == 'j')
          out = out + 1;
      } else
        break;
    }
    if (out > 0)
      printf("YES\n");
    else
      printf("NO\n");
    out = 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0xc(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
je     1256 <main+0x126>
lea    -0x80(%rbp),%rsi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x84(%rbp)
lea    -0x80(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x84(%rbp),%eax
cmp    %ecx,%eax
jge    1223 <main+0xf3>
movslq -0x8(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%eax
cmp    $0x2b,%eax
jl     120b <main+0xdb>
movslq -0x8(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%eax
cmp    $0x7a,%eax
jg     120b <main+0xdb>
movslq -0x8(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%eax
cmp    $0x44,%eax
je     11fd <main+0xcd>
movslq -0x8(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%eax
cmp    $0x30,%eax
je     11fd <main+0xcd>
movslq -0x8(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%eax
cmp    $0x6a,%eax
jne    1206 <main+0xd6>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1210 <main+0xe0>
jmp    1223 <main+0xf3>
jmp    1215 <main+0xe5>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1181 <main+0x51>
cmpl   $0x0,-0xc(%rbp)
jle    123e <main+0x10e>
lea    0xdd2(%rip),%rdi
call   1040 <printf@plt>
jmp    124a <main+0x11a>
lea    0xdc6(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
jmp    1154 <main+0x24>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
lea    0xebb(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
subl   $0x1,0xc(%rsp)
jae    1167 <main+0x37>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe95(%rip),%r14
lea    0x10(%rsp),%rbx
movabs $0x400000000100001,%r15
lea    0xe85(%rip),%r12
jmp    11a3 <main+0x73>
cs nopw 0x0(%rax,%rax,1)
lea    0xe6f(%rip),%rdi
call   1030 <puts@plt>
subl   $0x1,0xc(%rsp)
jb     1158 <main+0x28>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    1190 <main+0x60>
xor    %r13d,%r13d
xor    %ebp,%ebp
jmp    11e3 <main+0xb3>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%r13
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%r13
jge    1210 <main+0xe0>
movzbl 0x10(%rsp,%r13,1),%eax
lea    -0x2b(%rax),%ecx
cmp    $0x4f,%cl
ja     1210 <main+0xe0>
add    $0xd0,%al
cmp    $0x3a,%al
ja     11d0 <main+0xa0>
movzbl %al,%eax
bt     %rax,%r15
jae    11d0 <main+0xa0>
add    $0x1,%ebp
jmp    11d0 <main+0xa0>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r12,%rdi
test   %ebp,%ebp
jg     1197 <main+0x67>
jmp    1190 <main+0x60>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@str = [3 x i8] c"NO\00"
@str.4 = [4 x i8] c"YES\00"
define void @main() {
%1 = alloca i32
%2 = alloca [101 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = add nsw i32 %6, -1
store i32 %7, i32* %1
%8 = icmp eq i32 %6, 0
br i1 %8, label %39, label %9
9: ; preds = %0, %33
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%11 = call i32 @strlen(i8* %4)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %32
13: ; preds = %9, %23
%14 = phi i64 [ %25, %23 ], [ 0, %9 ]
%15 = phi i32 [ %24, %23 ], [ 0, %9 ]
%16 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 %14
%17 = load i8, i8* %16
%18 = add i8 %17, -43
%19 = icmp ult i8 %18, 80
br i1 %19, label %20, label %29
20: ; preds = %13
switch i8 %17, label %23 [
i8 68, label %21
i8 48, label %21
i8 106, label %21
]
21: ; preds = %20, %20, %20
%22 = add nsw i32 %15, 1
br label %23
23: ; preds = %20, %21
%24 = phi i32 [ %22, %21 ], [ %15, %20 ]
%25 = add nuw nsw i64 %14, 1
%26 = call i32 @strlen(i8* %4)
%27 = sext i32 %26 to i64
%28 = icmp slt i64 %25, %27
br i1 %28, label %13, label %29
29: ; preds = %23, %13
%30 = phi i32 [ %24, %23 ], [ %15, %13 ]
%31 = icmp sgt i32 %30, 0
br i1 %31, label %33, label %32
32: ; preds = %9, %29
br label %33
33: ; preds = %29, %32
%34 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0), %32 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.4, i64 0, i64 0), %29 ]
%35 = call i32 @puts(i8* dereferenceable(1) %34)
%36 = load i32, i32* %1
%37 = add nsw i32 %36, -1
store i32 %37, i32* %1
%38 = icmp eq i32 %36, 0
br i1 %38, label %39, label %9
39: ; preds = %33, %0
ret void
}