#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);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a[50];
  int n, b, i = 0, j = 0;
  scanf("%d", &n);
  while (i < n) {
    scanf("%d", &b);
    if (b % 2 != 0) {
      a[i] = b;
      i++;
    }
  }
  i--;
  while (i > j) {
    b = a[j] - a[i];
    printf("\n%d", b);
    j++;
    i--;
    if (i == j)
      printf("\n%d", a[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xdc(%rbp)
movl   $0x0,-0xe0(%rbp)
lea    0xeb4(%rip),%rdi
lea    -0xd4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xdc(%rbp),%eax
cmp    -0xd4(%rbp),%eax
jge    11bd <main+0x9d>
lea    0xe8f(%rip),%rdi
lea    -0xd8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xd8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11b8 <main+0x98>
mov    -0xd8(%rbp),%ecx
movslq -0xdc(%rbp),%rax
mov    %ecx,-0xd0(%rbp,%rax,4)
mov    -0xdc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xdc(%rbp)
jmp    1159 <main+0x39>
mov    -0xdc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xdc(%rbp)
mov    -0xdc(%rbp),%eax
cmp    -0xe0(%rbp),%eax
jle    1261 <main+0x141>
movslq -0xe0(%rbp),%rax
mov    -0xd0(%rbp,%rax,4),%eax
movslq -0xdc(%rbp),%rcx
sub    -0xd0(%rbp,%rcx,4),%eax
mov    %eax,-0xd8(%rbp)
mov    -0xd8(%rbp),%esi
lea    0xdf3(%rip),%rdi
call   1030 <printf@plt>
mov    -0xe0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe0(%rbp)
mov    -0xdc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xdc(%rbp)
mov    -0xdc(%rbp),%eax
cmp    -0xe0(%rbp),%eax
jne    125c <main+0x13c>
movslq -0xdc(%rbp),%rax
mov    -0xd0(%rbp,%rax,4),%esi
lea    0xda9(%rip),%rdi
call   1030 <printf@plt>
jmp    11cc <main+0xac>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe0,%rsp
lea    0xeca(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11f3 <main+0xd3>
xor    %ebx,%ebx
lea    0xeac(%rip),%r14
lea    0x8(%rsp),%r15
jmp    1166 <main+0x46>
nopl   0x0(%rax)
cmp    0xc(%rsp),%ebx
jge    1185 <main+0x65>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
test   $0x1,%al
je     1160 <main+0x40>
movslq %ebx,%rbx
mov    %eax,0x10(%rsp,%rbx,4)
add    $0x1,%ebx
jmp    1160 <main+0x40>
cmp    $0x2,%ebx
jl     11f3 <main+0xd3>
movabs $0x100000000,%r14
mov    %ebx,%r12d
add    $0xffffffffffffffff,%r12
mov    $0x1,%ebx
lea    0xe59(%rip),%r15
mov    %r14,%r13
jmp    11c3 <main+0xa3>
nopl   0x0(%rax)
mov    %r13,%rax
sar    $0x20,%rax
add    $0x1,%rbx
add    %r14,%r13
cmp    %rax,%r12
jle    11f3 <main+0xd3>
mov    0xc(%rsp,%rbx,4),%esi
sub    0x10(%rsp,%r12,4),%esi
mov    %esi,0x8(%rsp)
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0xffffffffffffffff,%r12
mov    %r12d,%eax
cmp    %rax,%rbx
jne    11b0 <main+0x90>
mov    0x10(%rsp,%r12,4),%esi
mov    %r15,%rdi
call   1030 <printf@plt>
jmp    11b0 <main+0x90>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

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