#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) {
    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    1169 <main+0x49>
lea    0xeae(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1250 <main+0x130>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     124b <main+0x12b>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     122f <main+0x10f>
cmpl   $0x1,-0x14(%rbp)
jne    11aa <main+0x8a>
mov    -0x8(%rbp),%esi
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,-0x14(%rbp)
jle    11ff <main+0xdf>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11ff <main+0xdf>
cmpl   $0x1,-0x18(%rbp)
je     11d6 <main+0xb6>
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    11ec <main+0xcc>
mov    -0x8(%rbp),%esi
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11fa <main+0xda>
lea    0xe16(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ff <main+0xdf>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    121c <main+0xfc>
mov    -0x8(%rbp),%esi
lea    0xdf1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1221 <main+0x101>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1183 <main+0x63>
lea    0xdd5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1170 <main+0x50>
jmp    1250 <main+0x130>
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)
jne    1172 <main+0x42>
lea    0xea5(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1226 <main+0xf6>
cmpl   $0x0,0x4(%rsp)
jle    1226 <main+0xf6>
mov    $0x1,%ebx
lea    0xe7d(%rip),%r14
jmp    11a9 <main+0x79>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%eax
cmp    0x4(%rsp),%ebx
mov    %eax,%ebx
jge    1226 <main+0xf6>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    1190 <main+0x60>
xor    %ecx,%ecx
jmp    11ca <main+0x9a>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0xc(%rsp),%eax
mov    %ebp,%ecx
cmp    %eax,%ebp
jge    1190 <main+0x60>
lea    0x1(%rcx),%ebp
cmp    $0x1,%ebx
jne    11f0 <main+0xc0>
mov    0x8(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1210 <main+0xe0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    0x4(%rsp),%ebx
jge    1210 <main+0xe0>
test   %ecx,%ecx
je     11d2 <main+0xa2>
cmp    %eax,%ebp
je     11d2 <main+0xa2>
mov    $0x20,%edi
call   1030 <putchar@plt>
nopl   0x0(%rax,%rax,1)
cmp    0x4(%rsp),%ebx
jne    11c0 <main+0x90>
mov    0x8(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11c0 <main+0x90>
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 %12
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 1)
br label %65
12: ; preds = %0
store i32 1, i32* %5
br label %13
13: ; preds = %61, %12
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = icmp sle i32 %14, %15
br i1 %16, label %17, label %64
17: ; preds = %13
store i32 1, i32* %6
br label %18
18: ; preds = %56, %17
%19 = load i32, i32* %6
%20 = load i32, i32* %3
%21 = icmp sle i32 %19, %20
br i1 %21, label %22, label %59
22: ; preds = %18
%23 = load i32, i32* %5
%24 = icmp eq i32 %23, 1
br i1 %24, label %25, label %28
25: ; preds = %22
%26 = load i32, i32* %2
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %26)
br label %28
28: ; preds = %25, %22
%29 = load i32, i32* %5
%30 = icmp sgt i32 %29, 1
br i1 %30, label %31, label %48
31: ; preds = %28
%32 = load i32, i32* %5
%33 = load i32, i32* %4
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %48
35: ; preds = %31
%36 = load i32, i32* %6
%37 = icmp eq i32 %36, 1
br i1 %37, label %42, label %38
38: ; preds = %35
%39 = load i32, i32* %6
%40 = load i32, i32* %3
%41 = icmp eq i32 %39, %40
br i1 %41, label %42, label %45
42: ; preds = %38, %35
%43 = load i32, i32* %2
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %43)
br label %47
45: ; preds = %38
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %47
47: ; preds = %45, %42
br label %48
48: ; preds = %47, %31, %28
%49 = load i32, i32* %5
%50 = load i32, i32* %4
%51 = icmp eq i32 %49, %50
br i1 %51, label %52, label %55
52: ; preds = %48
%53 = load i32, i32* %2
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %53)
br label %55
55: ; preds = %52, %48
br label %56
56: ; preds = %55
%57 = load i32, i32* %6
%58 = add nsw i32 %57, 1
store i32 %58, i32* %6
br label %18
59: ; preds = %18
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %61
61: ; preds = %59
%62 = load i32, i32* %5
%63 = add nsw i32 %62, 1
store i32 %63, i32* %5
br label %13
64: ; preds = %13
br label %65
65: ; preds = %64, %10
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
br i1 %9, label %13, label %10
10: ; preds = %0
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 1
br i1 %12, label %54, label %15
13: ; preds = %0
%14 = 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 %54
15: ; preds = %10, %49
%16 = phi i32 [ %51, %49 ], [ 1, %10 ]
%17 = load i32, i32* %2
%18 = icmp slt i32 %17, 1
br i1 %18, label %49, label %19
19: ; preds = %15
%20 = icmp eq i32 %16, 1
br label %21
21: ; preds = %19, %45
%22 = phi i32 [ %17, %19 ], [ %47, %45 ]
%23 = phi i32 [ 1, %19 ], [ %46, %45 ]
br i1 %20, label %24, label %27
24: ; preds = %21
%25 = load i32, i32* %1
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %25)
br label %39
27: ; preds = %21
%28 = load i32, i32* %3
%29 = icmp slt i32 %16, %28
br i1 %29, label %30, label %39
30: ; preds = %27
%31 = icmp eq i32 %23, 1
%32 = icmp eq i32 %23, %22
%33 = select i1 %31, i1 true, i1 %32
br i1 %33, label %34, label %37
34: ; preds = %30
%35 = load i32, i32* %1
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %35)
br label %39
37: ; preds = %30
%38 = call i32 @putchar(i32 32)
br label %39
39: ; preds = %24, %34, %37, %27
%40 = load i32, i32* %3
%41 = icmp eq i32 %16, %40
br i1 %41, label %42, label %45
42: ; preds = %39
%43 = load i32, i32* %1
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %43)
br label %45
45: ; preds = %39, %42
%46 = add nuw nsw i32 %23, 1
%47 = load i32, i32* %2
%48 = icmp slt i32 %23, %47
br i1 %48, label %21, label %49
49: ; preds = %45, %15
%50 = call i32 @putchar(i32 10)
%51 = add nuw nsw i32 %16, 1
%52 = load i32, i32* %3
%53 = icmp slt i32 %16, %52
br i1 %53, label %15, label %54
54: ; preds = %49, %10, %13
ret i32 0
}