#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 n, num;
  int i = 0, j = 0;
  scanf("%d", &n);
  int a[n];
  while (i < n) {
    scanf("%d", &num);
    if (num % 2 == 1) {
      a[i] = num;
      i++;
    }
  }
  for (i = n - 1, j = 0; i >= j; i--, j++) {
    a[0] = a[j];
    if (a[i] == a[0]) {
      printf("%d\n", a[i]);
      break;
    }
    printf("%d\n", a[0] - a[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x30(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11c0 <main+0xa0>
lea    0xe79(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    11bb <main+0x9b>
mov    -0x30(%rbp),%rax
mov    -0xc(%rbp),%edx
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1174 <main+0x54>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     1244 <main+0x124>
mov    -0x30(%rbp),%rcx
movslq -0x14(%rbp),%rax
mov    (%rcx,%rax,4),%eax
mov    %eax,(%rcx)
movslq -0x10(%rbp),%rax
mov    (%rcx,%rax,4),%eax
cmp    (%rcx),%eax
jne    1214 <main+0xf4>
mov    -0x30(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xdf9(%rip),%rdi
call   1030 <printf@plt>
jmp    1244 <main+0x124>
mov    -0x30(%rbp),%rax
mov    (%rax),%esi
movslq -0x10(%rbp),%rcx
sub    (%rax,%rcx,4),%esi
lea    0xddb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11d0 <main+0xb0>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%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    $0x18,%rsp
lea    0xec8(%rip),%rdi
lea    -0x2c(%rbp),%rsi
call   1040 <scanf@plt>
mov    %rsp,-0x38(%rbp)
mov    -0x2c(%rbp),%eax
mov    %rsp,%r14
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
cmpl   $0x0,-0x2c(%rbp)
jle    1213 <main+0xf3>
xor    %r15d,%r15d
lea    0xe8f(%rip),%r13
lea    -0x30(%rbp),%r12
jmp    1188 <main+0x68>
nopw   0x0(%rax,%rax,1)
mov    -0x2c(%rbp),%ebx
cmp    %ebx,%r15d
jge    11b6 <main+0x96>
mov    %r13,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
mov    -0x30(%rbp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
mov    %eax,%edx
sub    %ecx,%edx
cmp    $0x1,%edx
jne    1180 <main+0x60>
movslq %r15d,%r15
mov    %eax,(%r14,%r15,4)
add    $0x1,%r15d
jmp    1180 <main+0x60>
test   %ebx,%ebx
jle    1213 <main+0xf3>
movabs $0x100000000,%r15
mov    %r15,%r12
mov    %r14,%r13
nopw   0x0(%rax,%rax,1)
mov    0x0(%r13),%esi
mov    %esi,(%r14)
mov    %esi,%eax
sub    -0x4(%r14,%rbx,4),%eax
je     1207 <main+0xe7>
add    $0xffffffffffffffff,%rbx
lea    0xe18(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %r12,%rax
sar    $0x20,%rax
add    $0x4,%r13
add    %r15,%r12
cmp    %rax,%rbx
jg     11d0 <main+0xb0>
jmp    1213 <main+0xf3>
lea    0xdf5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x38(%rbp),%rsp
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 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
store i32 0, i32* %1
store i32 0, i32* %4
store i32 0, i32* %5
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
store i8* %11, i8** %6
%12 = alloca i32, i64 %10
store i64 %10, i64* %7
br label %13
13: ; preds = %29, %0
%14 = load i32, i32* %4
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %30
17: ; preds = %13
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%19 = load i32, i32* %3
%20 = srem i32 %19, 2
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %29
22: ; preds = %17
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %12, i64 %25
store i32 %23, i32* %26
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1
store i32 %28, i32* %4
br label %29
29: ; preds = %22, %17
br label %13
30: ; preds = %13
%31 = load i32, i32* %2
%32 = sub nsw i32 %31, 1
store i32 %32, i32* %4
store i32 0, i32* %5
br label %33
33: ; preds = %65, %30
%34 = load i32, i32* %4
%35 = load i32, i32* %5
%36 = icmp sge i32 %34, %35
br i1 %36, label %37, label %70
37: ; preds = %33
%38 = load i32, i32* %5
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i32, i32* %12, i64 %39
%41 = load i32, i32* %40
%42 = getelementptr inbounds i32, i32* %12, i64 0
store i32 %41, i32* %42
%43 = load i32, i32* %4
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i32, i32* %12, i64 %44
%46 = load i32, i32* %45
%47 = getelementptr inbounds i32, i32* %12, i64 0
%48 = load i32, i32* %47
%49 = icmp eq i32 %46, %48
br i1 %49, label %50, label %56
50: ; preds = %37
%51 = load i32, i32* %4
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i32, i32* %12, i64 %52
%54 = load i32, i32* %53
%55 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %54)
br label %70
56: ; preds = %37
%57 = getelementptr inbounds i32, i32* %12, i64 0
%58 = load i32, i32* %57
%59 = load i32, i32* %4
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i32, i32* %12, i64 %60
%62 = load i32, i32* %61
%63 = sub nsw i32 %58, %62
%64 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %63)
br label %65
65: ; preds = %56
%66 = load i32, i32* %4
%67 = add nsw i32 %66, -1
store i32 %67, i32* %4
%68 = load i32, i32* %5
%69 = add nsw i32 %68, 1
store i32 %69, i32* %5
br label %33
70: ; preds = %50, %33
store i32 0, i32* %1
%71 = load i8*, i8** %6
%72 = load i32, i32* %1
ret i32 %72
}

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