#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 main() {
  int N, w, h, i, j, k, l, m, n;
  scanf("%d", &N);
  scanf("%d", &w);
  scanf("%d", &h);
  if (w == 1) {
    if (h == 1) {
      printf("%d", N);
    } else {
      for (m = 0; m < h; m++) {
        printf("%d\n", N);
      }
    }
  } else {
    if (h == 1) {
      printf("%d", N);
      for (n = 0; n < w - 2; n++) {
        printf(" ");
      }
      printf("%d", N);
    } else {
      {
        for (i = 0; i < w; i++) {
          printf("%d", N);
        }
        printf("\n");
      }
      {
        for (j = 0; j < (h - 2); j++) {
          printf("%d", N);
          {
            for (k = 0; k < (w - 2); k++) {
              printf(" ");
            }
          }
          printf("%d\n", N);
        }
      }
      {
        for (l = 0; l < w; l++) {
          printf("%d", N);
        }
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeaa(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x1,-0xc(%rbp)
jne    11c5 <main+0xa5>
cmpl   $0x1,-0x10(%rbp)
jne    1189 <main+0x69>
mov    -0x8(%rbp),%esi
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c0 <main+0xa0>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11bb <main+0x9b>
mov    -0x8(%rbp),%esi
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1190 <main+0x70>
jmp    11c0 <main+0xa0>
jmp    1322 <main+0x202>
cmpl   $0x1,-0x10(%rbp)
jne    122a <main+0x10a>
mov    -0x8(%rbp),%esi
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    1214 <main+0xf4>
lea    0xe08(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11e7 <main+0xc7>
mov    -0x8(%rbp),%esi
lea    0xde2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    131d <main+0x1fd>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    125c <main+0x13c>
mov    -0x8(%rbp),%esi
lea    0xdb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1231 <main+0x111>
lea    0xda2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    12e6 <main+0x1c6>
mov    -0x8(%rbp),%esi
lea    0xd74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    12c7 <main+0x1a7>
lea    0xd55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    129a <main+0x17a>
mov    -0x8(%rbp),%esi
lea    0xd32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1271 <main+0x151>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1318 <main+0x1f8>
mov    -0x8(%rbp),%esi
lea    0xcfd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12ed <main+0x1cd>
jmp    131d <main+0x1fd>
jmp    1322 <main+0x202>
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),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
mov    0x14(%rsp),%ecx
cmp    $0x1,%eax
jne    11ac <main+0x7c>
cmp    $0x1,%ecx
je     11e8 <main+0xb8>
jl     12d7 <main+0x1a7>
lea    0xe7c(%rip),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    0x14(%rsp),%ebp
jl     1190 <main+0x60>
jmp    12d7 <main+0x1a7>
cmp    $0x1,%ecx
jne    11ff <main+0xcf>
mov    0x10(%rsp),%esi
lea    0xe44(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x3,0xc(%rsp)
jl     11e8 <main+0xb8>
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    0xc(%rsp),%eax
add    $0xfffffffe,%eax
cmp    %eax,%ebx
jl     11d0 <main+0xa0>
mov    0x10(%rsp),%esi
lea    0xe0d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    12d7 <main+0x1a7>
test   %eax,%eax
jle    1227 <main+0xf7>
lea    0xdf6(%rip),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    0xc(%rsp),%ebp
jl     1210 <main+0xe0>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x3,0x14(%rsp)
jl     12aa <main+0x17a>
lea    0xdc1(%rip),%r14
lea    0xdbd(%rip),%r15
xor    %ebp,%ebp
jmp    126c <main+0x13c>
nopw   0x0(%rax,%rax,1)
mov    0x10(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
mov    0x14(%rsp),%eax
add    $0xfffffffe,%eax
cmp    %eax,%ebp
jge    12aa <main+0x17a>
mov    0x10(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x3,0xc(%rsp)
jl     1250 <main+0x120>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    0xc(%rsp),%eax
add    $0xfffffffe,%eax
cmp    %eax,%ebx
jl     1290 <main+0x160>
jmp    1250 <main+0x120>
cmpl   $0x0,0xc(%rsp)
jle    12d7 <main+0x1a7>
lea    0xd48(%rip),%rbx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    0xc(%rsp),%ebp
jl     12c0 <main+0x190>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
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"
@.str.2 = [2 x i8] c" \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 i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %35
16: ; preds = %0
%17 = load i32, i32* %4
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i32, i32* %2
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %20)
br label %34
22: ; preds = %16
store i32 0, i32* %9
br label %23
23: ; preds = %30, %22
%24 = load i32, i32* %9
%25 = load i32, i32* %4
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %33
27: ; preds = %23
%28 = load i32, i32* %2
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %28)
br label %30
30: ; preds = %27
%31 = load i32, i32* %9
%32 = add nsw i32 %31, 1
store i32 %32, i32* %9
br label %23
33: ; preds = %23
br label %34
34: ; preds = %33, %19
br label %104
35: ; preds = %0
%36 = load i32, i32* %4
%37 = icmp eq i32 %36, 1
br i1 %37, label %38, label %54
38: ; preds = %35
%39 = load i32, i32* %2
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %39)
store i32 0, i32* %10
br label %41
41: ; preds = %48, %38
%42 = load i32, i32* %10
%43 = load i32, i32* %3
%44 = sub nsw i32 %43, 2
%45 = icmp slt i32 %42, %44
br i1 %45, label %46, label %51
46: ; preds = %41
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %48
48: ; preds = %46
%49 = load i32, i32* %10
%50 = add nsw i32 %49, 1
store i32 %50, i32* %10
br label %41
51: ; preds = %41
%52 = load i32, i32* %2
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %52)
br label %103
54: ; preds = %35
store i32 0, i32* %5
br label %55
55: ; preds = %62, %54
%56 = load i32, i32* %5
%57 = load i32, i32* %3
%58 = icmp slt i32 %56, %57
br i1 %58, label %59, label %65
59: ; preds = %55
%60 = load i32, i32* %2
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %60)
br label %62
62: ; preds = %59
%63 = load i32, i32* %5
%64 = add nsw i32 %63, 1
store i32 %64, i32* %5
br label %55
65: ; preds = %55
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %6
br label %67
67: ; preds = %88, %65
%68 = load i32, i32* %6
%69 = load i32, i32* %4
%70 = sub nsw i32 %69, 2
%71 = icmp slt i32 %68, %70
br i1 %71, label %72, label %91
72: ; preds = %67
%73 = load i32, i32* %2
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %73)
store i32 0, i32* %7
br label %75
75: ; preds = %82, %72
%76 = load i32, i32* %7
%77 = load i32, i32* %3
%78 = sub nsw i32 %77, 2
%79 = icmp slt i32 %76, %78
br i1 %79, label %80, label %85
80: ; preds = %75
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %82
82: ; preds = %80
%83 = load i32, i32* %7
%84 = add nsw i32 %83, 1
store i32 %84, i32* %7
br label %75
85: ; preds = %75
%86 = load i32, i32* %2
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %86)
br label %88
88: ; preds = %85
%89 = load i32, i32* %6
%90 = add nsw i32 %89, 1
store i32 %90, i32* %6
br label %67
91: ; preds = %67
store i32 0, i32* %8
br label %92
92: ; preds = %99, %91
%93 = load i32, i32* %8
%94 = load i32, i32* %3
%95 = icmp slt i32 %93, %94
br i1 %95, label %96, label %102
96: ; preds = %92
%97 = load i32, i32* %2
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %97)
br label %99
99: ; preds = %96
%100 = load i32, i32* %8
%101 = add nsw i32 %100, 1
store i32 %101, i32* %8
br label %92
102: ; preds = %92
br label %103
103: ; preds = %102, %51
br label %104
104: ; preds = %103, %34
ret i32 0
}

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 = alloca i32
%4 = bitcast 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* %1)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 1
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 1
br i1 %11, label %14, label %24
14: ; preds = %0
br i1 %13, label %80, label %15
15: ; preds = %14
%16 = icmp sgt i32 %12, 0
br i1 %16, label %17, label %83
17: ; preds = %15, %17
%18 = phi i32 [ %21, %17 ], [ 0, %15 ]
%19 = load i32, i32* %1
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = add nuw nsw i32 %18, 1
%22 = load i32, i32* %3
%23 = icmp slt i32 %21, %22
br i1 %23, label %17, label %83
24: ; preds = %0
br i1 %13, label %27, label %25
25: ; preds = %24
%26 = icmp sgt i32 %10, 0
br i1 %26, label %39, label %46
27: ; preds = %24
%28 = load i32, i32* %1
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %28)
%30 = load i32, i32* %2
%31 = icmp sgt i32 %30, 2
br i1 %31, label %32, label %80
32: ; preds = %27, %32
%33 = phi i32 [ %35, %32 ], [ 0, %27 ]
%34 = call i32 @putchar(i32 32)
%35 = add nuw nsw i32 %33, 1
%36 = load i32, i32* %2
%37 = add nsw i32 %36, -2
%38 = icmp slt i32 %35, %37
br i1 %38, label %32, label %80
39: ; preds = %25, %39
%40 = phi i32 [ %43, %39 ], [ 0, %25 ]
%41 = load i32, i32* %1
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %41)
%43 = add nuw nsw i32 %40, 1
%44 = load i32, i32* %2
%45 = icmp slt i32 %43, %44
br i1 %45, label %39, label %46
46: ; preds = %39, %25
%47 = call i32 @putchar(i32 10)
%48 = load i32, i32* %3
%49 = icmp sgt i32 %48, 2
br i1 %49, label %53, label %50
50: ; preds = %66, %46
%51 = load i32, i32* %2
%52 = icmp sgt i32 %51, 0
br i1 %52, label %73, label %83
53: ; preds = %46, %66
%54 = phi i32 [ %69, %66 ], [ 0, %46 ]
%55 = load i32, i32* %1
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %55)
%57 = load i32, i32* %2
%58 = icmp sgt i32 %57, 2
br i1 %58, label %59, label %66
59: ; preds = %53, %59
%60 = phi i32 [ %62, %59 ], [ 0, %53 ]
%61 = call i32 @putchar(i32 32)
%62 = add nuw nsw i32 %60, 1
%63 = load i32, i32* %2
%64 = add nsw i32 %63, -2
%65 = icmp slt i32 %62, %64
br i1 %65, label %59, label %66
66: ; preds = %59, %53
%67 = load i32, i32* %1
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %67)
%69 = add nuw nsw i32 %54, 1
%70 = load i32, i32* %3
%71 = add nsw i32 %70, -2
%72 = icmp slt i32 %69, %71
br i1 %72, label %53, label %50
73: ; preds = %50, %73
%74 = phi i32 [ %77, %73 ], [ 0, %50 ]
%75 = load i32, i32* %1
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %75)
%77 = add nuw nsw i32 %74, 1
%78 = load i32, i32* %2
%79 = icmp slt i32 %77, %78
br i1 %79, label %73, label %83
80: ; preds = %32, %27, %14
%81 = load i32, i32* %1
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %81)
br label %83
83: ; preds = %73, %17, %80, %50, %15
ret i32 0
}