#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 rand();
int /*<<< orphan*/ scanf(char *, int *, ...);
int main() {
  int h, w, i, j, k, p, x, y;
  scanf("%d%d%d", &h, &w, &k);
  for (i = 0; i < k; i++) {
    scanf("%d", &p);
    for (j = 0; j < p; j++)
      scanf("%d", &x, &y);
  }
  for (i = 0; i < h; i++) {
    for (j = 0; j < w; j++)
      printf("%d ", rand() % 9);
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x18(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11c8 <main+0x98>
lea    0xe91(%rip),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11b5 <main+0x85>
lea    0xe6c(%rip),%rdi
lea    -0x20(%rbp),%rsi
lea    -0x24(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1185 <main+0x55>
jmp    11ba <main+0x8a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1160 <main+0x30>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1237 <main+0x107>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    121b <main+0xeb>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
lea    0xe01(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11e2 <main+0xb2>
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11cf <main+0x9f>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xeab(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    11ca <main+0x8a>
lea    0xe8b(%rip),%rbx
mov    %rsp,%r14
lea    0x14(%rsp),%r15
lea    0x10(%rsp),%r12
xor    %r13d,%r13d
jmp    119b <main+0x5b>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r13d
cmp    0x4(%rsp),%r13d
jge    11ca <main+0x8a>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x0,(%rsp)
jle    1190 <main+0x50>
xor    %ebp,%ebp
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
add    $0x1,%ebp
cmp    (%rsp),%ebp
jl     11b0 <main+0x70>
jmp    1190 <main+0x50>
cmpl   $0x0,0xc(%rsp)
jle    1238 <main+0xf8>
lea    0xe2f(%rip),%rbx
xor    %r14d,%r14d
jmp    11f5 <main+0xb5>
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r14d
cmp    0xc(%rsp),%r14d
jge    1238 <main+0xf8>
cmpl   $0x0,0x8(%rsp)
jle    11e0 <main+0xa0>
xor    %ebp,%ebp
xchg   %ax,%ax
xor    %eax,%eax
call   1060 <rand@plt>
movslq %eax,%rsi
imul   $0x38e38e39,%rsi,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
lea    (%rax,%rax,8),%eax
sub    %eax,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    0x8(%rsp),%ebp
jl     1200 <main+0xc0>
jmp    11e0 <main+0xa0>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
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 = [4 x i8] c"%d \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
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
%10 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %6)
store i32 0, i32* %4
br label %11
11: ; preds = %27, %0
%12 = load i32, i32* %4
%13 = load i32, i32* %6
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %30
15: ; preds = %11
%16 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
store i32 0, i32* %5
br label %17
17: ; preds = %23, %15
%18 = load i32, i32* %5
%19 = load i32, i32* %7
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8, i32* %9)
br label %23
23: ; preds = %21
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %17
26: ; preds = %17
br label %27
27: ; preds = %26
%28 = load i32, i32* %4
%29 = add nsw i32 %28, 1
store i32 %29, i32* %4
br label %11
30: ; preds = %11
store i32 0, i32* %4
br label %31
31: ; preds = %49, %30
%32 = load i32, i32* %4
%33 = load i32, i32* %2
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %52
35: ; preds = %31
store i32 0, i32* %5
br label %36
36: ; preds = %44, %35
%37 = load i32, i32* %5
%38 = load i32, i32* %3
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %47
40: ; preds = %36
%41 = call i32 (...) @rand()
%42 = srem i32 %41, 9
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %42)
br label %44
44: ; preds = %40
%45 = load i32, i32* %5
%46 = add nsw i32 %45, 1
store i32 %46, i32* %5
br label %36
47: ; preds = %36
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %49
49: ; preds = %47
%50 = load i32, i32* %4
%51 = add nsw i32 %50, 1
store i32 %51, i32* %4
br label %31
52: ; preds = %31
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d%d%d\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %1 to i8*
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%14 = load i32, i32* %3
%15 = icmp sgt i32 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %30, %0
%17 = load i32, i32* %1
%18 = icmp sgt i32 %17, 0
br i1 %18, label %34, label %51
19: ; preds = %0, %30
%20 = phi i32 [ %31, %30 ], [ 0, %0 ]
%21 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%22 = load i32, i32* %4
%23 = icmp sgt i32 %22, 0
br i1 %23, label %24, label %30
24: ; preds = %19, %24
%25 = phi i32 [ %27, %24 ], [ 0, %19 ]
%26 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5, i32* %6)
%27 = add nuw nsw i32 %25, 1
%28 = load i32, i32* %4
%29 = icmp slt i32 %27, %28
br i1 %29, label %24, label %30
30: ; preds = %24, %19
%31 = add nuw nsw i32 %20, 1
%32 = load i32, i32* %3
%33 = icmp slt i32 %31, %32
br i1 %33, label %19, label %16
34: ; preds = %16, %46
%35 = phi i32 [ %48, %46 ], [ 0, %16 ]
%36 = load i32, i32* %2
%37 = icmp sgt i32 %36, 0
br i1 %37, label %38, label %46
38: ; preds = %34, %38
%39 = phi i32 [ %43, %38 ], [ 0, %34 ]
%40 = call i32 (...) @rand()
%41 = srem i32 %40, 9
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %41)
%43 = add nuw nsw i32 %39, 1
%44 = load i32, i32* %2
%45 = icmp slt i32 %43, %44
br i1 %45, label %38, label %46
46: ; preds = %38, %34
%47 = call i32 @putchar(i32 10)
%48 = add nuw nsw i32 %35, 1
%49 = load i32, i32* %1
%50 = icmp slt i32 %48, %49
br i1 %50, label %34, label %51
51: ; preds = %46, %16
ret i32 0
}