#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 main() {
  long long int t, n, i = 0;
  scanf("%lld", &t);
  while (t--) {
    char a[100000];
    int b[10000];
    scanf("%s", a);
    scanf("%lld", &n);
    for (i = 0; i < n; i++)
      scanf("%lld", &b[i]);
    i = 0;
    while (a[i] != '\0') {
      printf("%c", a[i]);
      i++;
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x22300,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x20(%rbp)
lea    0xebf(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     122e <main+0x10e>
lea    -0x186c0(%rbp),%rsi
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe7f(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    11d3 <main+0xb3>
mov    -0x20(%rbp),%rax
lea    -0x22300(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1194 <main+0x74>
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl -0x186c0(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     121b <main+0xfb>
mov    -0x20(%rbp),%rax
movsbl -0x186c0(%rbp,%rax,1),%esi
ff
lea    0xe05(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    11db <main+0xbb>
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    114c <main+0x2c>
xor    %eax,%eax
add    $0x22300,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x222f8,%rsp
lea    0xec8(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
subq   $0x1,0x8(%rsp)
jae    1160 <main+0x40>
xor    %eax,%eax
add    $0x222f8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe9e(%rip),%r14
lea    0x10(%rsp),%r15
lea    0xe8d(%rip),%r13
mov    %rsp,%r12
jmp    1192 <main+0x72>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
subq   $0x1,0x8(%rsp)
jb     114c <main+0x2c>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %r13,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
cmpq   $0x0,(%rsp)
jle    11db <main+0xbb>
lea    0x186b0(%rsp),%rbx
xor    %ebp,%ebp
nopl   (%rax)
mov    %r13,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
add    $0x1,%rbp
add    $0x4,%rbx
cmp    (%rsp),%rbp
jl     11c0 <main+0xa0>
mov    0x10(%rsp),%al
test   %al,%al
je     1180 <main+0x60>
lea    0x11(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    11f0 <main+0xd0>
jmp    1180 <main+0x60>

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

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