#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 *, char *);
int /*<<< orphan*/ scanf(char *, ...);
int strlen(char *);
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int a = 0;
    int b = 0;
    char word[10001];
    scanf("%10000s", word);
    int word_length = strlen(word);
    char evens[word_length + 2];
    char odds[word_length + 2];
    for (int j = 0; j < word_length; j++) {
      if (j % 2 == 0) {
        evens[a] = word[j];
        a++;
      } else {
        odds[b] = word[j];
        b++;
      }
    }
    evens[a] = '\0';
    odds[b] = '\0';
    printf("%s %s\n", evens, odds);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2770,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12e0 <main+0x1b0>
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xe87(%rip),%rdi
xor    %eax,%eax
lea    -0x2730(%rbp),%rsi
mov    %rsi,-0x2770(%rbp)
call   1050 <scanf@plt>
mov    -0x2770(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x2734(%rbp)
mov    -0x2734(%rbp),%eax
add    $0x2,%eax
mov    %rsp,%rcx
mov    %rcx,-0x2740(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x2768(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x2748(%rbp)
mov    -0x2734(%rbp),%eax
add    $0x2,%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x2760(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x2750(%rbp)
movl   $0x0,-0x2754(%rbp)
mov    -0x2754(%rbp),%eax
cmp    -0x2734(%rbp),%eax
jge    129e <main+0x16e>
mov    -0x2754(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1260 <main+0x130>
mov    -0x2768(%rbp),%rax
movslq -0x2754(%rbp),%rcx
mov    -0x2730(%rbp,%rcx,1),%dl
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1285 <main+0x155>
mov    -0x2760(%rbp),%rax
movslq -0x2754(%rbp),%rcx
mov    -0x2730(%rbp,%rcx,1),%dl
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    128a <main+0x15a>
mov    -0x2754(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2754(%rbp)
jmp    120d <main+0xdd>
mov    -0x2760(%rbp),%rdx
mov    -0x2768(%rbp),%rsi
movslq -0x10(%rbp),%rax
movb   $0x0,(%rsi,%rax,1)
movslq -0x14(%rbp),%rax
movb   $0x0,(%rdx,%rax,1)
lea    0xd48(%rip),%rdi
call   1040 <printf@plt>
mov    -0x2740(%rbp),%rax
mov    %rax,%rsp
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115b <main+0x2b>
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2718,%rsp
lea    0xeb5(%rip),%rdi
xor    %r15d,%r15d
lea    -0x2c(%rbp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x0,-0x2c(%rbp)
jle    1221 <main+0xf1>
lea    -0x2740(%rbp),%r12
jmp    119b <main+0x6b>
nopl   0x0(%rax)
movslq %ecx,%rax
movb   $0x0,(%rsi,%rax,1)
movslq %r14d,%rax
movb   $0x0,(%rdx,%rax,1)
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
mov    %r13,%rsp
add    $0x1,%r15d
cmp    -0x2c(%rbp),%r15d
jge    1221 <main+0xf1>
xor    %r14d,%r14d
lea    0xe5e(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r12,%rdi
call   1030 <strlen@plt>
mov    %rsp,%r13
lea    0x2(%rax),%ecx
mov    %rsp,%rsi
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%rsi
mov    %rsi,%rsp
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,%rsp
mov    $0x0,%ecx
test   %eax,%eax
jle    1170 <main+0x40>
mov    %eax,%eax
xor    %edi,%edi
xor    %ecx,%ecx
xor    %r14d,%r14d
jmp    1208 <main+0xd8>
nopl   0x0(%rax,%rax,1)
movslq %r14d,%r14
mov    %bl,(%rdx,%r14,1)
add    $0x1,%r14d
add    $0x1,%rdi
cmp    %rdi,%rax
je     1170 <main+0x40>
movzbl -0x2740(%rbp,%rdi,1),%ebx
ff
test   $0x1,%dil
jne    11f0 <main+0xc0>
movslq %ecx,%rcx
mov    %bl,(%rsi,%rcx,1)
add    $0x1,%ecx
jmp    11fb <main+0xcb>
xor    %eax,%eax
lea    -0x28(%rbp),%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 = [8 x i8] c"%10000s\00"
@.str.2 = [7 x i8] c"%s %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [10001 x i8]
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i64
%11 = alloca i32
store i32 0, i32* %1
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %3
br label %13
13: ; preds = %72, %0
%14 = load i32, i32* %3
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %75
17: ; preds = %13
store i32 0, i32* %4
store i32 0, i32* %5
%18 = getelementptr inbounds [10001 x i8], [10001 x i8]* %6, i64 0, i64 0
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %18)
%20 = getelementptr inbounds [10001 x i8], [10001 x i8]* %6, i64 0, i64 0
%21 = call i32 @strlen(i8* %20)
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 2
%24 = zext i32 %23 to i64
%25 = call i8* @llvm.stacksave()
store i8* %25, i8** %8
%26 = alloca i8, i64 %24
store i64 %24, i64* %9
%27 = load i32, i32* %7
%28 = add nsw i32 %27, 2
%29 = zext i32 %28 to i64
%30 = alloca i8, i64 %29
store i64 %29, i64* %10
store i32 0, i32* %11
br label %31
31: ; preds = %60, %17
%32 = load i32, i32* %11
%33 = load i32, i32* %7
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %63
35: ; preds = %31
%36 = load i32, i32* %11
%37 = srem i32 %36, 2
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %49
39: ; preds = %35
%40 = load i32, i32* %11
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [10001 x i8], [10001 x i8]* %6, i64 0, i64 %41
%43 = load i8, i8* %42
%44 = load i32, i32* %4
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i8, i8* %26, i64 %45
store i8 %43, i8* %46
%47 = load i32, i32* %4
%48 = add nsw i32 %47, 1
store i32 %48, i32* %4
br label %59
49: ; preds = %35
%50 = load i32, i32* %11
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [10001 x i8], [10001 x i8]* %6, i64 0, i64 %51
%53 = load i8, i8* %52
%54 = load i32, i32* %5
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8, i8* %30, i64 %55
store i8 %53, i8* %56
%57 = load i32, i32* %5
%58 = add nsw i32 %57, 1
store i32 %58, i32* %5
br label %59
59: ; preds = %49, %39
br label %60
60: ; preds = %59
%61 = load i32, i32* %11
%62 = add nsw i32 %61, 1
store i32 %62, i32* %11
br label %31
63: ; preds = %31
%64 = load i32, i32* %4
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i8, i8* %26, i64 %65
store i8 0, i8* %66
%67 = load i32, i32* %5
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i8, i8* %30, i64 %68
store i8 0, i8* %69
%70 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %26, i8* %30)
%71 = load i8*, i8** %8
br label %72
72: ; preds = %63
%73 = load i32, i32* %3
%74 = add nsw i32 %73, 1
store i32 %74, i32* %3
br label %13
75: ; preds = %13
ret i32 0
}

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