ZhenlongDai/ACPR huggingface dataset:
Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
nyuryoku = input()
print(nyuryoku[4:5],nyuryoku[5:6])

result = "No"
if nyuryoku[4:5] == nyuryoku[5:6]:
  if nyuryoku[2:3] == nyuryoku[3:4]:
    result = "Yes"
    
print(result)

Failing test case input:
uvppjs

Expected output:
No


Actual output:
j s
No


Fixed submission (verdict: Accepted):
nyuryoku = input()

result = "No"
if nyuryoku[4:5] == nyuryoku[5:6]:
  if nyuryoku[2:3] == nyuryoku[3:4]:
    result = "Yes"
    
print(result)

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
flag = True
if len(s) != 6:
    flag = False

for i in s:
    if ord(i) < 97 or ord(i) > 122:
        flag = False
if len(s) == 6:
    if s[2] != s[3]:
        flag = False
    if s[4] != s[5]:
        flag = False
if flag:
    print("YES")
else:
    print("NO")

Failing test case input:
oeeebh

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
s = input()
flag = True
if len(s) != 6:
    flag = False

for i in s:
    if ord(i) < 97 or ord(i) > 122:
        flag = False
if len(s) == 6:
    if s[2] != s[3]:
        flag = False
    if s[4] != s[5]:
        flag = False
if flag:
    print("Yes")
else:
    print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()

if S[2] == S[3] or S[4] == S[5]:
  print('Yes')
else:
  print('No')

Failing test case input:
nmhheo

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = input()

if S[2] == S[3] and S[4] == S[5]:
  print('Yes')
else:
  print('No')

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

if s[2] == s[3]:
  if s[4] == s[5]:
    print("Yes")
else:
  print("No")

Failing test case input:
sippvu

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
s = input()
 
if s[2] == s[3]:
  if s[4] == s[5]:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
if s[3]==s[2] and s[5]==s[4]:
    print("Yes")

Failing test case input:
gfogdc

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
s=input()
if s[3]==s[2] and s[5]==s[4]:
  print("Yes")
else:
  print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = input()

if(len(a)==6):
  if(a[2]==a[3]):
    if(a[4]==a[5]):
      print('Yes')
  else:
    print('No')
else:
  print('No')

Failing test case input:
nohhne

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
a = input()

if(len(a)==6):
  if(a[2]==a[3]):
    if(a[4]==a[5]):
      print('Yes')
    else:
      print('No')
  else:
    print('No')
else:
  print('No')

Problem: p02723
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s = str(input())
if s[2] == s[3]:
    if s[4] == s[5]:
        print("Yes")
else:
    print("No")

Failing test case input:
nohhne

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
s = list(input())
if s[2] == s[3]:
    if s[4] == s[5]:
        print('Yes')
    else:
        print('No')
else:
    print('No')
Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def nearcoffee(str):
    return("Yes" if str[2] == str[3] and str[4] == str[5] else "No")
nearcoffee(input())

Failing test case input:
feoegc

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
str = input().lower()
print("Yes" if len(str) == 6 and str[2] == str[3] and str[4] == str[5] else "No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
print("YES" if s[2]==s[3] and s[4]==s[5] else "NO")

Failing test case input:
nmhheo

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
s=input()

if s[2]==s[3]  and s[4]==s[5]:
    print("Yes")

else:print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=input()

if a[2]==a[3]:
    if a[4]==[5]:
        print("Yes")
    else:
        print("No")

Failing test case input:
jvprvs

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
a=input()


b=False
if a[2]==a[3]:
    if a[4]==a[5]:
        b=True


if b==True:
    print("Yes")
else:
    print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = str(input())

if s[2] == s[3]:
    if s[4] == s[5]:
        print("Yes")

else:
    print("No")

Failing test case input:
swqqvj

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
s = str(input())

if s[2] == s[3]:
    if s[4] == s[5]:
        print("Yes")
        quit()

print("No")

Problem: p02723
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s=input();print('NYOE S'[s[2]==s[3]and s[4]==s[5]::2])

Failing test case input:
fohnnh

Expected output:
No


Actual output:
NO 


Fixed submission (verdict: Accepted):
s=input();print('NYoe s'[s[2]==s[3]and s[4]==s[5]::2])

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
word = list(input())

if word[2]==word[3] and word[4]==word[5]:
    print("Yes")


Failing test case input:
geeebo

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
word = list(input())

if word[2]==word[3] and word[4]==word[5]:
    print("Yes")
    
else:
    print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
for i in range(0, len(S)):
    if ((S[2]==S[3])&(S[4]==S[5])):
        print("yes")
        break
    else:
        print("No")
        break

Failing test case input:
sjppvv

Expected output:
Yes


Actual output:
yes


Fixed submission (verdict: Accepted):
S = input()
for i in range(0, len(S)):
    if ((S[2]==S[3])&(S[4]==S[5])):
        print("Yes")
        break
    else:
        print("No")
        break

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
if(S[2] == S[3]):
    if(S[4]==S[5]):
        print("Yes")
else:
    print("No")


Failing test case input:
vvppjs

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
S = input()
if(S[2] == S[3]):
    if(S[4]==S[5]):
        print("Yes")
    else:
        print("No")
else:
    print("No")
Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

if((s[2]==s[3]) and (s[4]==s[5])):
  	print("yes")
else:
	print("no")


Failing test case input:
heeeen

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
s = input()

if((s[2]==s[3]) and (s[4]==s[5])):
  	print("Yes")
else:
	print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
if s[2] == s[3] and s[4] == s[5]:
	print('YES')
else:
	print('NO')

Failing test case input:
vprvqh

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
s = list(input())
if s[2] == s[3] and s[4] == s[5]:
	print('Yes')
else:
	print('No')

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


iim = lambda: map(int, input().rstrip().split())

def resolve():
    s = input()

    print("Yes" if s[2] == s[3] and s[4] and s[5] else "No")

if __name__ == "__main__":
    resolve()


Failing test case input:
swqqvj

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):


