#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ scanf(char *, int *, ...);
int main(void) {
  int day, month, year, N, iN, D, iD, printed, goNoGo, everyoneOK;
  while (scanf("%d %d", &N, &D) != EOF) {
    iD = printed = 0;
    while (iD++ < D) {
      scanf("%d/%d/%d", &day, &month, &year);
      iN = 0, everyoneOK = 1;
      while (iN++ < N) {
        scanf("%d", &goNoGo);
        everyoneOK &= goNoGo;
      }
      if (!printed && everyoneOK) {
        printf("%d/%d/%d\n", day, month, year);
        printed = 1;
      }
    }
    if (!printed) {
      printf("Pizza antes de FdI\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
mov    0x2e9c(%rip),%rcx
cmp    (%rcx),%rax
je     1227 <main+0x107>
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x20(%rbp)
cmp    -0x1c(%rbp),%eax
jge    120a <main+0xea>
lea    0xe88(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0x18(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x18(%rbp)
cmp    -0x14(%rbp),%eax
jge    11d3 <main+0xb3>
lea    0xe49(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x28(%rbp),%eax
and    -0x2c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
jmp    119f <main+0x7f>
cmpl   $0x0,-0x24(%rbp)
jne    1205 <main+0xe5>
cmpl   $0x0,-0x2c(%rbp)
je     1205 <main+0xe5>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe18(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x24(%rbp)
jmp    1163 <main+0x43>
cmpl   $0x0,-0x24(%rbp)
jne    1222 <main+0x102>
lea    0xdfe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    112f <main+0xf>
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    0xebb(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x2e8d(%rip),%rcx
cmp    (%rcx),%rax
jne    1171 <main+0x41>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe8b(%rip),%rbx
lea    0x8(%rsp),%rbp
jmp    11ae <main+0x7e>
nop
lea    0xe92(%rip),%rdi
call   1030 <puts@plt>
lea    0xe6d(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x2e3f(%rip),%rcx
cmp    (%rcx),%rax
je     1160 <main+0x30>
cmpl   $0x0,(%rsp)
jle    1180 <main+0x50>
xor    %r15d,%r15d
mov    $0x1,%r14d
jmp    11d1 <main+0xa1>
nop
lea    0x1(%r14),%eax
cmp    (%rsp),%r14d
mov    %eax,%r14d
jge    1260 <main+0x130>
lea    0xe2e(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x0,0x4(%rsp)
mov    $0x1,%r12d
jle    122d <main+0xfd>
xor    %r13d,%r13d
mov    $0x1,%r12d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%r13d
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
and    0x8(%rsp),%r12d
cmp    0x4(%rsp),%r13d
jl     1210 <main+0xe0>
test   %r15d,%r15d
jne    11c0 <main+0x90>
test   %r12d,%r12d
je     11c0 <main+0x90>
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
lea    0xdc5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%r15d
jmp    11c0 <main+0x90>
nopl   0x0(%rax)
test   %r15d,%r15d
jne    118c <main+0x5c>
jmp    1180 <main+0x50>

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@EOF = global i64 0
@.str.1 = [9 x i8] c"%d/%d/%d\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [10 x i8] c"%d/%d/%d\0A\00"
@.str.4 = [20 x i8] c"Pizza antes de FdI\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
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %1
br label %12
12: ; preds = %51, %0
%13 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %5, i32* %7)
%14 = load i64, i64* @EOF
%15 = icmp ne i64 %13, %14
br i1 %15, label %16, label %52
16: ; preds = %12
store i32 0, i32* %9
store i32 0, i32* %8
br label %17
17: ; preds = %45, %16
%18 = load i32, i32* %8
%19 = add nsw i32 %18, 1
store i32 %19, i32* %8
%20 = load i32, i32* %7
%21 = icmp slt i32 %18, %20
br i1 %21, label %22, label %46
22: ; preds = %17
%23 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
store i32 0, i32* %6
store i32 1, i32* %11
br label %24
24: ; preds = %29, %22
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 1
store i32 %26, i32* %6
%27 = load i32, i32* %5
%28 = icmp slt i32 %25, %27
br i1 %28, label %29, label %34
29: ; preds = %24
%30 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %10)
%31 = load i32, i32* %10
%32 = load i32, i32* %11
%33 = and i32 %32, %31
store i32 %33, i32* %11
br label %24
34: ; preds = %24
%35 = load i32, i32* %9
%36 = icmp ne i32 %35, 0
br i1 %36, label %45, label %37
37: ; preds = %34
%38 = load i32, i32* %11
%39 = icmp ne i32 %38, 0
br i1 %39, label %40, label %45
40: ; preds = %37
%41 = load i32, i32* %2
%42 = load i32, i32* %3
%43 = load i32, i32* %4
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %41, i32 %42, i32 %43)
store i32 1, i32* %9
br label %45
45: ; preds = %40, %37, %34
br label %17
46: ; preds = %17
%47 = load i32, i32* %9
%48 = icmp ne i32 %47, 0
br i1 %48, label %51, label %49
49: ; preds = %46
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
br label %51
51: ; preds = %49, %46
br label %12
52: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@EOF = global i64 0
@.str.1 = [9 x i8] c"%d/%d/%d\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [10 x i8] c"%d/%d/%d\0A\00"
@str = [19 x i8] c"Pizza antes de FdI\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 i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %4, i32* %5)
%14 = load i64, i64* @EOF
%15 = icmp eq i64 %13, %14
br i1 %15, label %57, label %16
16: ; preds = %0, %53
%17 = load i32, i32* %5
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %51
19: ; preds = %16, %44
%20 = phi i32 [ %46, %44 ], [ 1, %16 ]
%21 = phi i32 [ %45, %44 ], [ 0, %16 ]
%22 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%23 = load i32, i32* %4
%24 = icmp sgt i32 %23, 0
br i1 %24, label %25, label %34
25: ; preds = %19, %25
%26 = phi i32 [ %31, %25 ], [ 1, %19 ]
%27 = phi i32 [ %28, %25 ], [ 0, %19 ]
%28 = add nuw nsw i32 %27, 1
%29 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %6)
%30 = load i32, i32* %6
%31 = and i32 %30, %26
%32 = load i32, i32* %4
%33 = icmp slt i32 %28, %32
br i1 %33, label %25, label %34
34: ; preds = %25, %19
%35 = phi i32 [ 1, %19 ], [ %31, %25 ]
%36 = icmp eq i32 %21, 0
%37 = icmp ne i32 %35, 0
%38 = select i1 %36, i1 %37, i1 false
br i1 %38, label %39, label %44
39: ; preds = %34
%40 = load i32, i32* %1
%41 = load i32, i32* %2
%42 = load i32, i32* %3
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %40, i32 %41, i32 %42)
br label %44
44: ; preds = %39, %34
%45 = phi i32 [ 1, %39 ], [ %21, %34 ]
%46 = add nuw nsw i32 %20, 1
%47 = load i32, i32* %5
%48 = icmp slt i32 %20, %47
br i1 %48, label %19, label %49
49: ; preds = %44
%50 = icmp eq i32 %45, 0
br i1 %50, label %51, label %53
51: ; preds = %16, %49
%52 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %53
53: ; preds = %51, %49
%54 = call i64 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %4, i32* %5)
%55 = load i64, i64* @EOF
%56 = icmp eq i64 %54, %55
br i1 %56, label %57, label %16
57: ; preds = %53, %0
ret i32 0
}