#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 */
typedef int /*<<< orphan*/ data;

/* Variables and functions */
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ mul(unsigned char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ system(char *);
int main() {
  int length = 0, number = 0;
  scanf("%d", &length);
  unsigned char data[36000];
  int i = 0, j = 0;
  for (; i < length; i++) {
    scanf("%d", &number);
    memset(data, 0, sizeof(data));
    data[36000 - 1] = 1;
    while (number > 1) {
      j = 0;
      while (data[j] == 0)
        j++;
      mul(data, number--, j);
    }
    j = 0;
    while (data[j] == 0)
      j++;
    while (j < 36000)
      putchar(data[j++] + 48);
    putchar('\n');
  }
  system("PAUSE");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x8cc0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xe89(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
movl   $0x0,-0x8cb4(%rbp)
movl   $0x0,-0x8cb8(%rbp)
mov    -0x8cb4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12c0 <main+0x170>
lea    0xe56(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1060 <scanf@plt>
lea    -0x8cb0(%rbp),%rdi
xor    %esi,%esi
mov    $0x8ca0,%edx
call   1050 <memset@plt>
movb   $0x1,-0x11(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    122c <main+0xdc>
movl   $0x0,-0x8cb8(%rbp)
movslq -0x8cb8(%rbp),%rax
movzbl -0x8cb0(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
jne    120a <main+0xba>
mov    -0x8cb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8cb8(%rbp)
jmp    11de <main+0x8e>
lea    -0x8cb0(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    %esi,%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8cb8(%rbp),%edx
call   1070 <mul@plt>
jmp    11ca <main+0x7a>
movl   $0x0,-0x8cb8(%rbp)
movslq -0x8cb8(%rbp),%rax
movzbl -0x8cb0(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
jne    1262 <main+0x112>
mov    -0x8cb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8cb8(%rbp)
jmp    1236 <main+0xe6>
jmp    1267 <main+0x117>
cmpl   $0x8ca0,-0x8cb8(%rbp)
jge    12a2 <main+0x152>
mov    -0x8cb8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8cb8(%rbp)
cltq
movzbl -0x8cb0(%rbp,%rax,1),%eax
ff
add    $0x30,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    1267 <main+0x117>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x8cb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8cb4(%rbp)
jmp    1194 <main+0x44>
lea    0xd3c(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x8cc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x8cb8,%rsp
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xe88(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    128c <main+0x13c>
xor    %r12d,%r12d
lea    0xe69(%rip),%r14
lea    0x8(%rsp),%r15
lea    0x10(%rsp),%r13
jmp    11c9 <main+0x79>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12d
cmp    0xc(%rsp),%r12d
jge    128c <main+0x13c>
mov    %r14,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
mov    %r13,%rdi
xor    %esi,%esi
mov    $0x8ca0,%edx
call   1050 <memset@plt>
movb   $0x1,0x8caf(%rsp)
01
mov    0x8(%rsp),%esi
cmp    $0x2,%esi
jl     1234 <main+0xe4>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0xffffffff,%edx
mov    %r13,%rax
nopl   0x0(%rax,%rax,1)
add    $0x1,%edx
cmpb   $0x0,(%rax)
lea    0x1(%rax),%rax
je     1210 <main+0xc0>
lea    -0x1(%rsi),%eax
mov    %eax,0x8(%rsp)
mov    %r13,%rdi
call   1070 <mul@plt>
mov    0x8(%rsp),%esi
cmp    $0x1,%esi
jg     1200 <main+0xb0>
mov    $0xffffffffffffffff,%rcx
xor    %edx,%edx
nopl   (%rax)
mov    %edx,%eax
cmpb   $0x0,0x11(%rsp,%rcx,1)
lea    0x1(%rcx),%rcx
lea    0x1(%rax),%edx
je     1240 <main+0xf0>
cmp    $0x8c9f,%ecx
ja     11b0 <main+0x60>
mov    %eax,%ecx
lea    (%rsp,%rcx,1),%rbp
add    $0x10,%rbp
mov    $0x8ca0,%ebx
sub    %eax,%ebx
nopl   (%rax)
movzbl 0x0(%rbp),%eax
add    $0x30,%al
movsbl %al,%edi
call   1030 <putchar@plt>
add    $0x1,%rbp
add    $0xffffffff,%ebx
jne    1270 <main+0x120>
jmp    11b0 <main+0x60>
lea    0xd70(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x8cb8,%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 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [36000 x i8]
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %5
store i32 0, i32* %6
br label %8
8: ; preds = %64, %0
%9 = load i32, i32* %5
%10 = load i32, i32* %2
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %67
12: ; preds = %8
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%14 = getelementptr inbounds [36000 x i8], [36000 x i8]* %4, i64 0, i64 0
%15 = call i32 @memset(i8* %14, i32 0, i32 36000)
%16 = getelementptr inbounds [36000 x i8], [36000 x i8]* %4, i64 0, i64 35999
store i8 1, i8* %16
br label %17
17: ; preds = %31, %12
%18 = load i32, i32* %3
%19 = icmp sgt i32 %18, 1
br i1 %19, label %20, label %37
20: ; preds = %17
store i32 0, i32* %6
br label %21
21: ; preds = %28, %20
%22 = load i32, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [36000 x i8], [36000 x i8]* %4, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %31
28: ; preds = %21
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
br label %21
31: ; preds = %21
%32 = getelementptr inbounds [36000 x i8], [36000 x i8]* %4, i64 0, i64 0
%33 = load i32, i32* %3
%34 = add nsw i32 %33, -1
store i32 %34, i32* %3
%35 = load i32, i32* %6
%36 = call i32 @mul(i8* %32, i32 %33, i32 %35)
br label %17
37: ; preds = %17
store i32 0, i32* %6
br label %38
38: ; preds = %45, %37
%39 = load i32, i32* %6
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [36000 x i8], [36000 x i8]* %4, i64 0, i64 %40
%42 = load i8, i8* %41
%43 = zext i8 %42 to i32
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %48
45: ; preds = %38
%46 = load i32, i32* %6
%47 = add nsw i32 %46, 1
store i32 %47, i32* %6
br label %38
48: ; preds = %38
br label %49
49: ; preds = %52, %48
%50 = load i32, i32* %6
%51 = icmp slt i32 %50, 36000
br i1 %51, label %52, label %62
52: ; preds = %49
%53 = load i32, i32* %6
%54 = add nsw i32 %53, 1
store i32 %54, i32* %6
%55 = sext i32 %53 to i64
%56 = getelementptr inbounds [36000 x i8], [36000 x i8]* %4, i64 0, i64 %55
%57 = load i8, i8* %56
%58 = zext i8 %57 to i32
%59 = add nsw i32 %58, 48
%60 = trunc i32 %59 to i8
%61 = call i32 @putchar(i8 signext %60)
br label %49
62: ; preds = %49
%63 = call i32 @putchar(i8 signext 10)
br label %64
64: ; preds = %62
%65 = load i32, i32* %5
%66 = add nsw i32 %65, 1
store i32 %66, i32* %5
br label %8
67: ; preds = %8
%68 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [36000 x i8]
%4 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%7 = getelementptr inbounds [36000 x i8], [36000 x i8]* %3, i64 0, i64 0
%8 = load i32, i32* %1
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %58
10: ; preds = %0
%11 = getelementptr inbounds [36000 x i8], [36000 x i8]* %3, i64 0, i64 35999
br label %12
12: ; preds = %10, %53
%13 = phi i32 [ 0, %10 ], [ %55, %53 ]
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%15 = call i32 @memset(i8* %7, i32 0, i32 36000)
store i8 1, i8* %11
%16 = load i32, i32* %2
%17 = icmp sgt i32 %16, 1
br i1 %17, label %18, label %32
18: ; preds = %12, %26
%19 = phi i32 [ %30, %26 ], [ %16, %12 ]
br label %20
20: ; preds = %20, %18
%21 = phi i64 [ %25, %20 ], [ 0, %18 ]
%22 = getelementptr inbounds [36000 x i8], [36000 x i8]* %3, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = icmp eq i8 %23, 0
%25 = add nuw i64 %21, 1
br i1 %24, label %20, label %26
26: ; preds = %20
%27 = trunc i64 %21 to i32
%28 = add nsw i32 %19, -1
store i32 %28, i32* %2
%29 = call i32 @mul(i8* %7, i32 %19, i32 %27)
%30 = load i32, i32* %2
%31 = icmp sgt i32 %30, 1
br i1 %31, label %18, label %32
32: ; preds = %26, %12
br label %33
33: ; preds = %32, %33
%34 = phi i64 [ %38, %33 ], [ 0, %32 ]
%35 = getelementptr inbounds [36000 x i8], [36000 x i8]* %3, i64 0, i64 %34
%36 = load i8, i8* %35
%37 = icmp eq i8 %36, 0
%38 = add nuw i64 %34, 1
br i1 %37, label %33, label %39
39: ; preds = %33
%40 = trunc i64 %34 to i32
%41 = icmp ult i32 %40, 36000
br i1 %41, label %42, label %53
42: ; preds = %39
%43 = and i64 %34, 4294967295
br label %44
44: ; preds = %42, %44
%45 = phi i64 [ %43, %42 ], [ %46, %44 ]
%46 = add nuw nsw i64 %45, 1
%47 = getelementptr inbounds [36000 x i8], [36000 x i8]* %3, i64 0, i64 %45
%48 = load i8, i8* %47
%49 = add i8 %48, 48
%50 = call i32 @putchar(i8 signext %49)
%51 = trunc i64 %46 to i32
%52 = icmp eq i32 %51, 36000
br i1 %52, label %53, label %44
53: ; preds = %44, %39
%54 = call i32 @putchar(i8 signext 10)
%55 = add nuw nsw i32 %13, 1
%56 = load i32, i32* %1
%57 = icmp slt i32 %55, %56
br i1 %57, label %12, label %58
58: ; preds = %53, %0
%59 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}