ZhenlongDai/ACPR huggingface dataset:
Problem: p03197
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
input = sys.stdin.readline


def read():
    N = int(input().strip())
    A = []
    for i in range(N):
        a = int(input().strip())
        A.append(a)
    return N, A


def solve(N, A):
    A.sort()
    if N == 1:
        grundy = A[0] % 2
    else:
        grundy = (A[1] - A[0]) % 2
    if grundy:
        return "first"
    else:
        return "second"


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))


Failing test case input:
3
100110
625
30619

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline


def read():
    N = int(input().strip())
    A = []
    for i in range(N):
        a = int(input().strip())
        A.append(a)
    return N, A


def solve(N, A):
    grundy = any([a % 2 != 0 for a in A])
    if grundy:
        return "first"
    else:
        return "second"


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

Problem: p03197
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")



n = int(input())
a = list(map(int, input().split()))
if any(item%2==1 for item in a):
    ans = "first"
else:
    ans = "second"
print(ans)

Failing test case input:
3
100110
625
30619

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
a = []
for i in range(n):
    a.append(int(input()))

if not all(item%2==0 for item in a):
    ans = "first"
else:
    ans = "second"
print(ans)

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
l = [int(input()) for _ in range(N)]
print("Second" if (N-2)%2 else "First")

Failing test case input:
3
000000
24912
40529

Expected output:
first


Actual output:
Second


Fixed submission (verdict: Accepted):
N = int(input())
l = [int(input()) for _ in range(N)]
print("second" if all(map(lambda x:x%2==0, l)) else "first")

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = []
for i in range(N):
    a = int(input())
    A.append(a)

num = 1
for i in range(N):
    num ^= A[i] % 2

if num:
    print("second")
else:
    print("first")

Failing test case input:
3
100011
24068
29639

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
n = int(input())
flag = False
for i in range(n):
    a = int(input())
    if a % 2 != 0:
        flag = True

if flag:
    print("first")
else:
    print("second")
Problem: p03197
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = [0]*n
for i in range(n):
    a[i] = int(input())
s = 1
for i in range(n):
    if a[i]%2 == 1:
        s = 0
        break
print(["first","secound"][s])

Failing test case input:
3
100110
2
34268

Expected output:
second


Actual output:
secound


Fixed submission (verdict: Accepted):
n = int(input())
a = [0]*n
for i in range(n):
    a[i] = int(input())
s = 1
for i in range(n):
    if a[i]%2 == 1:
        s = 0
        break
print(["first","second"][s])

Problem: p03197
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
a = list(map(int, input().split()))

if not all(item%2==0 for item in a):
    ans = "first"
else:
    ans = "second"
print(ans)

Failing test case input:
3
011110
613
15880

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
a = []
for i in range(n):
    a.append(int(input()))

if not all(item%2==0 for item in a):
    ans = "first"
else:
    ans = "second"
print(ans)

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    n = int(input())
    a = [None]*n
    for i in range(n):
        a[i] = int(input())
    a.sort(reverse=True)
    if a[0] % 2 == 1 or sum(a) % 2 == 1 or n > 2:
        print("first")
    else:
        print("second")

if __name__ == "__main__":
    main()


Failing test case input:
3
011010
346
13058

Expected output:
second


Actual output:
first


Fixed submission (verdict: Accepted):
def main():
    n = int(input())
    f = False
    for i in range(n):
        a = int(input())
        if a%2 == 1:
            f = True
    if f:
        print("first")
    else:
        print("second")

if __name__ == "__main__":
    main()

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())
a = [int(readline()) for i in range(n)]
set_a = list(set(a))
if sum(a) % 2 == 1 or (len(set_a) == 1 and set_a[0] == 1):
    print('first')
else:
    print('second')


