int main() {
  int cases;
  char s[30], l;
  scanf("%d", &cases);
  for (int a = 1; a <= cases; a++) {
    scanf("%30s", &s);
    for (int b = 0; b < 30; b++) {
      printf("%s", s[b]);
      if (s[b + 1] == s[b])
        b++;
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x1,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11e4 <main+0xc4>
lea    0xea8(%rip),%rdi
lea    -0x30(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x3c(%rbp)
cmpl   $0x1e,-0x3c(%rbp)
jge    11c8 <main+0xa8>
movslq -0x3c(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%esi
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0x30(%rbp,%rax,1),%eax
movslq -0x3c(%rbp),%rcx
movsbl -0x30(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    11b5 <main+0x95>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11ba <main+0x9a>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    116d <main+0x4d>
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1148 <main+0x28>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
lea    0xebb(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11df <main+0xaf>
mov    $0x1,%r12d
lea    0xe9a(%rip),%r14
lea    0x10(%rsp),%r15
lea    0xe93(%rip),%r13
jmp    1199 <main+0x69>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r12),%eax
cmp    0xc(%rsp),%r12d
mov    %eax,%r12d
jge    11df <main+0xaf>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
xor    %ebx,%ebx
jmp    11ba <main+0x8a>
nopw   0x0(%rax,%rax,1)
lea    0x1(%rbx),%eax
cmp    $0x1d,%ebx
mov    %eax,%ebx
jge    1180 <main+0x50>
movslq %ebx,%rbp
movsbl 0x10(%rsp,%rbp,1),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x11(%rsp,%rbp,1),%eax
cmp    0x10(%rsp,%rbp,1),%al
jne    11b0 <main+0x80>
add    $0x1,%rbp
mov    %ebp,%ebx
jmp    11b0 <main+0x80>
xor    %eax,%eax
add    $0x38,%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 = [5 x i8] c"%30s\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [30 x i8]
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 1, i32* %5
br label %8
8: ; preds = %45, %0
%9 = load i32, i32* %5
%10 = load i32, i32* %2
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %48
12: ; preds = %8
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), [30 x i8]* %3)
store i32 0, i32* %6
br label %14
14: ; preds = %40, %12
%15 = load i32, i32* %6
%16 = icmp slt i32 %15, 30
br i1 %16, label %17, label %43
17: ; preds = %14
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %22)
%24 = load i32, i32* %6
%25 = add nsw i32 %24, 1
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 %26
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = load i32, i32* %6
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 %31
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp eq i32 %29, %34
br i1 %35, label %36, label %39
36: ; preds = %17
%37 = load i32, i32* %6
%38 = add nsw i32 %37, 1
store i32 %38, i32* %6
br label %39
39: ; preds = %36, %17
br label %40
40: ; preds = %39
%41 = load i32, i32* %6
%42 = add nsw i32 %41, 1
store i32 %42, i32* %6
br label %14
43: ; preds = %14
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %45
45: ; preds = %43
%46 = load i32, i32* %5
%47 = add nsw i32 %46, 1
store i32 %47, i32* %5
br label %8
48: ; preds = %8
%49 = load i32, i32* %1
ret i32 %49
}

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