#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 *, unsigned long long);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int N, T;
  scanf("%d", &T);
  while (T--) {
    int i;
    unsigned long long n = 1;
    unsigned long long total = 0;
    scanf("%d", &N);
    for (i = 1; i <= N; i++) {
      n *= 2;
    }
    printf("%Lu\n", n);
    while (n > 0) {
      total += (n % 10);
      n /= 10;
    }
    printf("%Lu\n", total);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     11fd <main+0xdd>
movq   $0x1,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
lea    0xe96(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11a0 <main+0x80>
mov    -0x18(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    117a <main+0x5a>
mov    -0x18(%rbp),%rsi
lea    0xe58(%rip),%rdi
call   1030 <printf@plt>
cmpq   $0x0,-0x18(%rbp)
jbe    11e8 <main+0xc8>
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
add    -0x20(%rbp),%rdx
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    $0xa,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x18(%rbp)
jmp    11b0 <main+0x90>
mov    -0x20(%rbp),%rsi
lea    0xe10(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0x1f>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecc(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
subl   $0x1,0x8(%rsp)
jae    1155 <main+0x35>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
lea    0xea4(%rip),%r14
lea    0xc(%rsp),%r15
lea    0xe9b(%rip),%r12
movabs $0xcccccccccccccccd,%r13
cc cc cc
jmp    1191 <main+0x71>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %esi,%esi
mov    %r12,%rdi
call   1030 <printf@plt>
subl   $0x1,0x8(%rsp)
jb     1145 <main+0x25>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ecx
test   %ecx,%ecx
jle    11f0 <main+0xd0>
lea    -0x1(%rcx),%edx
mov    %ecx,%eax
and    $0x7,%eax
mov    $0x1,%ebx
cmp    $0x7,%edx
jb     11c9 <main+0xa9>
and    $0xfffffff8,%ecx
mov    $0x1,%ebx
xchg   %ax,%ax
shl    $0x8,%rbx
add    $0xfffffff8,%ecx
jne    11c0 <main+0xa0>
test   %eax,%eax
je     11d8 <main+0xb8>
nopl   (%rax)
add    %rbx,%rbx
add    $0xffffffff,%eax
jne    11d0 <main+0xb0>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
test   %rbx,%rbx
jne    1202 <main+0xe2>
jmp    1180 <main+0x60>
nopw   0x0(%rax,%rax,1)
mov    $0x1,%ebx
mov    $0x1,%esi
mov    %r12,%rdi
call   1030 <printf@plt>
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rax
mul    %r13
shr    $0x3,%rdx
lea    (%rdx,%rdx,1),%rax
lea    (%rax,%rax,4),%rax
mov    %rbx,%rcx
sub    %rax,%rcx
add    %rcx,%rsi
cmp    $0x9,%rbx
mov    %rdx,%rbx
ja     1210 <main+0xf0>
jmp    1182 <main+0x62>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%Lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
store i32 0, i32* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
br label %8
8: ; preds = %37, %0
%9 = load i32, i32* %3
%10 = add nsw i32 %9, -1
store i32 %10, i32* %3
%11 = icmp ne i32 %9, 0
br i1 %11, label %12, label %40
12: ; preds = %8
store i64 1, i64* %5
store i64 0, i64* %6
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 1, i32* %4
br label %14
14: ; preds = %21, %12
%15 = load i32, i32* %4
%16 = load i32, i32* %2
%17 = icmp sle i32 %15, %16
br i1 %17, label %18, label %24
18: ; preds = %14
%19 = load i64, i64* %5
%20 = mul i64 %19, 2
store i64 %20, i64* %5
br label %21
21: ; preds = %18
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %14
24: ; preds = %14
%25 = load i64, i64* %5
%26 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %25)
br label %27
27: ; preds = %30, %24
%28 = load i64, i64* %5
%29 = icmp ugt i64 %28, 0
br i1 %29, label %30, label %37
30: ; preds = %27
%31 = load i64, i64* %5
%32 = urem i64 %31, 10
%33 = load i64, i64* %6
%34 = add i64 %33, %32
store i64 %34, i64* %6
%35 = load i64, i64* %5
%36 = udiv i64 %35, 10
store i64 %36, i64* %5
br label %27
37: ; preds = %27
%38 = load i64, i64* %6
%39 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %38)
br label %8
40: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [5 x i8] c"%Lu\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 = add nsw i32 %6, -1
store i32 %7, i32* %2
%8 = icmp eq i32 %6, 0
br i1 %8, label %56, label %9
9: ; preds = %0, %50
%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 = icmp slt i32 %11, 1
br i1 %12, label %19, label %13
13: ; preds = %9
%14 = add i32 %11, -1
%15 = and i32 %11, 7
%16 = icmp ult i32 %14, 7
br i1 %16, label %27, label %17
17: ; preds = %13
%18 = and i32 %11, -8
br label %21
19: ; preds = %9
%20 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 1)
br label %41
21: ; preds = %21, %17
%22 = phi i64 [ 1, %17 ], [ %24, %21 ]
%23 = phi i32 [ 0, %17 ], [ %25, %21 ]
%24 = shl i64 %22, 8
%25 = add i32 %23, 8
%26 = icmp eq i32 %25, %18
br i1 %26, label %27, label %21
27: ; preds = %21, %13
%28 = phi i64 [ undef, %13 ], [ %24, %21 ]
%29 = phi i64 [ 1, %13 ], [ %24, %21 ]
%30 = icmp eq i32 %15, 0
br i1 %30, label %37, label %31
31: ; preds = %27, %31
%32 = phi i64 [ %34, %31 ], [ %29, %27 ]
%33 = phi i32 [ %35, %31 ], [ 0, %27 ]
%34 = shl i64 %32, 1
%35 = add i32 %33, 1
%36 = icmp eq i32 %35, %15
br i1 %36, label %37, label %31
37: ; preds = %31, %27
%38 = phi i64 [ %28, %27 ], [ %34, %31 ]
%39 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %38)
%40 = icmp eq i64 %38, 0
br i1 %40, label %50, label %41
41: ; preds = %19, %37
%42 = phi i64 [ %38, %37 ], [ 1, %19 ]
br label %43
43: ; preds = %41, %43
%44 = phi i64 [ %47, %43 ], [ 0, %41 ]
%45 = phi i64 [ %48, %43 ], [ %42, %41 ]
%46 = urem i64 %45, 10
%47 = add i64 %44, %46
%48 = udiv i64 %45, 10
%49 = icmp ult i64 %45, 10
br i1 %49, label %50, label %43
50: ; preds = %43, %37
%51 = phi i64 [ 0, %37 ], [ %47, %43 ]
%52 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %51)
%53 = load i32, i32* %2
%54 = add nsw i32 %53, -1
store i32 %54, i32* %2
%55 = icmp eq i32 %53, 0
br i1 %55, label %56, label %9
56: ; preds = %50, %0
ret i32 0
}