Failing test case input:
3
100110
625
19247

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())
print('second' if all(int(readline()) % 2 == 0 for i in range(n)) else 'first')
Problem: p03197
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import bisect
import copy
import heapq
import math
import sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
sys.setrecursionlimit(500000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

n=int(input())
a=[int(input()) for i in range(n)]

f="first"
s="second"

if sum(a)==n:
    print(f)
    exit()

if sum(a)%2:
    print(f)
else:
    print(s)

Failing test case input:
2
3
3

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
import bisect
import copy
import heapq
import math
import sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
sys.setrecursionlimit(500000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

n=int(input())
a=[int(input()) for i in range(n)]

f="first"
s="second"
for i in range(n):
    if a[i]%2==1:
        print(f)
        break
else:
    print(s)

Problem: p03197
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
input = sys.stdin.readline


def read():
    N = int(input().strip())
    A = []
    for i in range(N):
        a = int(input().strip())
        A.append(a)
    return N, A


def solve(N, A):
    A.sort()
    grundy = A.count(1) % 2 + sum(A) % 2
    if grundy:
        return "first"
    else:
        return "second"


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))


Failing test case input:
3
001011
2
63165

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline


def read():
    N = int(input().strip())
    A = []
    for i in range(N):
        a = int(input().strip())
        A.append(a)
    return N, A


def solve(N, A):
    grundy = any([a % 2 != 0 for a in A])
    if grundy:
        return "first"
    else:
        return "second"


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
r = 0
for _ in range(N):
    if int(input()) % 2 == 0:
        r += 1
print("first" if r % 2 == 0 else "second")

Failing test case input:
3
001010
491
19247

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
N = int(input())
flag = False
for _ in range(N):
    if int(input()) % 2 != 0:
        flag = True
print("first" if flag else "second")
Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = [int(input()) for i in range(n)]

for i in range(n):
    if i % 2 == 1:
        print("first")
        exit()
print("second")

Failing test case input:
3
011110
244
13058

Expected output:
second


Actual output:
first


Fixed submission (verdict: Accepted):
n = int(input())
a = [int(input()) for i in range(n)]

for i in range(n):
    if a[i] % 2 == 1:
        print("first")
        exit()
print("second")

Problem: p03197
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
    n = int(input())
    a = list([(int(input())) % 2 for i in range(n)])
    su = sum(a)
    xors = 0
    for i in(a):
        xors ^= i
    if(xors != 0 or su <= 2 * n):
        print('first')
    else:
        print('second')

main()

Failing test case input:
3
011110
476
13058

Expected output:
second


Actual output:
first


Fixed submission (verdict: Accepted):
def main():
    n = int(input())
    a = list([(int(input())) % 2 for i in range(n)])
    ans = sum(a)
    if(ans == 0):
        print('second')
    else:
        print('first')

main()

Problem: p03197
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())

p=0
q=0

for _ in range(N):
    a=int(input())
    if a>=p:
        q=p
        p=a

if (p-q)%2==0:
    print('second')
else:
    print('first')



Failing test case input:
3
000110
625
19247

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
N=int(input())

flag=False
for _ in range(N):
    a=int(input())
    if a%2==1:
        flag=True
if flag:
    print('first')
else:
    print('second')

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
A=[]
flag=False
for i in range(N):
    A.append(int(input()))
    if A[i]%2==0:
        flag=True

if flag:
    print("second")
else:
    print("first")

Failing test case input:
3
010000
8221
40529

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
N=int(input())
A=[]
flag=False
for i in range(N):
    A.append(int(input()))
    if A[i]%2==1:
        flag=True

if not flag:
    print("second")
else:
    print("first")

Problem: p03197
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n=int(input())

a=[int(input()) for _ in range(n)]

flag=0
for aa in a:
    if aa%2==1:
        flag=1
if flag=="0":
    print("Second")
else:
    print("First")
















Failing test case input:
3
000000
30000
29639

Expected output:
first


Actual output:
First


Fixed submission (verdict: Accepted):
n=int(input())

a=[int(input()) for _ in range(n)]

flag=0
for aa in a:
    if aa%2==1:
        flag=1

if flag==0:
    print("second")
else:
    print("first")
Problem: p03197
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = int(input())
ans = 0
for i in range(n):
    ans += int(input())
if ans % 2 == 0:
    print("second")
else:
    print("first")

Failing test case input:
3
000011
24068
19141

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
n = int(input())
ans = 0
for i in range(n):
    if int(input()) % 2 != 0:
        print("first")
        exit()
print("second")

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
a = [int(input()) for _ in range(N)]

print("first" if sum(a) % 2 != 0 else "second")

