#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*/ check(int **, int, int *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int country, matrix[100][100], i, j, code, l[100], color;
  scanf("%d", &country);
  for (i = 0; i < country; i++) {
    for (j = 0; j < country; j++) {
      scanf("%d", &matrix[i][j]);
    }
  }
  scanf("%d", &code);
  for (i = 0; i < country; i++) {
    check(matrix, i, l);
  }
  for (i = 0; i < country; i++) {
    printf(" %d", l[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9e00,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x9c54(%rbp)
mov    -0x9c54(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11e3 <main+0xb3>
movl   $0x0,-0x9c58(%rbp)
mov    -0x9c58(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ca <main+0x9a>
movslq -0x9c54(%rbp),%rax
lea    -0x9c50(%rbp),%rsi
imul   $0x190,%rax,%rax
add    %rax,%rsi
movslq -0x9c58(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe50(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x9c58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c58(%rbp)
jmp    1175 <main+0x45>
jmp    11cf <main+0x9f>
mov    -0x9c54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c54(%rbp)
jmp    115c <main+0x2c>
lea    0xe17(%rip),%rdi
lea    -0x9c5c(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x0,-0x9c54(%rbp)
mov    -0x9c54(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    123c <main+0x10c>
lea    -0x9c50(%rbp),%rdi
mov    -0x9c54(%rbp),%esi
lea    -0x9df0(%rbp),%rdx
call   1050 <check@plt>
mov    -0x9c54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c54(%rbp)
jmp    1200 <main+0xd0>
movl   $0x0,-0x9c54(%rbp)
mov    -0x9c54(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1283 <main+0x153>
movslq -0x9c54(%rbp),%rax
mov    -0x9df0(%rbp,%rax,4),%esi
lea    0xd96(%rip),%rdi
call   1030 <printf@plt>
mov    -0x9c54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c54(%rbp)
jmp    1246 <main+0x116>
xor    %eax,%eax
add    $0x9e00,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x9de0,%rsp
lea    0xeba(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
test   %eax,%eax
jle    11af <main+0x7f>
lea    0x1a0(%rsp),%r15
xor    %r12d,%r12d
lea    0xe96(%rip),%r14
jmp    1183 <main+0x53>
nopl   (%rax)
movslq %eax,%rcx
add    $0x1,%r12
add    $0x190,%r15
cmp    %rcx,%r12
jge    11af <main+0x7f>
test   %eax,%eax
jle    1170 <main+0x40>
mov    %r15,%r13
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r13,%rsi
call   1040 <scanf@plt>
add    $0x1,%rbx
movslq 0x8(%rsp),%rax
add    $0x4,%r13
cmp    %rax,%rbx
jl     1190 <main+0x60>
jmp    1170 <main+0x40>
lea    0xe4b(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    122a <main+0xfa>
xor    %ebx,%ebx
lea    0x1a0(%rsp),%r14
lea    0x10(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %r15,%rdx
call   1050 <check@plt>
add    $0x1,%ebx
mov    0x8(%rsp),%eax
cmp    %eax,%ebx
jl     11e0 <main+0xb0>
test   %eax,%eax
jle    122a <main+0xfa>
xor    %ebx,%ebx
lea    0xdfb(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x10(%rsp,%rbx,4),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
add    $0x1,%rbx
movslq 0x8(%rsp),%rax
cmp    %rax,%rbx
jl     1210 <main+0xe0>
xor    %eax,%eax
add    $0x9de0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

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