iim = lambda: map(int, input().rstrip().split())

def resolve():
    s = input()

    print("Yes" if s[2] == s[3] and s[4] == s[5] else "No")

if __name__ == "__main__":
    resolve()

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = str(input())
if a[2] == a[3]:
    if a[4] == a[5]:
        print("Yes")
else:
    print("No")

Failing test case input:
oeeebg

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
a = str(input())
if a[2] == a[3]:
    if a[4] == a[5]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
flag=0
if s[2]!=s[3]:
	flag=1
if s[4]!=s[5]:
	flag==1
if flag==0:
	print("Yes")
else:
	print("No")


Failing test case input:
nohhne

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s=input()
flag=0
if s[2]!=s[3]:
	flag=1
if s[4]!=s[5]:
	flag=1
if flag==0:
	print("Yes")
else:
	print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()

print('Yes' if S[2] == S[3] or S[4] == S[5] else 'No')

Failing test case input:
sjqpvv

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = input()

print('Yes' if S[2] == S[3] and S[4] == S[5] else 'No')

Problem: p02723
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
from sys import stdin


inp = stdin.readline

t = inp().strip()

if t[2] == t[3] and t[4] == t[5]:
    print("YES")
else:
    print("NO")



Failing test case input:
svqrjv

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
from sys import stdin


inp = stdin.readline

t = inp().strip()

if t[2] == t[3] and t[4] == t[5]:
    print("Yes")
else:
    print("No")
Problem: p02723
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S = list(input())

print(S)

if (S[2] == S[3]) & (S[4] == S[5]):
    print("Yes")
else:
    print("No")


Failing test case input:
swqrjv

Expected output:
No


Actual output:
['s', 'w', 'q', 'r', 'j', 'v']
No


Fixed submission (verdict: Accepted):
S = list(input())

if (S[2] == S[3]) & (S[4] == S[5]):
    print("Yes")
else:
    print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()

if(S[2]==S[3] and S[4]==S[5]):
    print("yes")
    exit()

print("No")

Failing test case input:
coffee

Expected output:
Yes

Actual output:
yes


Fixed submission (verdict: Accepted):
S = input()

if(S[2]==S[3] and S[4]==S[5]):
    print("Yes")
    exit()

print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    arg = getInput(input())
    ans = process(arg)
    print(ans)
    
def process(arg):
    cof = list('coffee')
    print(cof)
    print(arg)
    if arg[2] == arg[3] and arg[4] == arg[5]:
        ans = "Yes"
    else:
        ans = "No"

    return ans

def getInput(input):
    
    n = 1
    
    ret = None

    if n == 1:
        pass
        
        ret = list(input)
        
        
        
        
    else:
        for x in range(n):
            
            ret = input[x]

    return ret

if __name__ == '__main__':
    main()

def getInput2(input):
    
    n = 2
    
    res = None
    for x in range(n):
        
        res = input[x]
    return res

Failing test case input:
dniohn

Expected output:
No


Actual output:
['c', 'o', 'f', 'f', 'e', 'e']
['d', 'n', 'i', 'o', 'h', 'n']
No


Fixed submission (verdict: Accepted):
def main():
    arg = getInput(input())
    
    ans = process(arg)
    print(ans)
    
def process(arg):
    cof = list('coffee')
    if arg[2] == arg[3] and arg[4] == arg[5]:
        ans = "Yes"
    else:
        ans = "No"

    return ans

def getInput(input):
    
    n = 1
    
    ret = None

    if n == 1:
        pass
        
        ret = list(input)
        
        
        
        
    else:
        for x in range(n):
            
            ret = input[x]

    return ret

if __name__ == '__main__':
    main()

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
if s[2]==s[3] and s[4]==s[5]:
    print('YES')
else:
    print('NO')

Failing test case input:
gfogec

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
s=input()
if s[2]==s[3] and s[4]==s[5]:
    print('Yes')
else:
    print('No')

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = str(input())
if x[2]==x[3] or x[4]==x[5]:
    print('Yes')
else:
    print('No')

Failing test case input:
nmhheo

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
x = str(input())
if x[2]==x[3] and x[4]==x[5]:
    print('Yes')
else:
    print('No')
Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


S = input()