Failing test case input:
3
000001
30000
29639

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
N = int(input())
a = [int(input()) for _ in range(N)]

print("second" if all(a[i] % 2 == 0 for i in range(N)) else "first")

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
stdin = sys.stdin
 
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  

N = ri()
A = [ri() for _ in range(N)]
even_cnt = sum([1 for x in A if x % 2 == 0])
odd_cnt = N - even_cnt
bool = even_cnt % 2 == 0

print('first' if even_cnt * odd_cnt else 'second')

Failing test case input:
2
3
3

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
import sys
stdin = sys.stdin
 
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  

N = ri()
A = [ri() for _ in range(N)]
even_cnt = sum([1 for x in A if x % 2 == 0])
odd_cnt = N - even_cnt
print('first' if odd_cnt else 'second')

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

a = [0] * n
for i in range(n):
    a[i] = int(input())

for i in range(n):
    if a[i] %2 == 0:
        continue
    else:
        print("first")
        exit()

print("secoond")

Failing test case input:
3
101110
2
34268

Expected output:
second


Actual output:
secoond


Fixed submission (verdict: Accepted):
n = int(input())

a = [0] * n
for i in range(n):
    a[i] = int(input())

for i in range(n):
    if a[i] %2 == 0:
        continue
    else:
        print("first")
        exit()

print("second")

Problem: p03197
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
    n = int(input())
    a = list([(int(input())) % 2 for i in range(n)])
    ans = sum(a)
    if(ans * 2 >= n):
        print('first')
    else:
        print('no')

main()

Failing test case input:
3
001010
7813
64578

Expected output:
first


Actual output:
no


Fixed submission (verdict: Accepted):
def main():
    n = int(input())
    a = list([(int(input())) % 2 for i in range(n)])
    ans = sum(a)
    if(ans == 0):
        print('second')
    else:
        print('first')

main()
Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
print("fsiercsotn d"[(sum([int(input())for i in range(int(input()))])-1)%2::2])

Failing test case input:
3
100110
625
30619

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
print("sfeicrosntd"[sum([int(input())%2 for i in range(int(input()))])>0::2])

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

n = int(input())
a = [0] * n
for i in range(n):
    a[i] = int(input())
ans = sum(a)

if ans % 2 == 0:
    print('second')
else:
    print('first')



Failing test case input:
3
100110
625
19035

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):

n = int(input())
a = [0] * n
flag = True
for i in range(n):
    a[i] = int(input())
    if a[i] % 2 == 1:
        flag = False

if not flag:
    print('first')
else:
    print('second')

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
arr = [int(input()) for _ in range(n)]
print("first" if sum(arr) % 2 == 1 else "second")

Failing test case input:
3
011010
7813
5019

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
n = int(input())
arr = [int(input()) for _ in range(n)]
print("second"if all(arr[i] % 2 == 0 for i in range(n)) else "first")

Problem: p03197
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = int(input())
al = [0] * n
for i in range(n):
    a = int(input())
    if a % 2 == 0:
        print('second')
        break
else:
    print('first')


Failing test case input:
3
011110
613
15880

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
n = int(input())
al = [0] * n
for i in range(n):
    a = int(input())
    if a % 2 != 0:
        print('first')
        break
else:
    print('second')

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    apples = int(input())
    apple_num = [int(input()) for _ in range(apples)]
    print("first" if sum(apple_num) % 2 else "second")


if __name__ == '__main__':
    main()



Failing test case input:
3
100110
625
30619

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
def main():
    apples = int(input())
    count = 0
    for _ in range(apples):
        if int(input()) % 2 == 0:
            count += 1
    print("first" if count != apples else "second")


if __name__ == '__main__':
    main()

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
print("sfeicrosntd"[(sum([int(input())for i in range(int(input()))])-2)%2::2])

Failing test case input:
3
010000
8221
40529

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
print("sfeicrosntd"[sum([int(input())%2 for i in range(int(input()))])>0::2])
Problem: p03197
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
    n = int(input())
    a = list([(int(input())) % 2 for i in range(n)])
    ans = sum(a)
    if(ans % 2 == 1):
        print('first')
    else:
        print('second')

main()

