#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 *, char);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int t;
  char ch, s[10001];
  scanf("%d", &t);
  t++;
  while (t != 0) {
    int i, j, k = 0;
    char a[10001];
    ch = 0;
    for (i = 0; ch != '\n'; i++) {
      scanf("%c", &s[i]);
      ch = s[i];
      if (s[i] < 48 || s[i] > 58) {
        a[k] = s[i];
        k++;
      }
    }
    for (j = 0; j < k; j++)
      printf("%c", a[j]);
    t--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4e40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1279 <main+0x159>
movl   $0x0,-0x272c(%rbp)
movb   $0x0,-0x9(%rbp)
movl   $0x0,-0x2724(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0xa,%eax
je     1220 <main+0x100>
movslq -0x2724(%rbp),%rax
lea    -0x2720(%rbp),%rsi
add    %rax,%rsi
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
movslq -0x2724(%rbp),%rax
mov    -0x2720(%rbp,%rax,1),%al
mov    %al,-0x9(%rbp)
movslq -0x2724(%rbp),%rax
movsbl -0x2720(%rbp,%rax,1),%eax
ff
cmp    $0x30,%eax
jl     11dc <main+0xbc>
movslq -0x2724(%rbp),%rax
movsbl -0x2720(%rbp,%rax,1),%eax
ff
cmp    $0x3a,%eax
jle    1207 <main+0xe7>
movslq -0x2724(%rbp),%rax
mov    -0x2720(%rbp,%rax,1),%cl
movslq -0x272c(%rbp),%rax
mov    %cl,-0x4e40(%rbp,%rax,1)
mov    -0x272c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x272c(%rbp)
jmp    120c <main+0xec>
mov    -0x2724(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2724(%rbp)
jmp    116f <main+0x4f>
movl   $0x0,-0x2728(%rbp)
mov    -0x2728(%rbp),%eax
cmp    -0x272c(%rbp),%eax
jge    126b <main+0x14b>
movslq -0x2728(%rbp),%rax
lea    0xdb9(%rip),%rdi
movsbl -0x4e40(%rbp,%rax,1),%esi
ff
call   1030 <printf@plt>
mov    -0x2728(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2728(%rbp)
jmp    122a <main+0x10a>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    114d <main+0x2d>
xor    %eax,%eax
add    $0x4e40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x4e48,%rsp
lea    0xecb(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
addl   $0x1,0xc(%rsp)
jne    1159 <main+0x39>
xor    %eax,%eax
add    $0x4e48,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
lea    0x2730(%rsp),%r15
lea    0xe9b(%rip),%r14
jmp    1177 <main+0x57>
nopw   0x0(%rax,%rax,1)
addl   $0xffffffff,0xc(%rsp)
je     1148 <main+0x28>
mov    %r15,%rbx
xor    %r12d,%r12d
jmp    1188 <main+0x68>
nop
add    $0x1,%rbx
cmp    $0xa,%al
je     11b0 <main+0x90>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movzbl (%rbx),%eax
lea    -0x3b(%rax),%ecx
cmp    $0xf4,%cl
ja     1180 <main+0x60>
movslq %r12d,%r12
mov    %al,0x10(%rsp,%r12,1)
add    $0x1,%r12d
jmp    1180 <main+0x60>
xchg   %ax,%ax
test   %r12d,%r12d
jle    1170 <main+0x50>
mov    %r12d,%r12d
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsbl 0x10(%rsp,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    11c0 <main+0xa0>
jmp    1170 <main+0x50>

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

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