#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("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    11c2 <main+0xa2>
cmpl   $0x1,-0x10(%rbp)
jne    1186 <main+0x66>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11bd <main+0x9d>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11b8 <main+0x98>
mov    -0x8(%rbp),%esi
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    118d <main+0x6d>
jmp    11bd <main+0x9d>
jmp    131f <main+0x1ff>
cmpl   $0x1,-0x10(%rbp)
jne    1227 <main+0x107>
mov    -0x8(%rbp),%esi
lea    0xe2a(%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    1211 <main+0xf1>
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11e4 <main+0xc4>
mov    -0x8(%rbp),%esi
lea    0xde5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    131a <main+0x1fa>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1259 <main+0x139>
mov    -0x8(%rbp),%esi
lea    0xdbc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    122e <main+0x10e>
lea    0xda7(%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    12e3 <main+0x1c3>
mov    -0x8(%rbp),%esi
lea    0xd77(%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    12c4 <main+0x1a4>
lea    0xd5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1297 <main+0x177>
mov    -0x8(%rbp),%esi
lea    0xd37(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    126e <main+0x14e>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1315 <main+0x1f5>
mov    -0x8(%rbp),%esi
lea    0xd00(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12ea <main+0x1ca>
jmp    131a <main+0x1fa>
jmp    131f <main+0x1ff>
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    1189 <main+0x59>
cmp    $0x1,%ecx
jne    11df <main+0xaf>
mov    $0x4e,%edi
call   1030 <putchar@plt>
jmp    12e7 <main+0x1b7>
cmp    $0x1,%ecx
jne    120c <main+0xdc>
mov    0x10(%rsp),%esi
lea    0xe67(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x3,0xc(%rsp)
jl     11c8 <main+0x98>
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    0xc(%rsp),%eax
add    $0xfffffffe,%eax
cmp    %eax,%ebx
jl     11b0 <main+0x80>
mov    0x10(%rsp),%esi
lea    0xe2d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    12e7 <main+0x1b7>
jl     12e7 <main+0x1b7>
lea    0xe17(%rip),%rbx
xor    %ebp,%ebp
xchg   %ax,%ax
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    0x14(%rsp),%ebp
jl     11f0 <main+0xc0>
jmp    12e7 <main+0x1b7>
test   %eax,%eax
jle    1237 <main+0x107>
lea    0xde9(%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     1220 <main+0xf0>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x3,0x14(%rsp)
jl     12ba <main+0x18a>
lea    0xdb1(%rip),%r14
lea    0xdad(%rip),%r15
xor    %ebp,%ebp
jmp    127c <main+0x14c>
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    12ba <main+0x18a>
mov    0x10(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x3,0xc(%rsp)
jl     1260 <main+0x130>
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     12a0 <main+0x170>
jmp    1260 <main+0x130>
cmpl   $0x0,0xc(%rsp)
jle    12e7 <main+0x1b7>
lea    0xd38(%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     12d0 <main+0x1a0>
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 = [2 x i8] c"N\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [2 x i8] c" \00"
@.str.4 = [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 %34
16: ; preds = %0
%17 = load i32, i32* %4
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %33
21: ; preds = %16
store i32 0, i32* %9
br label %22
22: ; preds = %29, %21
%23 = load i32, i32* %9
%24 = load i32, i32* %4
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %32
26: ; preds = %22
%27 = load i32, i32* %2
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %27)
br label %29
29: ; preds = %26
%30 = load i32, i32* %9
%31 = add nsw i32 %30, 1
store i32 %31, i32* %9
br label %22
32: ; preds = %22
br label %33
33: ; preds = %32, %19
br label %103
34: ; preds = %0
%35 = load i32, i32* %4
%36 = icmp eq i32 %35, 1
br i1 %36, label %37, label %53
37: ; preds = %34
%38 = load i32, i32* %2
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %38)
store i32 0, i32* %10
br label %40
40: ; preds = %47, %37
%41 = load i32, i32* %10
%42 = load i32, i32* %3
%43 = sub nsw i32 %42, 2
%44 = icmp slt i32 %41, %43
br i1 %44, label %45, label %50
45: ; preds = %40
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %47
47: ; preds = %45
%48 = load i32, i32* %10
%49 = add nsw i32 %48, 1
store i32 %49, i32* %10
br label %40
50: ; preds = %40
%51 = load i32, i32* %2
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %51)
br label %102
53: ; preds = %34
store i32 0, i32* %5
br label %54
54: ; preds = %61, %53
%55 = load i32, i32* %5
%56 = load i32, i32* %3
%57 = icmp slt i32 %55, %56
br i1 %57, label %58, label %64
58: ; preds = %54
%59 = load i32, i32* %2
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %59)
br label %61
61: ; preds = %58
%62 = load i32, i32* %5
%63 = add nsw i32 %62, 1
store i32 %63, i32* %5
br label %54
64: ; preds = %54
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %6
br label %66
66: ; preds = %87, %64
%67 = load i32, i32* %6
%68 = load i32, i32* %4
%69 = sub nsw i32 %68, 2
%70 = icmp slt i32 %67, %69
br i1 %70, label %71, label %90
71: ; preds = %66
%72 = load i32, i32* %2
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %72)
store i32 0, i32* %7
br label %74
74: ; preds = %81, %71
%75 = load i32, i32* %7
%76 = load i32, i32* %3
%77 = sub nsw i32 %76, 2
%78 = icmp slt i32 %75, %77
br i1 %78, label %79, label %84
79: ; preds = %74
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %81
81: ; preds = %79
%82 = load i32, i32* %7
%83 = add nsw i32 %82, 1
store i32 %83, i32* %7
br label %74
84: ; preds = %74
%85 = load i32, i32* %2
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %85)
br label %87
87: ; preds = %84
%88 = load i32, i32* %6
%89 = add nsw i32 %88, 1
store i32 %89, i32* %6
br label %66
90: ; preds = %66
store i32 0, i32* %8
br label %91
91: ; preds = %98, %90
%92 = load i32, i32* %8
%93 = load i32, i32* %3
%94 = icmp slt i32 %92, %93
br i1 %94, label %95, label %101
95: ; preds = %91
%96 = load i32, i32* %2
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %96)
br label %98
98: ; preds = %95
%99 = load i32, i32* %8
%100 = add nsw i32 %99, 1
store i32 %100, i32* %8
br label %91
101: ; preds = %91
br label %102
102: ; preds = %101, %50
br label %103
103: ; preds = %102, %33
ret i32 0
}

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