Failing test case input:
3
101001
4
46333

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
def main():
    n = int(input())
    a = list([(int(input())) % 2 for i in range(n)])
    ans = sum(a)
    if(ans == 0):
        print('second')
    else:
        print('first')

main()

Problem: p03197
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
input = sys.stdin.readline


def read():
    N = int(input().strip())
    A = []
    for i in range(N):
        a = int(input().strip())
        A.append(a)
    return N, A


def solve(N, A):
    A.sort()
    grundy = A.count(1) % 2
    if grundy:
        return "first"
    else:
        return "second"


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))


Failing test case input:
3
101001
4
46333

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline


def read():
    N = int(input().strip())
    A = []
    for i in range(N):
        a = int(input().strip())
        A.append(a)
    return N, A


def solve(N, A):
    grundy = any([a % 2 != 0 for a in A])
    if grundy:
        return "first"
    else:
        return "second"


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = []
for i in range(N):
    a = int(input())
    A.append(a)

num = 1
for i in range(N):
    num ^= A[i] % 2

if num % 2:
    print("second")
else:
    print("first")

Failing test case input:
3
000110
625
19247

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
n = int(input())
flag = False
for i in range(n):
    a = int(input())
    if a % 2 != 0:
        flag = True

if flag:
    print("first")
else:
    print("second")

Problem: p03197
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
    n = int(input())
    a = list([(int(input())) % 2 for i in range(n)])
    su = sum(a)
    xors = 0
    for i in(a):
        xors ^= i
    if(xors != 0 or sum == n):
        print('first')
    else:
        print('second')

main()

Failing test case input:
3
000010
23529
19141

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
def main():
    n = int(input())
    a = list([(int(input())) % 2 for i in range(n)])
    ans = sum(a)
    if(ans == 0):
        print('second')
    else:
        print('first')

main()
Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())
a = [int(readline()) for i in range(n)]
if sum(a) % 2 == 1 or (len(set(a)) == 1 and a[0] % 2 == 1):
    print('first')
else:
    print('second')


Failing test case input:
3
000011
24068
19141

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())
print('second' if all(int(readline()) % 2 == 0 for i in range(n)) else 'first')

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = sorted([int(input()) for i in range(N)])

if 1 in A or max(A) % 2 == 1:
    print('first')
else:
    print('second')


Failing test case input:
3
001110
613
15880

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
N = int(input())
A = [int(input()) for i in range(N)]

if [a for a in A if a % 2 == 1]:
    print('first')
else:
    print('second')

Problem: p03197
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = int(input())
dat = []
oddcnt = 0
for _ in range(n):
    x = int(input())
    dat.append(x)
    if x % 2 == 1:
        oddcnt += 1
if oddcnt % 2 == 0:
    print("second")
else:
    print("first")

Failing test case input:
3
010000
8221
62387

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
n = int(input())
dat = []
oddcnt = 0
for _ in range(n):
    x = int(input())
    dat.append(x)
    if x % 2 == 1:
        oddcnt += 1
if oddcnt == 0:
    print("second")
else:
    print("first")

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):



def main():
  n = int(input())
  odd_count = sum([int(input()) % 2 for _ in range(n)])
  print('first' if odd_count % 2 == 1 else 'second')

if __name__=='__main__':
  main()



Failing test case input:
3
010000
8221
62387

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):



def main():
  n = int(input())
  odd_count = sum([int(input()) % 2 for _ in range(n)])
  print('first' if odd_count > 0 else 'second')

if __name__=='__main__':
  main()
Problem: p03197
Buggy submission (Python (3.8.2), verdict: Wrong Answer):

from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right

def main():
    N, *a = map(int, open(0))
    if max(a)-min(a) % 2 == 1:
        print('first')
    else:
        print('second')

if __name__ == "__main__":
    main()


Failing test case input:
3
100011
24068
19141

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):

from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right

def main():
    N, *a = map(int, open(0))
    for i in range(N):
        if a[i] % 2 == 1:
            print('first')
            exit()
    print('second')

if __name__ == "__main__":
    main()

Problem: p03197
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
    n = int(input())
    a = list([(int(input())) % 2 for i in range(n)])
    ans = sum(a)
    if(ans * 2 >= n):
        print('first')
    else:
        print('second')

main()