if S[2] == S[3]  and  S[4] and S[5]:
    print("Yes")
else:
    print("No")


Failing test case input:
jvqqws

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):


S = input()

if S[2] == S[3]  and  S[4] == S[5]:
    print("Yes")
else:
    print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    s = input().strip()
    if s[2] == s[3] and s[4] == s[5]:
        print('True')
    else:
        print('False')


if __name__ == '__main__':
    main()


Failing test case input:
nohnfh

Expected output:
No


Actual output:
False


Fixed submission (verdict: Accepted):
def main():
    s = input().strip()
    if s[2] == s[3] and s[4] == s[5]:
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()

if(S[2] == S[3] and S[4] == S[5]):
  print('YES')
else:
  print('No')

Failing test case input:
sippuu

Expected output:
Yes

Actual output:
YES


Fixed submission (verdict: Accepted):
S = input()

if(S[2] == S[3] and S[4] == S[5]):
  print('Yes')
else:
  print('No')

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = str(input())
if a[2:3] == a[3:4]:
    if a[4:5] == a[5:6]:
        print("Yes")
else:
    print("No")

Failing test case input:
heeeen

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
a = str(input())
if a[2] == a[3]:
    if a[4] == a[5]:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
if s[2] == s[3] and s[4] == s[5]:
    print("Yes")
else:
    print("NO")

Failing test case input:
gfoegc

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
s = input()
if s[2] == s[3] and s[4] == s[5]:
    print("Yes")
else:
    print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
for i in range(0,6):
  if(s[3]==s[4] and s[4]==s[5]):
    print("Yes")
    break
  else:
    print ("No")
    break


Failing test case input:
coffee

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
s=input()
for i in range(0,6):
  if(s[2]==s[3] and s[4]==s[5]):
    print("Yes")
    break
  else:
    print ("No")
    break

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
input = input()
if input[2] == input[3] and input[4] == input[5]:
    print('Yes')
else:
    print('NO')

Failing test case input:
hcdeeo

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
input = input()
if input[2] == input[3] and input[4] == input[5]:
    print('Yes')
else:
    print('No')
Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()
N = str(N)
if (N[2] == N[3]) and (N[4] == N[5]):
    print(True)
else:
    print(False)

Failing test case input:
nmgheo

Expected output:
No


Actual output:
False


Fixed submission (verdict: Accepted):
N = input()
N = str(N)
if (N[2] == N[3]) and (N[4] == N[5]):
    print('Yes')
else:
    print('No')

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = list(input())
if s[4] == s[5]:
	if s[2]==s[3]:
		print("Yes")
	else:
		print("No")
else:
	print("NO")


Failing test case input:
ivpsvr

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
s = list(input())
if s[4] == s[5]:
	if s[2]==s[3]:
		print("Yes")
	else:
		print("No")
else:
	print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()

if S[2] == S[3]:
  if S[4]== S[5]:
    print('Yes')
else:
  print('No')

Failing test case input:
geeebo

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
S = input()

flag = False

if S[2] == S[3]:
  if S[4]== S[5]:
    flag = True

if flag == True:
  print('Yes')
else:
  print('No')

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

if s[2] == 'f' and s[3] == 'f' and s[4] == 'e' and s[5] == 'e':
    print('Yes')
else:
    print('No')

Failing test case input:
sippuu

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
s = input()

if s[2] == s[3] and s[4] == s[5]:
    print('Yes')
else:
    print('No')

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
if s[3]==s[2]:
  if s[5]==s[4]:
    print("Yes")

Failing test case input:
dnhohn

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
s=input()
if s[3]==s[2] and s[5]==s[4]:
  print("Yes")
else:
  print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
string = []

string = input('')

if string[2] == string[3] and string[4] == string[5]:
    print('YES')
else:
    print('NO')

Failing test case input:
inohoe

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
string = []

string = input('')

if string[2] == string[3] and string[4] == string[5]:
    print('Yes')
else:
    print('No')

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = list(input())
if S[2] == S[3]:
  if S[4] == S[5]:
    print("Yse")
  else:
    print("No")
else:
  print("No")

Failing test case input:
sjppvv

Expected output:
Yes


Actual output:
Yse


Fixed submission (verdict: Accepted):
S = list(input())
if S[2] == S[3] and S[4] == S[5]:
    print("Yes")
else:
    print("No")

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


s = list(input())

if s[2] == s[3] and s[4] == s[5]:
    print("Yes")
else:
    print("no")


Failing test case input:
uvppis

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):


s = list(input())

if s[2] == s[3] and s[4] == s[5]:
    print("Yes")
else:
    print("No")
Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
string = str(input())

def test(string):
    string.split()
    if string[2] == string[3] and string[4] == string[5]:
        print("Yes")
    else:
        print("No")

Failing test case input:
gfoegc

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
string = input()
string.split()
if string[2] == string[3] and string[4] == string[5]:
	print("Yes")
else:
    print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = str(input("Enter Input: "))
if S[2] == S[3] and S[4] == S[5]:
    print('Yes')
else:
    print('No')

Failing test case input:
cofgef

Expected output:
No


Actual output:
Enter Input: No


