#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ scanf(char *, int *);
scalar_t__ su(int);
int main() {
  int i, index = 0, n, flag;
  int susu[1500];
  for (i = 2; i <= 10000; i++) {
    if (su(i) && i % 10 == 1) {
      susu[index] = i;
      index++;
    }
  }
  while (scanf("%d", &n) != EOF) {
    flag = -1;
    if (susu[0] >= n) {
      printf("-1\n");
      continue;
    }
    for (i = 0; i < index; i++) {
      if (susu[i] < n) {
        if (flag == -1) {
          printf("%d", susu[i]);
          flag = 1;
        } else
          printf(" %d", susu[i]);
      }
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1790,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x2,-0x8(%rbp)
cmpl   $0x2710,-0x8(%rbp)
jg     11ad <main+0x7d>
mov    -0x8(%rbp),%edi
call   1050 <su@plt>
cmp    $0x0,%rax
je     119a <main+0x6a>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    119a <main+0x6a>
mov    -0x8(%rbp),%ecx
movslq -0xc(%rbp),%rax
mov    %ecx,-0x1790(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    119f <main+0x6f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1150 <main+0x20>
jmp    11b2 <main+0x82>
lea    0xe4c(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2e1f(%rip),%rcx
cmp    (%rcx),%rax
je     1295 <main+0x165>
movl   $0xffffffff,-0x14(%rbp)
mov    -0x1790(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     11fb <main+0xcb>
lea    0xe11(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b2 <main+0x82>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1282 <main+0x152>
movslq -0x8(%rbp),%rax
mov    -0x1790(%rbp,%rax,4),%eax
cmp    -0x10(%rbp),%eax
jge    126f <main+0x13f>
cmpl   $0xffffffff,-0x14(%rbp)
jne    1251 <main+0x121>
movslq -0x8(%rbp),%rax
mov    -0x1790(%rbp,%rax,4),%esi
lea    0xdc7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    126a <main+0x13a>
movslq -0x8(%rbp),%rax
mov    -0x1790(%rbp,%rax,4),%esi
lea    0xda1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    126f <main+0x13f>
jmp    1274 <main+0x144>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1202 <main+0xd2>
lea    0xd79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b2 <main+0x82>
xor    %eax,%eax
add    $0x1790,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1788,%rsp
mov    $0x2,%ebx
xor    %r12d,%r12d
jmp    117b <main+0x2b>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0x2711,%ebx
je     11b4 <main+0x64>
mov    %ebx,%edi
call   1070 <su@plt>
test   %rax,%rax
je     1170 <main+0x20>
movzwl %bx,%eax
imul   $0xcccd,%eax,%eax
shr    $0x12,%eax
and    $0xfffffffe,%eax
lea    (%rax,%rax,4),%eax
neg    %eax
add    %ebx,%eax
add    $0x1,%eax
cmp    $0x2,%ax
jne    1170 <main+0x20>
movslq %r12d,%r12
mov    %ebx,0x10(%rsp,%r12,4)
add    $0x1,%r12d
jmp    1170 <main+0x20>
lea    0xe46(%rip),%r13
lea    0x8(%rsp),%rsi
mov    %r13,%rdi
call   1060 <scanf@plt>
mov    0x2e19(%rip),%r14
cmp    (%r14),%rax
jne    11e8 <main+0x98>
xor    %eax,%eax
add    $0x1788,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x10(%rsp),%ebx
mov    %r12d,%r15d
add    $0xffffffffffffffff,%r15
lea    0x8(%rsp),%rbp
mov    %ebx,0xc(%rsp)
jmp    121c <main+0xcc>
xchg   %ax,%ax
lea    0xdfd(%rip),%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
call   1060 <scanf@plt>
cmp    (%r14),%rax
je     11d4 <main+0x84>
mov    0x8(%rsp),%eax
cmp    %eax,%ebx
jge    1200 <main+0xb0>
test   %r12d,%r12d
lea    0xdd2(%rip),%rbx
jle    1280 <main+0x130>
mov    $0xffffffff,%ebp
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp,%r14,4),%esi
cmp    %eax,%esi
jge    1262 <main+0x112>
cmp    $0xffffffff,%ebp
mov    %rbx,%rdi
cmove  %r13,%rdi
mov    $0x1,%eax
cmove  %eax,%ebp
xor    %eax,%eax
call   1050 <printf@plt>
cmp    %r14,%r15
je     1280 <main+0x130>
mov    0x8(%rsp),%eax
add    $0x1,%r14
jmp    1240 <main+0xf0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2d57(%rip),%r14
mov    0xc(%rsp),%ebx
lea    0x8(%rsp),%rbp
jmp    120c <main+0xbc>

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

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