#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 abs(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n, t, i, j, a, ch[10], k, l;
  int ad, mul, mul1, sub, ext;
  scanf("%d", &t);
  for (j = 1; j <= t; j++) {
    scanf("%d", &n);
    mul = n * 63;
    ad = mul + 7492;
    mul1 = ad * 5;
    sub = mul1 - 198;
    ext = abs(sub);
    k = 0;
    while (k < 2) {
      l = ext % 10;
      ext = ext / 10;
      ch[k] = l;
      k++;
    }
    printf("%d\n", ch[1]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1204 <main+0xd4>
lea    0xe97(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
imul   $0x3f,-0x8(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x50(%rbp),%eax
add    $0x1d44,%eax
mov    %eax,-0x4c(%rbp)
imul   $0x5,-0x4c(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%eax
sub    $0xc6,%eax
mov    %eax,-0x58(%rbp)
mov    -0x58(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x5c(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0x2,-0x44(%rbp)
jge    11e7 <main+0xb7>
mov    -0x5c(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x48(%rbp)
mov    -0x5c(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x5c(%rbp)
mov    -0x48(%rbp),%ecx
movslq -0x44(%rbp),%rax
mov    %ecx,-0x40(%rbp,%rax,4)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11a8 <main+0x78>
mov    -0x3c(%rbp),%esi
lea    0xe12(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1156 <main+0x26>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xed2(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
cmpl   $0x0,(%rsp)
jle    11c8 <main+0xa8>
xor    %ebp,%ebp
lea    0xeb7(%rip),%r14
lea    0x4(%rsp),%r15
lea    0xeae(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
imul   $0x13b,0x4(%rsp),%eax
mov    $0xffff6e72,%ecx
sub    %eax,%ecx
add    $0x918e,%eax
test   %eax,%eax
cmovs  %ecx,%eax
cltq
imul   $0x66666667,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
movslq %eax,%rsi
imul   $0x66666667,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
add    $0x1,%ebp
cmp    (%rsp),%ebp
jl     1160 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\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 [10 x i32]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 0, i32* %1
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
store i32 1, i32* %5
br label %16
16: ; preds = %50, %0
%17 = load i32, i32* %5
%18 = load i32, i32* %3
%19 = icmp sle i32 %17, %18
br i1 %19, label %20, label %53
20: ; preds = %16
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%22 = load i32, i32* %2
%23 = mul nsw i32 %22, 63
store i32 %23, i32* %11
%24 = load i32, i32* %11
%25 = add nsw i32 %24, 7492
store i32 %25, i32* %10
%26 = load i32, i32* %10
%27 = mul nsw i32 %26, 5
store i32 %27, i32* %12
%28 = load i32, i32* %12
%29 = sub nsw i32 %28, 198
store i32 %29, i32* %13
%30 = load i32, i32* %13
%31 = call i32 @abs(i32 %30)
store i32 %31, i32* %14
store i32 0, i32* %8
br label %32
32: ; preds = %35, %20
%33 = load i32, i32* %8
%34 = icmp slt i32 %33, 2
br i1 %34, label %35, label %46
35: ; preds = %32
%36 = load i32, i32* %14
%37 = srem i32 %36, 10
store i32 %37, i32* %9
%38 = load i32, i32* %14
%39 = sdiv i32 %38, 10
store i32 %39, i32* %14
%40 = load i32, i32* %9
%41 = load i32, i32* %8
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i64 0, i64 %42
store i32 %40, i32* %43
%44 = load i32, i32* %8
%45 = add nsw i32 %44, 1
store i32 %45, i32* %8
br label %32
46: ; preds = %32
%47 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i64 0, i64 1
%48 = load i32, i32* %47
%49 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %48)
br label %50
50: ; preds = %46
%51 = load i32, i32* %5
%52 = add nsw i32 %51, 1
store i32 %52, i32* %5
br label %16
53: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 1
br i1 %7, label %23, label %8
8: ; preds = %0, %8
%9 = phi i32 [ %20, %8 ], [ 1, %0 ]
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%11 = load i32, i32* %1
%12 = mul i32 %11, 315
%13 = add i32 %12, 37262
%14 = icmp slt i32 %13, 0
%15 = sub i32 -37262, %12
%16 = select i1 %14, i32 %15, i32 %13
%17 = sdiv i32 %16, 10
%18 = srem i32 %17, 10
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = add nuw nsw i32 %9, 1
%21 = load i32, i32* %2
%22 = icmp slt i32 %9, %21
br i1 %22, label %8, label %23
23: ; preds = %8, %0
ret i32 0
}