Fixed submission (verdict: Accepted):
S =input()
if S[2] == S[3] and S[4] == S[5]:
    print('Yes')
else:
    print('No')

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n =input()
if (n[2] == n[3] and n[4] == n[5]):
    print("YES")
else:
    print("NO")

Failing test case input:
innhoe

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
n = input()
if (n[2] == n[3] and n[4] == n[5]):
    print("Yes")
else:
    print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=str(input())
if s[2]==s[3] and s[4]==s[5]:
    print("YES")
else:
    print("NO")

Failing test case input:
enhohn

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
s=str(input())
if s[2]==s[3] and s[4]==s[5]:
    print("Yes")
else:
    print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = input()
a = str(a)

if a[2] == a[3] or a[4] == a[5]:
  print('Yes')
else:
  print('No')

Failing test case input:
swqqvj

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
a = input()
a = str(a)

if a[2] == a[3] and a[4] == a[5]:
  print('Yes')
else:
  print('No')

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=input()
if a[0]==a[1] and a[2]==a[3] and a[4]==a[5]:
  print("Yes")
else:
  print("No")

Failing test case input:
sjppvv

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
a=input()
if a[2]==a[3] and a[4]==a[5]:
  print("Yes")
else:
  print("No")

Problem: p02723
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
S=input()
if S[2]==S[3] or S[4]==S[5]:
  print("Yes")
else:
  print("No")

Failing test case input:
swqqjv

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S=input()
if S[2]==S[3] and S[4]==S[5]:
  print("Yes")
else:
  print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()
if(N[2] == N[3]):
    if(N[4] == N[5]):
        print("Yes")
else:
    print("No")


Failing test case input:
gdeebo

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
N = input()
if(N[2] == N[3] and N[4] == N[5]):
    print("Yes")
else:
    print("No")
Problem: p02723
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s = input()
if s[2] == s[3] and s[4] == s[5]:
	print("YES")
else:
	print("NO")


Failing test case input:
swqqjv

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
s = input()
if s[2] == s[3] and s[4] == s[5]:
	print("Yes")
else:
	print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
ans='no'

if S[2]==S[3] or S[4]==S[5]:
    ans='yes'
    
print(ans)

Failing test case input:
hfnhon

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
S=input()
ans='No'

if S[2]==S[3] and S[4]==S[5]:
    ans='Yes'
    
print(ans)

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
Sbara=list(S)
if Sbara[2]==Sbara[3] and Sbara[4]==Sbara[5]:
  print("yes")
else:
  print("no")

Failing test case input:
ndgeeh

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
S=input()
Sbara=list(S)
if Sbara[2]==Sbara[3] and Sbara[4]==Sbara[5]:
  print("Yes")
else:
  print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
if (S[2] == S[3])and(S[2] == S[3]) :
    print('Yes')
else:
    print('No')


Failing test case input:
gdeebo

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S=input()
if (S[2] == S[3])and(S[4] == S[5]) :
    print('Yes')
else:
    print('No')

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
l = input("Enter: ")
print("Yes" if (l[2]==l[3] and l[4]==l[5]) else "No")

Failing test case input:
fhnhon

Expected output:
No


Actual output:
Enter: No


Fixed submission (verdict: Accepted):
l = input()
print("Yes" if (l[2]==l[3] and l[4]==l[5]) else "No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A = input()
ans = 1

for i,j in enumerate(A):
    if i == 2:
        second = j
    if i == 3:
        if j != second:
            ans *= 0
    if i == 4:
        forth = j
    if j == 5:
        if j != forth:
            ans *= 0

if ans == 1:
    print('Yes')
else:
    print('No')

Failing test case input:
uuppis

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
A = input()
ans = 1

for i,j in enumerate(A):
    if i == 2:
        second = j
    if i == 3:
        if j != second:
            ans *= 0
    if i == 4:
        forth = j
    if i == 5:
        if j != forth:
            ans *= 0

if ans == 1:
    print('Yes')
else:
    print('No')

Problem: p02723
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
string=input()
ans= "No"
if len(string) != 6:
	print(ans)
else:
  if string[2] == string[3] and string[4] == string[5]:
    ans="Yes"
    print(ans)


Failing test case input:
jvprvs

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
string=input()
ans= "No"
if len(string) != 6:
	print(ans)
else:
  if string[2] == string[3] and string[4] == string[5]:
    ans="Yes"
    print(ans)
  else:
    print("No")
Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()
if S[2]==S[3] and S[4]==S[5]:
  print('yes')
else:
  print('no')

Failing test case input:
hcdeeo

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
S=input()
if S[2]==S[3] and S[4]==S[5]:
  print('Yes')
else:
  print('No')

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


st = input()

if ( (st[2] == st[3]) and (st[4] == st[5]) ) :
    print ('YES')
else:
    print ('NO')

Failing test case input:
omghdo

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):


st = input()

if ( (st[2] == st[3]) and (st[4] == st[5]) ) :
    print ('Yes')
else:
    print ('No')

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
coffee = input()
print("Yes") if coffee[2] == coffee[3] else print("No")

