#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*/ gets(char *);
int /*<<< orphan*/ parseFirstLine(char *, char *, char *, char *, char *,
                                  char *);
int /*<<< orphan*/ printf(char *, char *, char *, char *, char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
char *strtok(char *, char *);
int main(void) {
  char s1[200000 + 1], s2[200000 + 1], s3[200000 + 1], s4[200000 + 1],
      s5[200000 + 1], line[5 * 200000 + 1];
  char *token, delim[] = "...", trash[10];
  int numCase;
  scanf("%d", &numCase);
  gets(trash);
  while (numCase) {
    gets(line);
    parseFirstLine(line, s1, s2, s3, s4, s5);
    gets(line);
    token = strtok(line, delim);
    printf("%s%s%s%s%s\n", s1, s2, s3, s4, s5);
    if (token != NULL)
      printf("%s%s%s%s%s\n", token, s4, s3, s2, s5);
    else
      printf("%s%s%s%s\n", s4, s3, s2, s5);
    numCase--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1e8500,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe98(%rip),%eax
mov    %eax,-0x1e84ec(%rbp)
lea    0xe8f(%rip),%rdi
lea    -0x1e84fc(%rbp),%rsi
call   1060 <scanf@plt>
lea    -0x1e84f6(%rbp),%rdi
call   1050 <gets@plt>
cmpl   $0x0,-0x1e84fc(%rbp)
je     12ae <main+0x15e>
lea    -0x1e84e0(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x1e84e0(%rbp),%rdi
lea    -0x30d50(%rbp),%rsi
lea    -0x61aa0(%rbp),%rdx
lea    -0x927f0(%rbp),%rcx
lea    -0xc3540(%rbp),%r8
lea    -0xf4290(%rbp),%r9
call   1040 <parseFirstLine@plt>
lea    -0x1e84e0(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x1e84e0(%rbp),%rdi
lea    -0x1e84ec(%rbp),%rsi
call   1070 <strtok@plt>
mov    %rax,-0x1e84e8(%rbp)
lea    -0x30d50(%rbp),%rsi
lea    -0x61aa0(%rbp),%rdx
lea    -0x927f0(%rbp),%rcx
lea    -0xc3540(%rbp),%r8
lea    -0xf4290(%rbp),%r9
lea    0xde2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x1e84e8(%rbp)
je     1270 <main+0x120>
mov    -0x1e84e8(%rbp),%rsi
lea    -0xc3540(%rbp),%rdx
lea    -0x927f0(%rbp),%rcx
lea    -0x61aa0(%rbp),%r8
lea    -0xf4290(%rbp),%r9
lea    0xda3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    129a <main+0x14a>
lea    -0xc3540(%rbp),%rsi
lea    -0x927f0(%rbp),%rdx
lea    -0x61aa0(%rbp),%rcx
lea    -0xf4290(%rbp),%r8
lea    0xd76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1e84fc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1e84fc(%rbp)
jmp    118d <main+0x3d>
xor    %eax,%eax
add    $0x1e8500,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1e84f8,%rsp
movl   $0x2e2e2e,0x10(%rsp)
lea    0xe90(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
lea    0x16(%rsp),%rdi
call   1050 <gets@plt>
cmpl   $0x0,0xc(%rsp)
je     126a <main+0x11a>
lea    0x92810(%rsp),%r12
lea    0x61ac0(%rsp),%r13
lea    0x30d70(%rsp),%r14
lea    0x20(%rsp),%rbx
jmp    11d8 <main+0x88>
xchg   %ax,%ax
lea    0xe4e(%rip),%rdi
mov    %rbp,%rsi
mov    %r13,%rdx
mov    %r12,%rcx
mov    %rbx,%r8
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbp,%r14
addl   $0xffffffff,0xc(%rsp)
je     126a <main+0x11a>
lea    0xf42b0(%rsp),%rbp
mov    %rbp,%rdi
call   1050 <gets@plt>
mov    %rbp,%rdi
lea    0xc3560(%rsp),%r15
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %r14,%r8
mov    %rbx,%r9
call   1040 <parseFirstLine@plt>
mov    %rbp,%rdi
call   1050 <gets@plt>
mov    %rbp,%rdi
lea    0x10(%rsp),%rsi
call   1070 <strtok@plt>
mov    %r14,%rbp
mov    %rax,%r14
lea    0xdda(%rip),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %r13,%rcx
mov    %rbp,%r8
mov    %rbx,%r9
xor    %eax,%eax
call   1030 <printf@plt>
test   %r14,%r14
je     11b0 <main+0x60>
lea    0xdb4(%rip),%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
mov    %r13,%rcx
mov    %r12,%r8
mov    %rbx,%r9
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11ca <main+0x7a>
xor    %eax,%eax
add    $0x1e84f8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.delim = [4 x i8] c"...\00"
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"%s%s%s%s%s\0A\00"
@.str.2 = [10 x i8] c"%s%s%s%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200001 x i8]
%3 = alloca [200001 x i8]
%4 = alloca [200001 x i8]
%5 = alloca [200001 x i8]
%6 = alloca [200001 x i8]
%7 = alloca [1000001 x i8]
%8 = alloca i8*
%9 = alloca [4 x i8]
%10 = alloca [10 x i8]
%11 = alloca i32
store i32 0, i32* %1
%12 = bitcast [4 x i8]* %9 to i8*
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %11)
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 0
%15 = call i32 @gets(i8* %14)
br label %16
16: ; preds = %55, %0
%17 = load i32, i32* %11
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %58
19: ; preds = %16
%20 = getelementptr inbounds [1000001 x i8], [1000001 x i8]* %7, i64 0, i64 0
%21 = call i32 @gets(i8* %20)
%22 = getelementptr inbounds [1000001 x i8], [1000001 x i8]* %7, i64 0, i64 0
%23 = getelementptr inbounds [200001 x i8], [200001 x i8]* %2, i64 0, i64 0
%24 = getelementptr inbounds [200001 x i8], [200001 x i8]* %3, i64 0, i64 0
%25 = getelementptr inbounds [200001 x i8], [200001 x i8]* %4, i64 0, i64 0
%26 = getelementptr inbounds [200001 x i8], [200001 x i8]* %5, i64 0, i64 0
%27 = getelementptr inbounds [200001 x i8], [200001 x i8]* %6, i64 0, i64 0
%28 = call i32 @parseFirstLine(i8* %22, i8* %23, i8* %24, i8* %25, i8* %26, i8* %27)
%29 = getelementptr inbounds [1000001 x i8], [1000001 x i8]* %7, i64 0, i64 0
%30 = call i32 @gets(i8* %29)
%31 = getelementptr inbounds [1000001 x i8], [1000001 x i8]* %7, i64 0, i64 0
%32 = getelementptr inbounds [4 x i8], [4 x i8]* %9, i64 0, i64 0
%33 = call i8* @strtok(i8* %31, i8* %32)
store i8* %33, i8** %8
%34 = getelementptr inbounds [200001 x i8], [200001 x i8]* %2, i64 0, i64 0
%35 = getelementptr inbounds [200001 x i8], [200001 x i8]* %3, i64 0, i64 0
%36 = getelementptr inbounds [200001 x i8], [200001 x i8]* %4, i64 0, i64 0
%37 = getelementptr inbounds [200001 x i8], [200001 x i8]* %5, i64 0, i64 0
%38 = getelementptr inbounds [200001 x i8], [200001 x i8]* %6, i64 0, i64 0
%39 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %34, i8* %35, i8* %36, i8* %37, i8* %38)
%40 = load i8*, i8** %8
%41 = icmp ne i8* %40, null
br i1 %41, label %42, label %49
42: ; preds = %19
%43 = load i8*, i8** %8
%44 = getelementptr inbounds [200001 x i8], [200001 x i8]* %5, i64 0, i64 0
%45 = getelementptr inbounds [200001 x i8], [200001 x i8]* %4, i64 0, i64 0
%46 = getelementptr inbounds [200001 x i8], [200001 x i8]* %3, i64 0, i64 0
%47 = getelementptr inbounds [200001 x i8], [200001 x i8]* %6, i64 0, i64 0
%48 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %43, i8* %44, i8* %45, i8* %46, i8* %47)
br label %55
49: ; preds = %19
%50 = getelementptr inbounds [200001 x i8], [200001 x i8]* %5, i64 0, i64 0
%51 = getelementptr inbounds [200001 x i8], [200001 x i8]* %4, i64 0, i64 0
%52 = getelementptr inbounds [200001 x i8], [200001 x i8]* %3, i64 0, i64 0
%53 = getelementptr inbounds [200001 x i8], [200001 x i8]* %6, i64 0, i64 0
%54 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %50, i8* %51, i8* %52, i8* %53)
br label %55
55: ; preds = %49, %42
%56 = load i32, i32* %11
%57 = add nsw i32 %56, -1
store i32 %57, i32* %11
br label %16
58: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [12 x i8] c"%s%s%s%s%s\0A\00"
@.str.2 = [10 x i8] c"%s%s%s%s\0A\00"
define i32 @main() {
%1 = alloca [200001 x i8]
%2 = alloca [200001 x i8]
%3 = alloca [200001 x i8]
%4 = alloca [200001 x i8]
%5 = alloca [200001 x i8]
%6 = alloca [1000001 x i8]
%7 = alloca i32
%8 = alloca [10 x i8]
%9 = alloca i32
%10 = getelementptr inbounds [200001 x i8], [200001 x i8]* %1, i64 0, i64 0
%11 = getelementptr inbounds [200001 x i8], [200001 x i8]* %2, i64 0, i64 0
%12 = getelementptr inbounds [200001 x i8], [200001 x i8]* %3, i64 0, i64 0
%13 = getelementptr inbounds [200001 x i8], [200001 x i8]* %4, i64 0, i64 0
%14 = getelementptr inbounds [200001 x i8], [200001 x i8]* %5, i64 0, i64 0
%15 = getelementptr inbounds [1000001 x i8], [1000001 x i8]* %6, i64 0, i64 0
%16 = bitcast i32* %7 to i8*
store i32 3026478, i32* %7
%17 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%18 = bitcast i32* %9 to i8*
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%20 = call i32 @gets(i8* %17)
%21 = load i32, i32* %9
%22 = icmp eq i32 %21, 0
br i1 %22, label %38, label %23
23: ; preds = %0, %34
%24 = call i32 @gets(i8* %15)
%25 = call i32 @parseFirstLine(i8* %15, i8* %10, i8* %11, i8* %12, i8* %13, i8* %14)
%26 = call i32 @gets(i8* %15)
%27 = call i8* @strtok(i8* %15, i8* %16)
%28 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %10, i8* %11, i8* %12, i8* %13, i8* %14)
%29 = icmp eq i8* %27, null
br i1 %29, label %32, label %30
30: ; preds = %23
%31 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %27, i8* %13, i8* %12, i8* %11, i8* %14)
br label %34
32: ; preds = %23
%33 = call i32 (i8*, i8*, i8*, i8*, i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %13, i8* %12, i8* %11, i8* %14)
br label %34
34: ; preds = %32, %30
%35 = load i32, i32* %9
%36 = add nsw i32 %35, -1
store i32 %36, i32* %9
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %23
38: ; preds = %34, %0
ret i32 0
}