#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 *, ...);
scalar_t__ scanf(char *, int *);
int main() {
  int i, j, n, a[6], count, y;
  while (scanf("%d", &n) && n) {
    while (n--) {
      count = 0;
      for (i = 1; i <= 5; i++) {
        scanf("%d", &a[i]);
        if (a[i] <= 127) {
          count++;
          y = i;
        }
      }
      if (count == 1) {
        printf("%c\n", y + 64);
      } else {
        printf("*\n");
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x39(%rbp)
je     115b <main+0x3b>
cmpl   $0x0,-0x10(%rbp)
setne  %al
mov    %al,-0x39(%rbp)
mov    -0x39(%rbp),%al
test   $0x1,%al
jne    116b <main+0x4b>
jmp    1223 <main+0x103>
jmp    1170 <main+0x50>
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x10(%rbp)
cmp    $0x0,%eax
je     121e <main+0xfe>
movl   $0x0,-0x34(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jg     11e8 <main+0xc8>
movslq -0x8(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe4e(%rip),%rdi
call   1040 <scanf@plt>
movslq -0x8(%rbp),%rax
cmpl   $0x7f,-0x30(%rbp,%rax,4)
jg     11d5 <main+0xb5>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x38(%rbp)
jmp    11da <main+0xba>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1192 <main+0x72>
cmpl   $0x1,-0x34(%rbp)
jne    120b <main+0xeb>
mov    -0x38(%rbp),%esi
add    $0x40,%esi
lea    0xe04(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1219 <main+0xf9>
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1170 <main+0x50>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xebb(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
test   %rax,%rax
je     129e <main+0x16e>
mov    0xc(%rsp),%eax
test   %eax,%eax
je     129e <main+0x16e>
lea    0xe95(%rip),%r13
nopl   0x0(%rax,%rax,1)
add    $0xffffffff,%eax
mov    %eax,0xc(%rsp)
jmp    1197 <main+0x67>
nopl   0x0(%rax)
lea    0xe80(%rip),%rdi
call   1030 <puts@plt>
subl   $0x1,0xc(%rsp)
jb     1280 <main+0x150>
mov    %r13,%rdi
lea    0x14(%rsp),%rsi
call   1050 <scanf@plt>
xor    %r15d,%r15d
cmpl   $0x80,0x14(%rsp)
setl   %r15b
mov    $0x1,%eax
cmovl  %eax,%r14d
mov    %r13,%rdi
lea    0x18(%rsp),%rsi
call   1050 <scanf@plt>
xor    %r12d,%r12d
cmpl   $0x80,0x18(%rsp)
setl   %r12b
mov    $0x2,%eax
cmovl  %eax,%r14d
add    %r15d,%r12d
mov    %r13,%rdi
lea    0x1c(%rsp),%rsi
call   1050 <scanf@plt>
xor    %ebx,%ebx
cmpl   $0x80,0x1c(%rsp)
setl   %bl
mov    $0x3,%eax
cmovl  %eax,%r14d
add    %r12d,%ebx
mov    %r13,%rdi
lea    0x20(%rsp),%rsi
call   1050 <scanf@plt>
xor    %ebp,%ebp
cmpl   $0x80,0x20(%rsp)
setl   %bpl
mov    $0x4,%eax
cmovl  %eax,%r14d
add    %ebx,%ebp
mov    %r13,%rdi
lea    0x24(%rsp),%rsi
call   1050 <scanf@plt>
xor    %eax,%eax
cmpl   $0x80,0x24(%rsp)
setl   %al
mov    $0x5,%ecx
cmovl  %ecx,%r14d
add    %ebp,%eax
cmp    $0x1,%eax
jne    1180 <main+0x50>
lea    0x40(%r14),%esi
lea    0xd9a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    118c <main+0x5c>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r13,%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
test   %rax,%rax
je     129e <main+0x16e>
mov    0xc(%rsp),%eax
test   %eax,%eax
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%c\0A\00"
@.str.2 = [3 x i8] c"*\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [6 x i32]
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
br label %8
8: ; preds = %53, %0
%9 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 0
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br i1 %15, label %16, label %54
16: ; preds = %14
br label %17
17: ; preds = %52, %16
%18 = load i32, i32* %4
%19 = add nsw i32 %18, -1
store i32 %19, i32* %4
%20 = icmp ne i32 %18, 0
br i1 %20, label %21, label %53
21: ; preds = %17
store i32 0, i32* %6
store i32 1, i32* %2
br label %22
22: ; preds = %40, %21
%23 = load i32, i32* %2
%24 = icmp sle i32 %23, 5
br i1 %24, label %25, label %43
25: ; preds = %22
%26 = load i32, i32* %2
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 %27
%29 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %28)
%30 = load i32, i32* %2
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 %31
%33 = load i32, i32* %32
%34 = icmp sle i32 %33, 127
br i1 %34, label %35, label %39
35: ; preds = %25
%36 = load i32, i32* %6
%37 = add nsw i32 %36, 1
store i32 %37, i32* %6
%38 = load i32, i32* %2
store i32 %38, i32* %7
br label %39
39: ; preds = %35, %25
br label %40
40: ; preds = %39
%41 = load i32, i32* %2
%42 = add nsw i32 %41, 1
store i32 %42, i32* %2
br label %22
43: ; preds = %22
%44 = load i32, i32* %6
%45 = icmp eq i32 %44, 1
br i1 %45, label %46, label %50
46: ; preds = %43
%47 = load i32, i32* %7
%48 = add nsw i32 %47, 64
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %48)
br label %52
50: ; preds = %43
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %52
52: ; preds = %50, %46
br label %17
53: ; preds = %17
br label %8
54: ; preds = %14
ret i32 0
}

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