Failing test case input:
nmhheo

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
coffee = input()
print("Yes") if coffee[2] == coffee[3] and coffee[4] == coffee[5] else print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = list(input())
if (n[5]):
    if (n[2]==n[3])and(n[4]==n[5]):
        print("YES")
    else:
        print("NO")
       
    

Failing test case input:
ivprvs

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
n = list(input())
if (n[5]):
    if (n[2]==n[3])and(n[4]==n[5]):
        print("Yes")
    else:
        print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def JudgeCoffee(string):
    if(string[2] == string[3] and string[4] == string[5]):
        return True
    else:
        return False


def Main():
    
    S = "sippuu"
    judge = JudgeCoffee(S)
    if(judge):
        print("Yes")
    else:
        print("No")
    

Main()

Failing test case input:
noehnh

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
def JudgeCoffee(string):
    if(string[2] == string[3] and string[4] == string[5]):
        return True
    else:
        return False


def Main():
    S = input()
    
    judge = JudgeCoffee(S)
    if(judge):
        print("Yes")
    else:
        print("No")
    

Main()

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = str(input())
if S[2] == S[3] and S[4] == S[5]:
    print('Yes')
else:
    print('no')


Failing test case input:
hedeen

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
S = str(input())
if S[2] == S[3] and S[4] == S[5]:
    print('Yes')
else:
    print('No')

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


s = input()

if s[2]==s[3] or s[4]==s[5]:
    print('Yes')
else:
    print('No') 

Failing test case input:
gdeebo

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):


s = input()

if s[2]==s[3] and s[4]==s[5]:
    print('Yes')
else:
    print('No')
Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=list(input())

if s[2]==s[3]:
    if s[4]==s[5]:
        print('Yes')
else:
    print('No')
    


Failing test case input:
vvppjs

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
s=list(input())
if s[2]==s[3]:
    if s[4]==s[5]:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input();

if((S[2:3]) == (S[3:4])):
    if((S[4:5]) == (S[5:])):
        print('Yes');
    else:
        print('No');

Failing test case input:
ffoegc

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
S=input();

if((S[2:3]) == (S[3:4])):
    if((S[4:5]) == (S[5:])):
        print('Yes');
    else:
        print('No');
else:
    print('No');

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
if s[2]==[3] and s[4]==[5]:
  print("Yes")
else:
  print("No")

Failing test case input:
sippuu

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
s=input()

if s[2]==s[3] and s[4]==s[5]:
  print("Yes")
else:
  print("No")

Problem: p02723
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s=input()
if s!=' ':
    print("Yes") if s[3]==s[2] else print("No")
else:
    print("No")


Failing test case input:
geeebo

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s=input()
if s!=' ':
    print("Yes") if s[3]==s[2] and s[4]==s[5] else print("No")
else:
    print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

if s[2] == s[3] and [4] == s [5]:
  print("Yes")
else:
  print("No")

Failing test case input:
sippuu

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
s = input()

if s[2] == s[3] and s[4] == s[5]:
  print("Yes")
else:
  print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
s.lower()

if s[2] == s[3] and s[4] == s[5]:
    print("yes")
else:
    print("no")

Failing test case input:
eohoni

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
s = input()
s.lower()

if s[2] == s[3] and s[4] == s[5]:
    print("Yes")
else:
    print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
x = input()

if x[2] == x[3] and x[4] == x[5]:
    print("yes")
else:
    print("no")

Failing test case input:
vvppjs

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
x = input()

if x[2] == x[3] and x[4] == x[5]:
    print("Yes")
else:
    print("No")
Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    s = list(input())
    
    if(len(s)!=6):
        main()
    
    for e in s:
        if(e.islower()==False):
            main()
            
            
    for i in range(6):
        if(s[2]==s[3] and s[4]==s[5]):
            print("Yes")
        else:
            print("No")
            
main()

Failing test case input:
edgnfg

Expected output:
No


Actual output:
No
No
No
No
No
No


Fixed submission (verdict: Accepted):
def main():
    s = list(input())
    
    if(len(s)!=6):
        main()
    
    for e in s:
        if(e.islower()==False):
            main()
    
    if(s[2]==s[3] and s[4]==s[5]):
        print("Yes")
    else:
        print("No")
main()

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
if s[2] == s[3] or s[4] == s[5]:
  print('yes')
else:
  print('no')

Failing test case input:
hnheon

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
s = input()
if s[2] == s[3] and s[4] == s[5]:
  print('Yes')
else:
  print('No')

Problem: p02723
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S = input()

if S[2]==S[3] and [4]==S[5]:
  print("Yes")
else:
  print("No")

Failing test case input:
sippuu

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
S = input()

if S[2]==S[3] and S[4]==S[5]:
  print("Yes")
else:
  print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
s_serve = list(s)

if s.count(s_serve[0])==1 and s.count(s_serve[1])==1 and s.count(s_serve[2])==s.count(s_serve[3]) and s.count(s_serve[4])==s.count(s_serve[5]):
  print('Yes')
else:
  print('No')

Failing test case input:
sjrpvv

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s = input()
s_serve = list(s)