Failing test case input:
3
011010
714
7919

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
def main():
    n = int(input())
    a = list([(int(input())) % 2 for i in range(n)])
    ans = sum(a)
    if(ans == 0):
        print('second')
    else:
        print('first')

main()

Problem: p03197
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
    n = int(input())
    a = list([(int(input())) % 2 for i in range(n)])
    xors = 0
    for i in(a):
        xors ^= i
    if(xors != 0):
        print('first')
    else:
        print('second')

main()

Failing test case input:
3
011010
7813
5019

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
def main():
    n = int(input())
    a = list([(int(input())) % 2 for i in range(n)])
    ans = sum(a)
    if(ans == 0):
        print('second')
    else:
        print('first')

main()

Problem: p03197
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
input = sys.stdin.readline


def read():
    N = int(input().strip())
    A = []
    for i in range(N):
        a = int(input().strip())
        A.append(a)
    return N, A


def solve(N, A):
    A.sort()
    grundy = A.count(1) % 2 + (sum(A) - A.count(1)) % 2
    if grundy:
        return "first"
    else:
        return "second"


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))


Failing test case input:
3
000110
729
19247

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline


def read():
    N = int(input().strip())
    A = []
    for i in range(N):
        a = int(input().strip())
        A.append(a)
    return N, A


def solve(N, A):
    grundy = any([a % 2 != 0 for a in A])
    if grundy:
        return "first"
    else:
        return "second"


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))
Problem: p03197
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = int(input())
dat = []
oddcnt = 0
for _ in range(n):
    x = int(input())
    dat.append(x)
    if x % 2 == 1:
        oddcnt += 1
if oddcnt %2 != 0:
    print("first")
else:
    print("second")

Failing test case input:
3
001010
613
19247

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
n = int(input())
dat = []
oddcnt = 0
for _ in range(n):
    x = int(input())
    dat.append(x)
    if x % 2 == 1:
        oddcnt += 1
if oddcnt == 0:
    print("second")
else:
    print("first")

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
a=[]
m=10**10
for i in range(N):
    a.append(int(input()))
    m=min(m,a[i])

if m>N:
    if N%2==0:
        print("first")
    else:
        print("second")
    exit()
else:
    print("second")

Failing test case input:
3
000000
41819
40529

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
N=int(input())
A=[]
flag=False
for i in range(N):
    A.append(int(input()))
    if A[i]%2==1:
        flag=True

if not flag:
    print("second")
else:
    print("first")

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

n = int(input())
a = [0] * n
flag = True
for i in range(n):
    a[i] = int(input())
    if a[i] % 2 == 1:
        flag = False

if flag:
    print('first')
else:
    print('second')

Failing test case input:
3
100010
24068
29639

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):

n = int(input())
a = [0] * n
flag = True
for i in range(n):
    a[i] = int(input())
    if a[i] % 2 == 1:
        flag = False

if not flag:
    print('first')
else:
    print('second')

Problem: p03197
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split(' ')))

for a in A:
  if a % 2:
    print('first')
    exit()
    
print('second')


Failing test case input:
3
011010
223
13058

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):

N = int(input())
A = [int(input()) for _ in range(N)]

for a in A:
    if a % 2:
        print('first')
        exit()

print('second')

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
for i in range(n):
    p = int(input())
    if p % 2 == 0:
        continue
    else:
        print("first")

print("second")

Failing test case input:
3
011110
626
7919

Expected output:
first


Actual output:
first
second


Fixed submission (verdict: Accepted):
n = int(input())
for i in range(n):
    p = int(input())
    if p % 2 == 0:
        continue
    else:
        print("first")
        exit()

print("second")
Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
stdin = sys.stdin
 
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  

N = ri()
A = [ri() for _ in range(N)]
cnt = [1 for x in A if x % 2 == 0]
bool = sum(cnt) % 2 == 0
print('first' if bool else 'second')

Failing test case input:
2
1
6

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
import sys
stdin = sys.stdin
 
ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split()))
rs = lambda: stdin.readline().rstrip()  

N = ri()
A = [ri() for _ in range(N)]
even_cnt = sum([1 for x in A if x % 2 == 0])
odd_cnt = N - even_cnt
print('first' if odd_cnt else 'second')

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
from collections import Counter

