#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;
  int w;
  int h;
  scanf("%d", &N);
  scanf("%d", &w);
  scanf("%d", &h);
  int a;
  int b;
  for (b = 1; b <= h; b++) {
    for (a = 1; a <= w; a++) {
      if (b == 1 || b == h) {
        if (a != w) {
          printf("%d", N);
        } else {
          printf("%d", N);
          printf("\n");
        }
      } else {
        if (a == 1) {
          printf("%d", N);
        } else if (a == w) {
          printf("%d", N);
          printf("\n");
        } else {
          printf(" ");
        }
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%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>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     126f <main+0x14f>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     125c <main+0x13c>
cmpl   $0x1,-0x18(%rbp)
je     119b <main+0x7b>
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    11e1 <main+0xc1>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     11bd <main+0x9d>
mov    -0x8(%rbp),%esi
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11dc <main+0xbc>
mov    -0x8(%rbp),%esi
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1249 <main+0x129>
cmpl   $0x1,-0x14(%rbp)
jne    1201 <main+0xe1>
mov    -0x8(%rbp),%esi
lea    0xe0b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1244 <main+0x124>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1231 <main+0x111>
mov    -0x8(%rbp),%esi
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdde(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123f <main+0x11f>
lea    0xdcd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1244 <main+0x124>
jmp    1249 <main+0x129>
jmp    124e <main+0x12e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1179 <main+0x59>
jmp    1261 <main+0x141>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1166 <main+0x46>
xor    %eax,%eax
add    $0x20,%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    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x10(%rsp),%eax
test   %eax,%eax
jle    1259 <main+0x129>
mov    $0x1,%r15d
mov    0x14(%rsp),%ebp
lea    0xe7b(%rip),%r14
jmp    11a4 <main+0x74>
nopw   0x0(%rax,%rax,1)
mov    0x10(%rsp),%eax
lea    0x1(%r15),%ecx
cmp    %eax,%r15d
mov    %ecx,%r15d
jge    1259 <main+0x129>
test   %ebp,%ebp
jle    1194 <main+0x64>
cmp    $0x1,%r15d
je     11d0 <main+0xa0>
cmp    %eax,%r15d
je     11d0 <main+0xa0>
mov    0xc(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11ed <main+0xbd>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0xc(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x1,%ebp
jne    11ed <main+0xbd>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x14(%rsp),%ebp
cmp    $0x2,%ebp
jl     1190 <main+0x60>
mov    $0x1,%ebx
jmp    120d <main+0xdd>
nopl   (%rax)
call   1030 <putchar@plt>
mov    0x14(%rsp),%ebp
cmp    %ebp,%ebx
jge    1190 <main+0x60>
add    $0x1,%ebx
cmp    $0x1,%r15d
je     1240 <main+0x110>
cmp    0x10(%rsp),%r15d
je     1240 <main+0x110>
mov    $0x20,%edi
cmp    %ebp,%ebx
jne    1200 <main+0xd0>
mov    0xc(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
jmp    1200 <main+0xd0>
nopl   0x0(%rax,%rax,1)
mov    0xc(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
cmp    %ebp,%ebx
je     1200 <main+0xd0>
jmp    1205 <main+0xd5>
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"\0A\00"
@.str.2 = [2 x i8] c" \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
store i32 1, i32* %6
br label %10
10: ; preds = %61, %0
%11 = load i32, i32* %6
%12 = load i32, i32* %4
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %64
14: ; preds = %10
store i32 1, i32* %5
br label %15
15: ; preds = %57, %14
%16 = load i32, i32* %5
%17 = load i32, i32* %3
%18 = icmp sle i32 %16, %17
br i1 %18, label %19, label %60
19: ; preds = %15
%20 = load i32, i32* %6
%21 = icmp eq i32 %20, 1
br i1 %21, label %26, label %22
22: ; preds = %19
%23 = load i32, i32* %6
%24 = load i32, i32* %4
%25 = icmp eq i32 %23, %24
br i1 %25, label %26, label %38
26: ; preds = %22, %19
%27 = load i32, i32* %5
%28 = load i32, i32* %3
%29 = icmp ne i32 %27, %28
br i1 %29, label %30, label %33
30: ; preds = %26
%31 = load i32, i32* %2
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %31)
br label %37
33: ; preds = %26
%34 = load i32, i32* %2
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %34)
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %37
37: ; preds = %33, %30
br label %56
38: ; preds = %22
%39 = load i32, i32* %5
%40 = icmp eq i32 %39, 1
br i1 %40, label %41, label %44
41: ; preds = %38
%42 = load i32, i32* %2
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %42)
br label %55
44: ; preds = %38
%45 = load i32, i32* %5
%46 = load i32, i32* %3
%47 = icmp eq i32 %45, %46
br i1 %47, label %48, label %52
48: ; preds = %44
%49 = load i32, i32* %2
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %49)
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %54
52: ; preds = %44
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %54
54: ; preds = %52, %48
br label %55
55: ; preds = %54, %41
br label %56
56: ; preds = %55, %37
br label %57
57: ; preds = %56
%58 = load i32, i32* %5
%59 = add nsw i32 %58, 1
store i32 %59, i32* %5
br label %15
60: ; preds = %15
br label %61
61: ; preds = %60
%62 = load i32, i32* %6
%63 = add nsw i32 %62, 1
store i32 %63, i32* %6
br label %10
64: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\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* %3
%11 = icmp slt i32 %10, 1
br i1 %11, label %64, label %12
12: ; preds = %0
%13 = load i32, i32* %2
br label %14
14: ; preds = %12, %59
%15 = phi i32 [ %60, %59 ], [ %10, %12 ]
%16 = phi i32 [ %61, %59 ], [ %13, %12 ]
%17 = phi i32 [ %62, %59 ], [ 1, %12 ]
%18 = icmp slt i32 %16, 1
br i1 %18, label %59, label %19
19: ; preds = %14
%20 = icmp eq i32 %17, 1
%21 = icmp eq i32 %17, %15
%22 = select i1 %20, i1 true, i1 %21
br i1 %22, label %26, label %23
23: ; preds = %19
%24 = load i32, i32* %1
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %24)
br label %32
26: ; preds = %19
%27 = icmp eq i32 %16, 1
%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)
br i1 %27, label %30, label %32
30: ; preds = %26
%31 = call i32 @putchar(i32 10)
br label %32
32: ; preds = %26, %30, %23
%33 = load i32, i32* %2
%34 = icmp sgt i32 %33, 1
br i1 %34, label %35, label %56
35: ; preds = %32, %52
%36 = phi i32 [ %54, %52 ], [ %33, %32 ]
%37 = phi i32 [ %53, %52 ], [ 2, %32 ]
%38 = load i32, i32* %3
%39 = icmp eq i32 %17, %38
%40 = select i1 %20, i1 true, i1 %39
%41 = icmp eq i32 %37, %36
br i1 %40, label %42, label %45
42: ; preds = %35
%43 = load i32, i32* %1
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %43)
br i1 %41, label %49, label %52
45: ; preds = %35
br i1 %41, label %46, label %49
46: ; preds = %45
%47 = load i32, i32* %1
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %47)
br label %49
49: ; preds = %45, %42, %46
%50 = phi i32 [ 10, %46 ], [ 10, %42 ], [ 32, %45 ]
%51 = call i32 @putchar(i32 %50)
br label %52
52: ; preds = %49, %42
%53 = add nuw nsw i32 %37, 1
%54 = load i32, i32* %2
%55 = icmp slt i32 %37, %54
br i1 %55, label %35, label %56
56: ; preds = %52, %32
%57 = phi i32 [ %33, %32 ], [ %54, %52 ]
%58 = load i32, i32* %3
br label %59
59: ; preds = %56, %14
%60 = phi i32 [ %58, %56 ], [ %15, %14 ]
%61 = phi i32 [ %57, %56 ], [ %16, %14 ]
%62 = add nuw nsw i32 %17, 1
%63 = icmp slt i32 %17, %60
br i1 %63, label %14, label %64
64: ; preds = %59, %0
ret i32 0
}