if s.count(s_serve[0])==1 and s.count(s_serve[1])==1 and s_serve[2]==s_serve[3] and s_serve[4]==s_serve[5]:
  print('Yes')
else:
  print('No')

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = list(input())
print(S)

if S[2] == S[3] and S[4] == S[5]:
    print('Yes')
else:
    print('No')


Failing test case input:
hrvqpv

Expected output:
No


Actual output:
['h', 'r', 'v', 'q', 'p', 'v']
No


Fixed submission (verdict: Accepted):
S = list(input())

if S[2] == S[3] and S[4] == S[5]:
    print('Yes')
else:
    print('No')

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
if s[2:4] == 'ff' and s[4:6] == 'ee':
    print('Yes')
else:
    print('No')

Failing test case input:
sjppvv

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s = input()
if s[2]==s[3] and s[4]==s[5]:
    print('Yes')
else:
    print('No')
Problem: p02723
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
I=lambda:list(map(int,input().split()))
s=list(input())
if s[2]==s[4] or s[2]==s[5] or s[3]==s[4] or s[5]:
    print("Yes")
else:
    print('No')

Failing test case input:
iphone

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
I=lambda:list(map(int,input().split()))
s=list(input())
if s[2]==s[3] and s[5]==s[4] :
    print("Yes")
else:
    print('No')

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = str(input())
if (S[2]) == (S[3]):
    if (S[4]) == (S[5]):
        print("Yes")

else:
    print("No")


Failing test case input:
nnhheo

Expected output:
No


Actual output:

Fixed submission (verdict: Accepted):
S = str(input())
if (S[2]) == (S[3]):
    if (S[4]) == (S[5]):
        print("Yes")
    else:
        print("No")

else:
    print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input().strip()

if S[2] == S[3] or S[4] == S[5]:
    print('Yes')
else:
    print('No')

Failing test case input:
sjrpvv

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = input().strip()

if S[2] == S[3] and S[4] == S[5]:
    print('Yes')
else:
    print('No')

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
print('Yes' if s[4]=='e' and s[5]=='e' else 'No')

Failing test case input:
sjppvv

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
s=input()
print('Yes' if s[2]==s[3] and s[4]==s[5] else 'No')

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()

if (s[2]==s[3] and s[4]==s[5]):
	print("yes")
else:
    print("no")


Failing test case input:
ivpsvr

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
s = input()

if((s[2]==s[3]) and (s[4]==s[5])):
  	print("Yes")
else:
	print("No")

Problem: p02723
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
list_S = list(S)
if list_S[2] == list_S[3] or list_S[4] == list_S[5]:
  print("Yes")
else:
  print("No")

Failing test case input:
sippvu

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = input()
list_S = list(S)
if list_S[2] == list_S[3] and list_S[4] == list_S[5]:
  print("Yes")
else:
  print("No")
Problem: p03680
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
dic = {i+1:int(input()) for i in range(n)}
light = dic[1]
ans = 1

for i in range(n):
    if light == 2:
        break
    
    if light == 1:
        ans = -1
        break
        
    ans += 1
    light = dic[light]
    
print(ans)

Failing test case input:
4
4
8
0
4

Expected output:
-1


Actual output:
5


Fixed submission (verdict: Accepted):
n = int(input())
dic = {i+1:int(input()) for i in range(n)}
light = dic[1]
ans = 1

for i in range(n):
    if light == 2:
        break
    elif light == 1 or i == n-1:
        ans = -1
        break
    else:
        ans += 1
        light = dic[light]
    
print(ans)

Problem: p03680
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
l = [0] + [int(input()) for i in range(n)]
cnt = 0
a = 1
print(l)
while a != 2:
    if a==0:
        print(-1)
        break
    tmp=l[a]
    l[a]=0
    a=tmp
    cnt += 1
else:
    print(cnt)


Failing test case input:
3
1
1
4

Expected output:
-1


Actual output:
[0, 1, 1, 4]
-1


Fixed submission (verdict: Accepted):
n = int(input())
l = [0] + [int(input()) for i in range(n)]
cnt = 0
a = 1
while a != 2:
    if a==0:
        print(-1)
        break
    tmp=l[a]
    l[a]=0
    a=tmp
    cnt += 1
else:
    print(cnt)

Problem: p03680
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = []
for i in range(n):
    a.append(int(input())-1)
 
light=0
 
for i in range(n):
    light=a[light]
    if light == 1:
        print(i)
        break
else:
    print(-1)

Failing test case input:
4
3
2
2
2

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())
a = []
for i in range(n):
    a.append(int(input())-1)
 
light=0
 
for i in range(1,n+1):
    light=a[light]
    if light == 1:
        print(i)
        break
else:
    print(-1)

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

cur = 0
for i in range(10**5):
    if a[cur] == 2:
        print(cur)
        exit()
    cur = a[cur]-1
print(-1)

Failing test case input:
4
4
10
0
2

Expected output:
2


Actual output:
3


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

cur = 0
cnt = 0
for i in range(n):
    cnt += 1
    if a[cur] == 2:
        print(cnt)
        exit()
    cur = a[cur]-1
    
print(-1)

