#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 /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main(int argc, char const *argv[]) {
  int n, p, k, left, right;
  scanf("%d%d%d", &n, &p, &k);
  left = p - k;
  right = p + k;
  if (left > 1)
    printf("<<");
  else
    left = 1;
  for (int i = left; i <= right && i <= n; ++i) {
    if (i != 1)
      printf(" ");
    if (i == p)
      printf("(%d)", i);
    else
      printf("%d", i);
  }
  if (right < n)
    printf(" >>");
  else
    right = n;
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x18(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x1,-0x20(%rbp)
jle    117d <main+0x5d>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1184 <main+0x64>
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%ecx
xor    %eax,%eax
cmp    -0x24(%rbp),%ecx
mov    %al,-0x29(%rbp)
jg     11a7 <main+0x87>
mov    -0x28(%rbp),%eax
cmp    -0x14(%rbp),%eax
setle  %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
test   $0x1,%al
jne    11b7 <main+0x97>
jmp    1215 <main+0xf5>
cmpl   $0x1,-0x28(%rbp)
je     11cf <main+0xaf>
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    11f1 <main+0xd1>
mov    -0x28(%rbp),%esi
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1202 <main+0xe2>
mov    -0x28(%rbp),%esi
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1207 <main+0xe7>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    118a <main+0x6a>
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1234 <main+0x114>
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123a <main+0x11a>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
lea    0xdd4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xebf(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x14(%rsp),%rcx
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
mov    0x14(%rsp),%ebp
mov    %eax,%r14d
sub    %ebp,%r14d
add    %eax,%ebp
mov    $0x1,%ebx
cmp    $0x2,%r14d
jl     1181 <main+0x51>
lea    0xe90(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14d,%ebx
mov    0x10(%rsp),%eax
cmp    %ebp,%ebx
jg     11d5 <main+0xa5>
cmp    %eax,%ebx
jg     11d5 <main+0xa5>
lea    0xe76(%rip),%r14
lea    0xe69(%rip),%r15
nopl   0x0(%rax,%rax,1)
cmp    $0x1,%ebx
je     11af <main+0x7f>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
cmp    0xc(%rsp),%ebx
je     11bb <main+0x8b>
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rsp),%eax
cmp    %ebp,%ebx
jge    11d5 <main+0xa5>
lea    0x1(%rbx),%ecx
cmp    %eax,%ebx
mov    %ecx,%ebx
jl     11a0 <main+0x70>
cmp    %eax,%ebp
jge    11e7 <main+0xb7>
lea    0xe2f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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