n = int(input())
aaa = [int(line) for line in sys.stdin.readlines()]
cnt = Counter(aaa)
nim = 0
mnt = 0
for i, c in sorted(cnt.items()):
    mnt += c
    nim ^= mnt
print('first' if nim > 0 else 'second')


Failing test case input:
3
100110
246
19035

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
import sys
from collections import Counter

n = int(input())
aaa = [int(line) for line in sys.stdin.readlines()]
cnt = Counter(aaa)
nim = 0
mnt = 0
prev_i = 0
for i, c in sorted(cnt.items()):
    di = i - prev_i
    mnt += c
    if di % 2 == 1:
        nim ^= mnt
print('first' if nim > 0 else 'second')

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = [int(input()) for _ in range(N)]

if sum(A) % 2 == 1:
    print("first")
else:
    print("second")


Failing test case input:
3
101001
4
46333

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
N = int(input())
A = [int(input()) for _ in range(N)]

print("second" if all(A[i] % 2 == 0 for i in range(N)) else "first")

Problem: p03197
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
a = list(map(int, input().split()))
val = sum(item%2==1 for item in a)
if val%2==1:
    ans = "first"
else:
    ans = "second"
print(ans)

Failing test case input:
3
111110
727
13058

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
a = []
for i in range(n):
    a.append(int(input()))

if not all(item%2==0 for item in a):
    ans = "first"
else:
    ans = "second"
print(ans)
Problem: p03197
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = []
for i in range(n):
  s = int(input())
  a.append(s%2)
k = sum(a)
if(k%2):
  print("first")
else:
  print("second")


Failing test case input:
3
000010
491
19247

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
n = int(input())
f=True
for i in range(n):
  s = int(input())
  if s%2==1:
    f = False 
if not f:
  print("first")
else:
  print("second")

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int( input())
A = [ int( input()) for _ in range(N)]
A.sort()
if A[0]%2 == 0:
    ans = "second"
else:
    ans = "first"
print(ans)
    

Failing test case input:
3
011110
714
7919

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
N = int( input())
A = [ int( input()) for _ in range(N)]
for a in A:
    if a%2 == 1:
        print("first")
        break
else:
    print("second")

Problem: p03197
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
a = list(map(int, input().split()))
val = sum(item%2==1 for item in a)
if val!=0:
    ans = "first"
else:
    ans = "second"
print(ans)

Failing test case input:
3
000110
625
19247

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
a = []
for i in range(n):
    a.append(int(input()))

if not all(item%2==0 for item in a):
    ans = "first"
else:
    ans = "second"
print(ans)

Problem: p03197
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = []
for i in range(n):
  s = int(input())
  a.append(s%2)
k = sum(a)

if(k%2)or (n==2 and k==1):
  print("first")
else:
  print("second")



Failing test case input:
3
000110
625
19247

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
n = int(input())
f=True
for i in range(n):
  s = int(input())
  if s%2==1:
    f = False 
if not f:
  print("first")
else:
  print("second")

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
x=0
for i in range(n):
    if input()=="1":
        x+=1
if x%2==0:
    print("second")
else:
    print("first")

Failing test case input:
3
000010
24912
19141

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
n=int(input())
for i in range(n):
    if int(input())%2==1:
        print("first")
        exit()
print("second")
Problem: p03197
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())
odd = 0
for i in range(N):
    a = int(input())
    if a % 2 == 1:
        odd += 1
if odd % 2 == 1:
    print('first')
else:
    print('second')


Failing test case input:
3
100110
625
30619

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
N = int(input())
odd = 0
for i in range(N):
    a = int(input())
    if a % 2 == 1:
        odd += 1
if odd:
    print('first')
else:
    print('second')

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = [0] * n
for i in range(n):
    a[i] = int(input())
x = max(a)
total = sum(a) - x
print("first" if x % 2 != total % 2 else "second")

Failing test case input:
3
100011
24068
29639

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
n = int(input())
a = [0] * n
flag = True
for i in range(n):
    a[i] = int(input())
    if a[i] % 2 == 1:
        flag = False
print("second" if flag else "first")

Problem: p03197
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n=int(input())
a=[]
for i in range(n):
    a.append(int(input()))

if sum(a)%2==1:
    print('first')
