#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;
  for (i = 1; i <= h; i++) {
    for (j = 1; j <= w; j++) {
      if ((j == 1) || (j == w)) {
        printf("%d", N);
      } else {
        if ((i == 1) || (i == h)) {
          printf("%d", N);
        } else {
          printf(" ");
        }
      }
    }
    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>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1207 <main+0xe7>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11eb <main+0xcb>
cmpl   $0x1,-0x18(%rbp)
je     1183 <main+0x63>
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1199 <main+0x79>
mov    -0x8(%rbp),%esi
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d8 <main+0xb8>
cmpl   $0x1,-0x14(%rbp)
je     11af <main+0x8f>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    11c5 <main+0xa5>
mov    -0x8(%rbp),%esi
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d3 <main+0xb3>
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d8 <main+0xb8>
jmp    11dd <main+0xbd>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1161 <main+0x41>
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114e <main+0x2e>
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    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
call   1050 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    11da <main+0xaa>
mov    $0x1,%ebx
lea    0xe9a(%rip),%r14
jmp    1185 <main+0x55>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%eax
cmp    0x4(%rsp),%ebx
mov    %eax,%ebx
jge    11da <main+0xaa>
mov    0x8(%rsp),%eax
test   %eax,%eax
jle    1170 <main+0x40>
xor    %ebp,%ebp
jmp    11b6 <main+0x86>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0xc(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%eax
cmp    %eax,%ebp
jge    1170 <main+0x40>
mov    %ebp,%ecx
lea    0x1(%rcx),%ebp
test   %ecx,%ecx
je     11a0 <main+0x70>
cmp    %eax,%ebp
je     11a0 <main+0x70>
cmp    $0x1,%ebx
je     11a0 <main+0x70>
cmp    0x4(%rsp),%ebx
je     11a0 <main+0x70>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    11ae <main+0x7e>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 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 ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
store i32 1, i32* %5
br label %8
8: ; preds = %46, %0
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %49
12: ; preds = %8
store i32 1, i32* %6
br label %13
13: ; preds = %41, %12
%14 = load i32, i32* %6
%15 = load i32, i32* %3
%16 = icmp sle i32 %14, %15
br i1 %16, label %17, label %44
17: ; preds = %13
%18 = load i32, i32* %6
%19 = icmp eq i32 %18, 1
br i1 %19, label %24, label %20
20: ; preds = %17
%21 = load i32, i32* %6
%22 = load i32, i32* %3
%23 = icmp eq i32 %21, %22
br i1 %23, label %24, label %27
24: ; preds = %20, %17
%25 = load i32, i32* %2
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %25)
br label %40
27: ; preds = %20
%28 = load i32, i32* %5
%29 = icmp eq i32 %28, 1
br i1 %29, label %34, label %30
30: ; preds = %27
%31 = load i32, i32* %5
%32 = load i32, i32* %4
%33 = icmp eq i32 %31, %32
br i1 %33, label %34, label %37
34: ; preds = %30, %27
%35 = load i32, i32* %2
%36 = call i32 (i8*, ...) @printf(i8* 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 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %39
39: ; preds = %37, %34
br label %40
40: ; preds = %39, %24
br label %41
41: ; preds = %40
%42 = load i32, i32* %6
%43 = add nsw i32 %42, 1
store i32 %43, i32* %6
br label %13
44: ; preds = %13
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %46
46: ; preds = %44
%47 = load i32, i32* %5
%48 = add nsw i32 %47, 1
store i32 %48, i32* %5
br label %8
49: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [7 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 ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 1
br i1 %9, label %43, label %10
10: ; preds = %0, %38
%11 = phi i32 [ %40, %38 ], [ 1, %0 ]
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 1
br i1 %13, label %38, label %14
14: ; preds = %10
%15 = icmp eq i32 %11, 1
br label %16
16: ; preds = %14, %34
%17 = phi i32 [ %12, %14 ], [ %36, %34 ]
%18 = phi i32 [ 1, %14 ], [ %35, %34 ]
%19 = icmp eq i32 %18, 1
%20 = icmp eq i32 %18, %17
%21 = select i1 %19, i1 true, i1 %20
br i1 %21, label %22, label %25
22: ; preds = %16
%23 = load i32, i32* %1
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %23)
br label %34
25: ; preds = %16
%26 = load i32, i32* %3
%27 = icmp eq i32 %11, %26
%28 = select i1 %15, i1 true, i1 %27
br i1 %28, label %29, label %32
29: ; preds = %25
%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 %34
32: ; preds = %25
%33 = call i32 @putchar(i32 32)
br label %34
34: ; preds = %22, %32, %29
%35 = add nuw nsw i32 %18, 1
%36 = load i32, i32* %2
%37 = icmp slt i32 %18, %36
br i1 %37, label %16, label %38
38: ; preds = %34, %10
%39 = call i32 @putchar(i32 10)
%40 = add nuw nsw i32 %11, 1
%41 = load i32, i32* %3
%42 = icmp slt i32 %11, %41
br i1 %42, label %10, label %43
43: ; preds = %38, %0
ret i32 0
}