#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 N, w, h;
  scanf("%d %d %d", &N, &w, &h);
  int i, j;
  if ((N == 1) && (w == 1) && (h == 1)) {
    printf("%d", 1);
  } else {
    for (i = 1; i <= h; i++) {
      for (j = 1; j <= w; j++) {
        if (i == 1) {
          printf("%d", N);
        }
        if ((i > 1) && (i < h)) {
          if ((j == 1) || (j == w)) {
            printf("%d", N);
          } else {
            printf(" ");
          }
        }
        if (i == h) {
          printf("%d", N);
        }
      }
      printf("\n");
    }
  }
  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
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    117d <main+0x5d>
cmpl   $0x1,-0xc(%rbp)
jne    117d <main+0x5d>
cmpl   $0x1,-0x10(%rbp)
jne    117d <main+0x5d>
lea    0xe9a(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1264 <main+0x144>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     125f <main+0x13f>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1243 <main+0x123>
cmpl   $0x1,-0x14(%rbp)
jne    11be <main+0x9e>
mov    -0x8(%rbp),%esi
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,-0x14(%rbp)
jle    1213 <main+0xf3>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1213 <main+0xf3>
cmpl   $0x1,-0x18(%rbp)
je     11ea <main+0xca>
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1200 <main+0xe0>
mov    -0x8(%rbp),%esi
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    120e <main+0xee>
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1213 <main+0xf3>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1230 <main+0x110>
mov    -0x8(%rbp),%esi
lea    0xddd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1235 <main+0x115>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1197 <main+0x77>
lea    0xdc1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1184 <main+0x64>
jmp    1264 <main+0x144>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x4(%rsp),%rcx
call   1050 <scanf@plt>
cmpl   $0x1,0x8(%rsp)
mov    0xc(%rsp),%eax
mov    0x4(%rsp),%ecx
jne    1184 <main+0x54>
cmp    $0x1,%eax
jne    1184 <main+0x54>
cmp    $0x1,%ecx
jne    1184 <main+0x54>
lea    0xe93(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1241 <main+0x111>
test   %ecx,%ecx
jle    1241 <main+0x111>
mov    $0x1,%ebp
lea    0xe6e(%rip),%r14
test   %eax,%eax
jle    1220 <main+0xf0>
xor    %ecx,%ecx
jmp    11ba <main+0x8a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0xc(%rsp),%eax
mov    %ebx,%ecx
cmp    %eax,%ebx
jge    1220 <main+0xf0>
lea    0x1(%rcx),%ebx
cmp    $0x1,%ebp
jne    11e0 <main+0xb0>
mov    0x8(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1200 <main+0xd0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    0x4(%rsp),%ebp
jge    1200 <main+0xd0>
test   %ecx,%ecx
je     11c2 <main+0x92>
cmp    %eax,%ebx
je     11c2 <main+0x92>
mov    $0x20,%edi
call   1030 <putchar@plt>
nopl   0x0(%rax,%rax,1)
cmp    0x4(%rsp),%ebp
jne    11b0 <main+0x80>
mov    0x8(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11b0 <main+0x80>
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    0x4(%rsp),%ebp
jge    1241 <main+0x111>
add    $0x1,%ebp
mov    0xc(%rsp),%eax
test   %eax,%eax
jg     11a0 <main+0x70>
jmp    1220 <main+0xf0>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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