else:
    print('second')

Failing test case input:
3
001001
4
63165

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
n=int(input())
a=[]
x=0
for i in range(n):
    x|=int(input())%2

if x==1:
    print('first')
else:
    print('second')

Problem: p03197
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())
a = list(map(int, input().split()))
print('second' if all(i%2==0 for i in a) else 'first')

Failing test case input:
3
111110
626
7919

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
N = int(input())
a = list(range(N))
for i in range(N):
	a[i] = int(input())
print('first' if any(x%2 for x in a) else 'second')

Problem: p03197
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = int(input())
dat = []
oddcnt = 0
for _ in range(n):
    x = int(input())
    dat.append(x)
    if x % 2 == 1:
        oddcnt += 1
if oddcnt %2 == 1:
    print("first")
else:
    print("second")

Failing test case input:
3
100110
883
19035

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
n = int(input())
dat = []
oddcnt = 0
for _ in range(n):
    x = int(input())
    dat.append(x)
    if x % 2 == 1:
        oddcnt += 1
if oddcnt == 0:
    print("second")
else:
    print("first")

Problem: p03197
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = [int(input()) for i in range(n)]
if sum(a)%2==0:
    print('second')
else:
    print('first')

Failing test case input:
3
001010
491
19247

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
n = int(input())
a = [int(input()) for i in range(n)]
f = True
for i in a:
    if i%2==1:
        f = False
if f:
    print('second')
else:
    print('first')
Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys


import math
import collections

import bisect
import itertools
import fractions

import copy
import heapq
import decimal

import queue

sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))





def main():
    n = ni()

    ans = 0
    for _ in range(n):
        ans += ni() % 2

    ans %= 2
    print("first" if ans else "second")


if __name__ == '__main__':
    main()


Failing test case input:
3
000000
41819
40529

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
import sys


import math
import collections

import bisect
import itertools
import fractions

import copy
import heapq
import decimal

import queue

sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))





def main():
    n = ni()

    a = []

    ans = 0
    flg = True
    for _ in range(n):
        tmp = ni()
        if tmp % 2:
            flg = False
    
    print("second" if flg else "first")


if __name__ == '__main__':
    main()

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
As = list(map(int, input().split()))

if all([a%2==0 for a in As]):
    print('second')
else:
    print('first')

Failing test case input:
2
6
3

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
N = int(input())
As = [int(input()) for _ in range(N)]

if all([a%2==0 for a in As]):
    print('second')
else:
    print('first')

Problem: p03197
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
    n = int(input())
    a = list([(int(input())) % 2 for i in range(n)])
    su = sum(a)
    xors = 0
    for i in(a):
        xors ^= i
    if(xors != 0 or su <= n + 1):
        print('first')
    else:
        print('second')

main()

Failing test case input:
3
100110
2
34268

Expected output:
second


Actual output:
first


Fixed submission (verdict: Accepted):
def main():
    n = int(input())
    a = list([(int(input())) % 2 for i in range(n)])
    ans = sum(a)
    if(ans == 0):
        print('second')
    else:
        print('first')

main()

Problem: p03197
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())
a = []
ans = 0
for i in range(N):
    a.append(int(input()))
    ans += a[i]
if ans % 2 == 0:
    print('second')
else:
    print('first')


Failing test case input:
3
010000
8221
62387

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
N = int(input())
odd = 0
for i in range(N):
    a = int(input())
    if a % 2 == 1:
        odd += 1
if odd:
    print('first')
else:
    print('second')
Problem: p03197
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n=int(input())

a=[int(input()) for _ in range(n)]

flag=0
for aa in a:
    if aa%2==1:
        flag=1
if flag=="1":
    print("Second")
else:
    print("First")
















Failing test case input:
3
111110
727
13058

Expected output:
first


Actual output:
First


Fixed submission (verdict: Accepted):
n=int(input())

a=[int(input()) for _ in range(n)]

flag=0
for aa in a:
    if aa%2==1:
        flag=1

if flag==0:
    print("second")
else:
    print("first")

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = [int(input()) for _ in range(n)]

if max(a)%2 == 0:
    print("second")
else:
    print("first")


Failing test case input:
3
001010
7813
42166

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
n = int(input())