Problem: p03680
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
a=[0]*N
for i in range(N):
  a[i]=int(input())

now=0
cnt=0
for j in range(N):
  
  if a[now]==2:
    print(cnt)
    break
  elif a[now]-1==now:
    print(-1)
    break
  else:
    now=a[now]-1
    cnt += 1
else:
  print(-1)

Failing test case input:
4
3
2
2
3

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
N=int(input())
a=[0]*(N+1)
for i in range(1,N+1):
  a[i]=int(input())

now=1
cnt=0
for j in range(1,N+1):
  
  if a[now]==2:
    cnt +=1
    print(cnt)
    break
  elif a[now]==now:
    print(-1)
    break
  else:
    now=a[now]
    cnt += 1
else:
  print(-1)
Problem: p03680
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
alist = []
for _ in range(N):
    alist.append(int(input()))
history = []
i = 1
while True:
    if i in history:
        print(-1)
        break
    history.append(i)
    i = alist[i - 1]
    if i == 2:
        break
print(len(history))

Failing test case input:
3
1
2
6

Expected output:
-1


Actual output:
-1
1


Fixed submission (verdict: Accepted):
N = int(input())
alist = []
for _ in range(N):
    alist.append(int(input()))
i = 1
for n in range(N):
    i = alist[i - 1]
    if i == 2:
        print(n + 1)
        break
else:
    print(-1)

Problem: p03680
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = [int(input()) for i in range(n)]
on = 1
for i in a:
  on = a[on-1]
  if on == 2:
    print(i+1)
    exit()
print(-1)
  


Failing test case input:
4
4
6
1
2

Expected output:
2


Actual output:
7


Fixed submission (verdict: Accepted):
n = int(input())
a = [int(input()) for i in range(n)]
on = 1
for i in range(n):
  on = a[on-1]
  if on == 2:
    print(i+1)
    exit()
print(-1)

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


def main():
    n = int(input())
    a_list = [int(input()) for _ in range(n)]
    a_list.insert(0, 0)

    position = 1
    cnt = 0
    for i in range(n):
        position = a_list[position]
        cnt += 1
        if position == 2:
            print(cnt + 1)
            exit()
    print(-1)

if __name__ == '__main__':
    main()

Failing test case input:
3
2
0
6

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):


def main():
    n = int(input())
    a_list = [int(input()) for _ in range(n)]
    a_list.insert(0, 0)

    position = 1
    cnt = 0
    for i in range(n):
        position = a_list[position]
        cnt += 1
        if position == 2:
            print(cnt)
            exit()
    print(-1)

if __name__ == '__main__':
    main()

Problem: p03680
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = []
for i in range(N):
    a = int(input())
    A.append(a)
check = 0
count = 0
botton = 1
print(A[1 -1])
for i in range(N):
    count += 1
    if A[botton - 1] == 2:
        check = 1
        break
    botton = A[botton - 1]

if check == 0:
    print(-1)
else:
    print(count)

Failing test case input:
5
3
-1
4
3
4

Expected output:
-1


Actual output:
3
-1


Fixed submission (verdict: Accepted):
N = int(input())
A = []
for i in range(N):
    a = int(input())
    A.append(a)
check = 0
count = 0
botton = 1
for i in range(N):
    count += 1
    if A[botton - 1] == 2:
        check = 1
        break
    botton = A[botton - 1]

if check == 0:
    print(-1)
else:
    print(count)
Problem: p03680
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
A=list(int(input()) for i in range(n))
a=0
for x in range(n):
  a=A[a]-1
  if a==1:
    print(x+2)
    break
else:
  print(-1)

Failing test case input:
3
3
1
2

Expected output:
2

Actual output:
3


Fixed submission (verdict: Accepted):
n=int(input())
A=list(int(input()) for i in range(n))
a=0
for x in range(n):
  a=A[a]-1
  if a==1:
    print(x+1)
    break
else:
  print(-1)

Problem: p03680
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
a = [int(i) for i in sys.stdin]
now = a[1]
count = 0
while count!=a[0]:
    count += 1
    if now == 2:
        print(count)
        exit()
        now = a[now]
print(-1)


Failing test case input:
4
3
35
2
3

Expected output:
2


Actual output:
-1


Fixed submission (verdict: Accepted):
import sys
a = [int(i) for i in sys.stdin]
now = a[1]
count = 0
while count!=a[0]:
    count += 1
    if now == 2:
        print(count)
        exit()
    now = a[now]
print(-1)

Problem: p03680
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = [int(input()) for i in range(n)]
cnt = 0

if 2 not in a:
  print(-1)

x = 1
for i in range(2,n):
 
  x = a[x-1]
  cnt += 1

            
  if x == 2:
    print(cnt)
    exit()

print(-1)

Failing test case input:
4
3
11
3
1

Expected output:
-1


Actual output:
-1
-1


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

if 2 not in a:
  print(-1)
  exit()

x = 1
for i in range(n-1):
 
  x = a[x-1]
  cnt += 1

            
  if x == 2:
    print(cnt)
    exit()

print(-1)

