#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 main(void) {
  int num, adj[100][100] = {{0}}, u, k, v, i, j, l;
  scanf("%d", &num);
  for (i = 0; i < num; i++) {
    scanf("%d %d", &u, &k);
    for (j = 0; j < k; j++) {
      scanf("%d", &v);
      adj[u - 1][v - 1] = 1;
    }
  }
  for (i = 0; i < num; i++) {
    for (j = 0; j < num; j++) {
      if (j)
        printf(" ");
      printf("%d", adj[i][j]);
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x9c70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x9c50(%rbp),%rdi
xor    %esi,%esi
mov    $0x9c40,%edx
call   1040 <memset@plt>
lea    0xea7(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movl   $0x0,-0x9c60(%rbp)
mov    -0x9c60(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    122a <main+0xfa>
lea    0xe79(%rip),%rdi
lea    -0x9c54(%rbp),%rsi
lea    -0x9c58(%rbp),%rdx
mov    $0x0,%al
call   1050 <scanf@plt>
movl   $0x0,-0x9c64(%rbp)
mov    -0x9c64(%rbp),%eax
cmp    -0x9c58(%rbp),%eax
jge    1211 <main+0xe1>
lea    0xe44(%rip),%rdi
lea    -0x9c5c(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x9c54(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    -0x9c50(%rbp),%rax
imul   $0x190,%rcx,%rcx
add    %rcx,%rax
mov    -0x9c5c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x9c64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c64(%rbp)
jmp    11a6 <main+0x76>
jmp    1216 <main+0xe6>
mov    -0x9c60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c60(%rbp)
jmp    1171 <main+0x41>
movl   $0x0,-0x9c60(%rbp)
mov    -0x9c60(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12dd <main+0x1ad>
movl   $0x0,-0x9c64(%rbp)
mov    -0x9c64(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12bb <main+0x18b>
cmpl   $0x0,-0x9c64(%rbp)
je     1277 <main+0x147>
lea    0xd96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x9c60(%rbp),%rcx
lea    -0x9c50(%rbp),%rax
imul   $0x190,%rcx,%rcx
add    %rcx,%rax
movslq -0x9c64(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd63(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x9c64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c64(%rbp)
jmp    124d <main+0x11d>
lea    0xd46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x9c60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c60(%rbp)
jmp    1234 <main+0x104>
xor    %eax,%eax
add    $0x9c70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x9c58,%rsp
lea    0x10(%rsp),%rbx
mov    $0x9c40,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
lea    0xe97(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
cmpl   $0x0,(%rsp)
jle    1296 <main+0x156>
lea    0x4(%rsp),%r12
lea    0xe77(%rip),%r13
lea    0x8(%rsp),%rbp
xor    %r14d,%r14d
jmp    11ac <main+0x6c>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r14d
mov    (%rsp),%eax
cmp    %eax,%r14d
jge    1209 <main+0xc9>
lea    0xe4d(%rip),%rdi
lea    0xc(%rsp),%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1060 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
jle    11a0 <main+0x60>
xor    %r15d,%r15d
nopl   0x0(%rax)
mov    %r13,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
movslq 0xc(%rsp),%rax
imul   $0x190,%rax,%rax
movslq 0x8(%rsp),%rcx
add    %rbx,%rax
movl   $0x1,-0x194(%rax,%rcx,4)
add    $0x1,%r15d
cmp    0x4(%rsp),%r15d
jl     11d0 <main+0x90>
jmp    11a0 <main+0x60>
test   %eax,%eax
jle    1296 <main+0x156>
lea    0xdeb(%rip),%r14
xor    %r15d,%r15d
jmp    123e <main+0xfe>
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15
movslq (%rsp),%rax
add    $0x190,%rbx
cmp    %rax,%r15
jge    1296 <main+0x156>
test   %eax,%eax
jle    1220 <main+0xe0>
imul   $0x190,%r15,%rax
mov    0x10(%rsp,%rax,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x2,(%rsp)
jl     1220 <main+0xe0>
mov    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    (%rbx,%rbp,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
movslq (%rsp),%rax
cmp    %rax,%rbp
jl     1270 <main+0x130>
jmp    1220 <main+0xe0>
xor    %eax,%eax
add    $0x9c58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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