for _ in range(n):
    if int(input())%2 == 1:
        print("first")
        exit()
else:
    print("second")

Problem: p03197
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
A = [int(input()) for _ in range(N)]

cnt = 0
for a in A:
    if a % 2 == 1:
        cnt += 1
        cnt %= 2
if cnt:
    print('first')
else:
    print('second')

Failing test case input:
3
010000
8221
40529

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
N = int(input())
A = [int(input()) for _ in range(N)]

cnt = 0
for a in A:
    if a % 2 == 1:
        print('first')
        exit()
        
print('second')

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin
n = int(stdin.readline().rstrip())
li = [int(stdin.readline().rstrip()) for _ in range(n)]
kisuu = 0
for i in li:
    if i%2 == 1:
        kisuu += 1
gusuu = n-kisuu
if gusuu%2 == 1:
    print("first")
else:
    print("second")

Failing test case input:
3
001010
7813
64578

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
from sys import stdin
n = int(stdin.readline().rstrip())
li = [int(stdin.readline().rstrip()) for _ in range(n)]
if all(i%2 == 0 for i in li):
    print("second")
else:
    print("first")

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = sum([int(input()) for i in range(N)])
if A%2 == 0:
    print("second")
else:
    print("first")

Failing test case input:
3
001010
613
19247

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
N = int(input())
for i in range(N):
    if int(input())%2 != 0:
        print("first")
        exit()
print('second')

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = sum([int(input()) for i in range(N)])
if A%2 != N%2:
    print("second")
else:
    print("first")

Failing test case input:
3
101001
4
46333

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
N = int(input())
for i in range(N):
    if int(input())%2 != 0:
        print("first")
        exit()
print('second')
Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = [int(input()) for _ in range(N)]

if max(A) % 2 == 0:
  print('first')
else:
  print('second')

Failing test case input:
3
000110
729
19247

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
N = int(input())
A = [int(input()) for _ in range(N)]

if not all(a % 2 == 0 for a in A):
  print('first')
else:
  print('second')

Problem: p03197
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = [int(input()) for _ in range(n)]
ans = 'second' if any(a[i] % 2 == 0 for i in range(n)) else 'first'
print(ans)


Failing test case input:
3
011010
223
13058

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
n = int(input())
a = [int(input()) for _ in range(n)]
ans = 'second' if all(a[i] % 2 == 0 for i in range(n)) else 'first'
print(ans)

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a_list = [int(input()) for _ in range(n)]

a_list.sort()
d = ["second", "first"]

print(d[a_list[0] %2])

Failing test case input:
3
100011
24068
29639

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
n = int(input())
a_list = [int(input()) for _ in range(n)]

d = ["second", "first"]

for a in a_list:
  if a % 2 != 0:
    print(d[1])
    break
else:
  print(d[0])

Problem: p03197
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):


n = int(input())
odd = even = 0
for _ in range(n):
    apple = int(input())
    if apple % 2 == 0:
        even += 1
    else:
        odd += 1

if odd % 2 == 1:
    print('first')
else:
    print('second')

Failing test case input:
3
000000
41819
40529

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):


n = int(input())
odd = even = 0
for _ in range(n):
    apple = int(input())
    if apple % 2 == 0:
        even += 1
    else:
        odd += 1

if odd:
    print('first')
else:
    print('second')

Problem: p03197
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = sorted([int(input()) for i in range(N)])

if 1 in A or (N == 1 and sum(A) % 2 == 1):
    print('first')
else:
    print('second')


Failing test case input:
3
011010
714
7919

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
N = int(input())
A = [int(input()) for i in range(N)]

if [a for a in A if a % 2 == 1]:
    print('first')
else:
    print('second')

Problem: p03197
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = int(input())
a = []
for _ in range(n):
    a.append(int(input()))
    
b = sum(a)
if b % 2 == 0 and n % 2 == 1:
    print("second")
else:
    print("first")

Failing test case input:
3
000110
729
19247

Expected output:
first


Actual output:
second


Fixed submission (verdict: Accepted):
import sys

n = int(input())
a = []
for _ in range(n):
    a.append(int(input()))
    
for i in a:
    if i % 2 == 0:
        continue
    else:
        print("first")
        sys.exit()
        
print("second")