Problem: p03680
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
lamp=[]
status=1
count=0
possible=1
for i in range(n):
  p=int(input())
  lamp.append(p)
while status!=2:
  if lamp[status-1]!=0:
    status=lamp[status-1]
    lamp[status-1]=0
    count+=1
  else:
    print(-1)
    break
print(count)


Failing test case input:
4
3
4
2
1

Expected output:
2


Actual output:
-1
1


Fixed submission (verdict: Accepted):
n=int(input())
lamp=[]
status=1
count=0
possible=0
for i in range(n):
  p=int(input())
  lamp.append(p)
while status!=2:
  if lamp[status-1]!=0:
    var=lamp[status-1]
    lamp[status-1]=0
    status=var
    count+=1
  else:
    possible+=1
    break
if possible==0:
  print(count)
else:
  print(-1)
Problem: p03680
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import sys


def solve(N: int, a: "List[int]"):
    visited = set()
    a = [0]+a
    i = 1

    while True:
        if i > N:
            print(-1)
            break
        elif a[i] == 2:
            print(i-1)
            break
        elif a[i] in visited:
            print(-1)
            break
        else:
            visited.add(i)
            i = a[i]


    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    a = [int(next(tokens)) for _ in range(N)]  
    solve(N, a)

if __name__ == '__main__':
    main()


Failing test case input:
4
4
16
1
2

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):

import sys


def solve(N: int, a: "List[int]"):

    i = 0
    for _ in range(N):

        if a[i] == 2:
            print(_+1)
            return
        i = a[i] - 1

    print(-1)
    

    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    a = [int(next(tokens)) for _ in range(N)]  
    solve(N, a)

if __name__ == '__main__':
    main()

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

count = 1
i = 0

while count < n:
  i = a[i] - 1
  if i == 1:
    print(count)
    break
  count += 1
print(-1)


Failing test case input:
4
4
3
1
2

Expected output:
2


Actual output:
2
-1


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

count = 1
i = 0

while count < n:
  i = a[i] - 1
  if i == 1:
    print(count)
    break
  count += 1
if count >= n:
  print(-1)

Problem: p03680
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=[int(input()) for i in range(0,n)]
j=0
ans=-1
for i in range(0,n):
    if a[j] == 2:
        ans = j
        break
    j = a[j]-1

print(ans)

Failing test case input:
4
4
2
1
2

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
n=int(input())
a=[int(input()) for i in range(0,n)]
j=0
ans=-1
for i in range(1,n+1):
    if a[j] == 2:
        ans = i
        break
    j = a[j]-1

print(ans)

Problem: p03680
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
x = [int(input()) for i in range(N)]
cnt = 1
num = x[0]
if num != 2:
    cnt = 2
    for i in range(N):
        num = x[num-1]

        if(num == 2):
            break
        cnt += 1
print(cnt)

Failing test case input:
4
4
0
0
4

Expected output:
-1


Actual output:
6


Fixed submission (verdict: Accepted):
N = int(input())
x = [int(input()) for i in range(N)]
cnt = 1
num = x[0]
if num != 2:
    cnt = 2
    for i in range(N):
        num = x[num-1]

        if(num == 2):
            break
        cnt += 1
if cnt == N + 2:
    cnt = -1
print(cnt)
Problem: p03680
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = [int(input()) for i in range(N)]

def push(i):
    return A[i] - 1

index = 0
cnt = 0
for _ in range(N):
    index = push(index)
    cnt += 1
    if index == 1:
       print(cnt)
       exit()
print


Failing test case input:
4
4
4
0
4

Expected output:
-1


Actual output:

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

def push(i):
    return A[i] - 1

index = 0
cnt = 0
for _ in range(N):
    index = push(index)
    cnt += 1
    if index == 1:
       print(cnt)
       exit()
print(-1)

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

from collections import defaultdict
N = int(input())
a = [int(input()) for _ in range(N)]

d = defaultdict(int)
for i, e in enumerate(a, 1):
    d[i] = e

count = 1
tmp = d[1]
while count <= N:
    v = d[tmp]
    count += 1
    if v == 2:
        print(count)
        exit()
    tmp = v
print(-1)

Failing test case input:
3
2
2
6

Expected output:
1


Actual output:
2


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

d = defaultdict(int)
for i, e in enumerate(a, 1):
    d[i] = e

count = 1
tmp = d[1]
if tmp == 2:
    print(1)
    exit()

while count <= N:
    v = d[tmp]
    count += 1
    if v == 2:
        print(count)
        exit()
    tmp = v
print(-1)

Problem: p03680
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
a = [int(input()) for _ in range(N)]
cnt = 1
button = a[0]
print(button)
while button != 2:
    button = a[button - 1]
    cnt += 1
    if cnt > N:
        print(-1)
        break
else:
    print(cnt)

Failing test case input:
3
3
0
3

Expected output:
-1


Actual output:
3
-1


Fixed submission (verdict: Accepted):
N = int(input())
a = [int(input()) for _ in range(N)]
cnt = 0
button = 1
for _ in range(N):
    button = a[button - 1]
    cnt += 1
    if button == 2:
        print(cnt)
        exit()
print(-1)