qyliang/CodeNanoFix huggingface dataset:
Buggy code:
N = int(input())

s = input()
t = input()
ans = N
for i in range(N):
  if (s[i:] == t[:N-i]):
    ans += i
    break
  ans = 2*N
print(ans)

Fixed code:
N=int(input())
s=input()
t=input()

ans=2*N
for i in range(N):
  if s[i:N]==t[:N-i]:
    ans=2*N-(N-i)
    break
print(ans)
Buggy code:
N=int(input())
s=input()
t=input()
ans=2*N

for i in range(N):
  if s[-1-i]==t[i]:
    ans+=-1
  else:
    break

print(ans)

Fixed code:
N = int(input())
s, t = input(), input()
for i in range(N):
    if s[i:] == t[:N-i]:
        ans = N+i
        break
else:
    ans = 2*N
print(ans)
Buggy code:
n=int(input())
s=input()
t=input()

for i in range(n,2*n-1):
    if s[:2*n-i] == t[2*n-i]:
        print(i)
        exit()
print(2*n)

Fixed code:
n = int(input())
s = input()
t = input()
p = 0
for i in range(n, -1, -1):
    if s[n-i:] == t[:i]:
        p = i
        print(2 * n - p)
        exit()
Buggy code:
n = int(input())
a = input()
b = input()
count = 0
for i in range(n+1):
    if a[-i:] == a[:i]:
        count = i
print(2*n-count)

Fixed code:
n = int(input())
a = input()
b = input()
count = 0
for i in range(n+1):
    if a[-i:] == b[:i]:
        count = i
print(2*n-count)
Buggy code:
N = int(input())
s = input()
t = input()
for i in range(N+1):
    if s[i:]==t[:N-i]:
        break
print(s+t[N-i:])

Fixed code:
N = int(input())
s = input()
t = input()
ans = N
for i in range(N):
    if s[i:] == t[:(N-i)]:
        break
    ans += 1

print(ans)
Buggy code:
N = int(input())
s = input()
t = input()

for i in range(N):
    A = s[:i] + t
    if A[:N] == s and A[-N:] == t:
        print(len(A))
        exit()

Fixed code:
N = int(input())
s = input()
t = input()

for i in range(N+1):
    A = s[:i] + t
    if A[:N] == s and A[-N:] == t:
        print(len(A))
        exit()
Buggy code:
import sys


n=int(input())
s=input()
t=input()
test=s+t
if(s==t):
    print(s)
    sys.exit()
for i in range(1,n+1)[::-1]:
    test=s[0:-i]+t
    if(test[:n]==s and test[-n:]==t):
        print(test)
        sys.exit()
        
print(s+t)

Fixed code:
import sys


n=int(input())
s=input()
t=input()
test=s+t
if(s==t):
    print(len(s))
    sys.exit()
for i in range(1,n+1)[::-1]:
    test=s[0:-i]+t
    if(test[:n]==s and test[-n:]==t):
        print(len(test))
        sys.exit()
        
print(len(s+t))
Buggy code:
N = int(input())
s = input()
t = input()

for i in range(N):
    if s==t:
        print(N)
        break
    elif s[i:] == t[:-i]:
        print(N+i)
        break
    else:
        print(N*2)
        break

Fixed code:
N = int(input())
s = input()
t = input()

for i in range(N):
    if s[i:] == t[:(N-i)]:
        print(2*N - (N-i))
        break
else:
    print(2*N)
Buggy code:
n = int(input())
s = input().rstrip()
t = input().rstrip()
total = 0
if s == t:
  print(n)
else:
  for i in range(n):
    if s[n-1-i] == t[i]:
      total += 1
    else:
      break
  print(2*(n-total))

Fixed code:
n = int(input())
s = input().rstrip()
t = input().rstrip()
total = 0
for i in range(n):
  if s[n-1-i:] == t[:i+1]:
    total = i+1
print(2*n-(total))
Buggy code:
n = int(input())
s = input()
t = input()
for i in range(n):
    l = n - i
    if s[i:] == t[i:i+l]:
        print(2*n-l)
        exit()
print(2*n)


Fixed code:
n = int(input())
s = str(input())
t = str(input())
for i in range(n):
    if s[i:] == t[:n-i]:
        print(n + i)
        exit()
print(2 * n)
Buggy code:
n = input()
s = input()
t = input()
ans = s
for i in range(0, len(s)):
    if s[len(s) - i-1:len(s)] == t[0:i+1]:
        ans = s[0:len(s) - i-1] + t
print(len(ans))


Fixed code:
n = input()
s = input()
t = input()
ans = s+t
for i in range(0, len(s)):
    if s[len(s) - i-1:len(s)] == t[0:i+1]:
        ans = s[0:len(s) - i-1] + t
print(len(ans))
Buggy code:
N = int(input())
S = input()
T = input()
for x in range(N, 2 * N + 1):
    if S[x - N:] == T[:2 * N - x]:
        print(S + T[2 * N - x:])
        exit()


Fixed code:
N = int(input())
S = input()
T = input()

for l in range(N, 2 * N + 1):
    if S[N - 2 * N + l:] == T[:2 * N - l]:
        print(l)
        exit()
Buggy code:
N = int(input())
prefix = input()
suffix = input()


if len(prefix) + len(suffix) < N:
    d = N - len(prefix) + len(suffix)
    print(prefix + 'a' * d + suffix)
else:
    s = ""
    for i in range(1, N):
        # print(prefix[-i:], suffix[:i])
        if prefix[-i:] == suffix[:i]:
            s = prefix[:-i] + suffix
    if suffix == prefix:
        s = suffix
    if len(s) == 0:
        s = prefix + suffix
    print(s)


Fixed code:
N = int(input())
prefix = input()
suffix = input()


if len(prefix) + len(suffix) < N:
    d = N - len(prefix) + len(suffix)
    print(len(prefix + 'a' * d + suffix))
else:
    s = ""
    for i in range(1, N):
        # print(prefix[-i:], suffix[:i])
        if prefix[-i:] == suffix[:i]:
            s = prefix[:-i] + suffix
    if suffix == prefix:
        s = suffix
    if len(s) == 0:
        s = prefix + suffix
    print(len(s))
Buggy code:
a,b,c=(input() for _ in range(3))
cnt=0
for i in range(1,int(a)):
    if(b[-i:]==c[:i]):cnt+=1
print(2*int(a)-cnt)

Fixed code:
a,b,c=(input() for _ in range(3))
cnt=0
for i in range(1,int(a)+1):
    if(b[-i:]==c[:i]):cnt=i
print(2*int(a)-cnt)
Buggy code:
# -*- coding:utf-8 -*-
N = int(input())
s = input()
t = input()
index = N
a = -1
for tmp in range(1,len(t)+1):
    if s[index-1:len(s)] == t[0:tmp]:
        a = index-1
    index -= 1
if a == -1:
    print(s+t)
else:
    for tmp in range(len(s)-a, len(t)):
        s = s+t[tmp]
    print(s)

Fixed code:
# -*- coding:utf-8 -*-
N = int(input())
s = input()
t = input()
index = N
a = -1
for tmp in range(1,len(t)+1):
    if s[index-1:len(s)] == t[0:tmp]:
        a = index-1
    index -= 1
if a == -1:
    print(len(s+t))
else:
    for tmp in range(len(s)-a, len(t)):
        s = s+t[tmp]
    print(len(s))
Buggy code:
N = int(input())
s = input()
t = input()
for i in range(N):
    if s[N - 1 - i:N] == t[0:i + 1]:
        t = t[i + 1:N]
print(s + t)

Fixed code:
N = int(input())
s = input()
t = input()
u = t
for i in range(N):
    if s[N - 1 - i:N] == t[0:i + 1]:
        u = t[i + 1:N]
print (len(s + u))
Buggy code:
n=int(input())
s=input()
t=input()
for i in range(n):
    if t[:-i]==s[i:]:
        break
print(n+i)

Fixed code:
n = int(input())
s = input()
t = input()
for i in range(n + 1):
    if s[i:] == t[:len(t)-i]:
        print(len(s + t[len(t)-i:]))
        break
Buggy code:
n = int(input())
s = input()
t = input()
for i in range(n, 0, -1):
    if s[-i:] == t[:i]:
        print(2 * n - i)
        break


Fixed code:
n = int(input())
s = input()
t = input()
for i in range(n, 0, -1):
    if s[-i:] == t[:i]:
        ans = 2 * n - i
        print(ans)
        break
else:
    print(2 * n)
Buggy code:
# -*- coding: utf-8 -*-
n = int(input())
s = input()
t = input()
txt = s+t
tmp = ''

for i in range(1,n):
    tmp = s+t[i:]
    if tmp[-n:]==t:
        txt = tmp

if s==t:
    print(s)
else :
    print(txt)

Fixed code:
# -*- coding: utf-8 -*-
n = int(input())
s = input()
t = input()
txt = s+t
tmp = ''

for i in range(1,n):
    tmp = s+t[i:]
    if tmp[-n:]==t:
        txt = tmp

if s==t:
    print(len(s))
else :
    print(len(txt))
Buggy code:
import sys
n=input()
s=input()
t=input()
count=0
sub_count=0
max=len(s+t)
flag=True
for i in range(len(s)):
    flag=True
    j=0
    for ii in range(i,len(s)):
        if t[j]!=s[ii]:
            flag=False
            break
        j+=1
        count+=1
    if flag:
        print(len(s)+i)
        sys.exit()

Fixed code:
import sys
n=input()
s=input()
t=input()
count=0
flag=True
for i in range(len(s)):
    flag=True
    j=0
    for ii in range(i,len(s)):
        if t[j]!=s[ii]:
            flag=False
            break
        j+=1
        count+=1
    if flag:
        print(len(s)+i)
        sys.exit()
print(len(s+t))
Buggy code:
n = int(input())
s = input()
t = input()

if s==t:
  print(s)
  
else:
  for i in range(n):
    if s[i:] == t[:-i]:
      print(2*n -(n-i))
    else:
      print(2*n)

Fixed code:
n=int(input())
s=input()
t=input()
for i in range(n):
    if s[i:] == t[:n-i]:
        print(n+i)
        break
else:
    print(n*2)
Buggy code:
import sys

N = int(input())

a = input()
b = input()

for i in range(N):
	if(a[0:N-i] == b[i:N]){
		print(N+i)
		sys.exit()
		
print(2 * N)

Fixed code:
import sys

N = int(input())

a = input()
b = input()

for i in range(N):
	if a[i:N] == b[0:N-i]:
		print(N+i)
		sys.exit()
		
print(2 * N)
Buggy code:
n = int(input())
s = input()
t = input()
for i in range(n, 0, -1):
    if s[-i:] == t[:i]:
        ans = 2 * n - i
        print(ans)
        break
print(2 * n)


Fixed code:
n = int(input())
s = input()
t = input()
ans = 2 * n
for i in range(0,n + 1):
    if s[-i:] == t[:i]:
        ans = 2 * n - i
print(ans)
Buggy code:
N = int(input())
s = input()
t = input()

for i in range(1, N):
    if s[i:] == t[:-i]:
        k = N - i
        break

if s == t:
    print(N)
else:
    print(2 * N - k)

Fixed code:
N = int(input())
s = input()
t = input()

k = 0
for i in range(1, N):
    if s[i:] == t[:-i]:
        k = N - i
        break

if s == t:
    print(N)
else:
    print(2 * N - k)
Buggy code:
N = int(input())
s = input()
t = input()
u = 0
for i in range(N):
    if s[i - 1:] == t[:i + 1]:
        u = i + 1
print (N * 2 - u)

Fixed code:
N = int(input())
s = input()
t = input()
a = 0
for i in range(N):
	if s[-i-1:] == t[:i+1]:
		a = i+1
print(2*N-a)
Buggy code:
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 29 21:00:35 2016

@author: dotha
"""

def main():
    N = int(input())
    s = input()
    t = input()
    if s==t:
        return s
    for i in range(N):
        if s[i:] == t[:-i]:
            return(s[:i]+t)
    else:
        return(s+t)
    





if __name__ == "__main__":
    print(main())

Fixed code:
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 29 21:00:35 2016

@author: dotha
"""

def main():
    N = int(input())
    s = input()
    t = input()
    if s==t:
        return s
    for i in range(N):
        if s[i:] == t[:-i]:
            return(s[:i]+t)
    else:
        return(s+t)
    





if __name__ == "__main__":
    print(len(main()))
Buggy code:
N = int(input())
S = input()
T = input()

for i in range(N, 0, -1):
  if(S[-i:] == T[:i]):
    tmp = i
    break
print(N*2-tmp)

Fixed code:
N=int(input())
S=input()
T=input()
for i in range(N,-1,-1):
    if S[N-i:] == T[:i]:
        print(2*N-i)
        break
Buggy code:
S = input()
a = len(S)
b = -1
for i in range(len(S)):
    if S[i] == "C":
        a = i
        break
for i in range(len(S)):
    if S[len(S)-i-1] == "F":
        b = i
        break
if a < b:
    print("Yes")
else:
    print("No")

Fixed code:
S = input()
a = len(S)
b = -1
for i in range(len(S)):
    if S[i] == "C":
        a = i
        break
for i in range(len(S)):
    if S[len(S)-i-1] == "F":
        b = len(S)-i-1
        break
if a < b:
    print("Yes")
else:
    print("No")
Buggy code:
s = input()
c = s.find('C')
f = s.find('F')
print('Yes') if c >= 0 and f >= 0 and (c - f) < 0 else print('No')

Fixed code:
s = input()
c = s.rfind('C')
f = s.rfind('F')
print('Yes') if c >= 0 and f >= 0 and (c - f) < 0 else print('No')
Buggy code:
s=input()
flag=False
for i in range(len(s)):
  if s[i]=="C":
    flag=True
  if s[i]=="F" and flag:
    print("Yes")
    break
if not flag:
  print("No")

Fixed code:
s=input()
ans="No"
flag=False
for i in range(len(s)):
  if not flag and s[i]=="C":
    flag=True
  elif flag and s[i]=="F":
    ans="Yes"
    break
print(ans)
Buggy code:
def main():
    s=input()
    a=s.find('C')
    if(a==-1):
        print('No')
    else
        a2=s.find('F',a+1,len(s))
        if(a2==-1):
            print('No')
        else:
            print('Yes')

main()


Fixed code:
def main():
    s=input()
    a=s.find('C')
    if(a==-1):
        print('No')
    else:
        a2=s.find('F',a+1,len(s))
        if(a2==-1):
            print('No')
        else:
            print('Yes')

main()
Buggy code:
s = input()

c_idx = len(s)
f_idx = -1
for i in range(len(s)):
    if s[i] == 'C':
        c_idx = min(c_idx, i)
    if s[i] == 'F':
        f_idx = max(c_idx, i)
print('Yes' if c_idx < f_idx else 'No')


Fixed code:
s = input()

c_idx = len(s)
f_idx = -1
for i in range(len(s)):
    if s[i] == 'C':
        c_idx = min(c_idx, i)
    if s[i] == 'F':
        f_idx = max(f_idx, i)
print('Yes' if c_idx < f_idx else 'No')
Buggy code:
s=input()
ans='No'
for i in range(len(s)):
  if s[i]=='C':
    for j in s[i+1:]:
      if s[j]=='F':
        ans='Yes'
print(ans)

Fixed code:
s=input()
ans='No'
for i in range(len(s)):
  if s[i]=='C':
    for j in s[i+1:]:
      if j=='F':
        ans='Yes'
print(ans)
Buggy code:
S = input()
if "C" in S and "F" in S:
  if S.index("C")<[i for i, x in enumerate(S) if x == "F"][-1]:
    print("Yes")
print("No")


Fixed code:
S = input()
if "C" in S and "F" in S:
  if S.index("C")<[i for i, x in enumerate(S) if x == "F"][-1]:
    print("Yes")
    exit()
print("No")
Buggy code:
s = input()
sc = ''
c = 0

for i in range(len(s)):
  if 'C' == s[i]:
    sc = s[i+1:]
    for j in range(len(sc)):
      if 'F' == sc[j]:
        c += 1

if c >= 0:
  print('Yes')
else:
  print('No')

Fixed code:
s = input()
sc = ''
c = 0

for i in range(len(s)):
  if 'C' == s[i]:
    sc = s[i+1:]
    for j in range(len(sc)):
      if 'F' == sc[j]:
        c += 1

if c > 0:
  print('Yes')
else:
  print('No')
Buggy code:
import re

p = re.compile('C.*F')
s = input()
m = re.match(p, s)
print('Yes' if m is not None else 'No')


Fixed code:
import re

s = input()
p = re.compile('C.*F')
m = re.search(p, s)
print('Yes' if m is not None else 'No')
Buggy code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

if __name__ == '__main__':
    s =input()


    if "C" in s and "F" in s and s.index("C") < s.index("F"):
        print("Yes")
    else:
        print("No")



Fixed code:
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

if __name__ == '__main__':
    s =input()


    if "C" in s and "F" in s and "F" in  s[s.index("C"):] :
        print("Yes")
    else:
        print("No")
Buggy code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10

#solve
def solve():
    s = S()
    ans = [0, 0]
    for i in s:
        ans[0] |= s[i] == "C"
        ans[1] |= s[i] == "F" and ans[1]
    print("Yes" if ans[1] else "No")
    return


#main
if __name__ == '__main__':
    solve()


Fixed code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10

#solve
def solve():
    s = S()
    ans = [0, 0]
    for i in s:
        ans[0] |= i == "C"
        ans[1] |= i == "F" and ans[0]
    print("Yes" if ans[1] else "No")
    return


#main
if __name__ == '__main__':
    solve()
Buggy code:
c  = 0
s = input()
for i,si in enumerate(s):
  if si == "C":
    c = 1
  elif si == "F":
    print("Yes")
    exit()
print("No")

Fixed code:
c  = 0
s = input()
for i,si in enumerate(s):
  if si == "C":
    c = 1
  elif si == "F" and c:
    print("Yes")
    exit()
print("No")
Buggy code:
import sys
S = input()

if S.count("C") != 0 and S.count("F") != 0:
    pass
else:
    print("No")
    sys.exit()

ans = 0
for i in range(len(S) -1 ):
    if S[i] == "C" and S[i+1] == "F":
        print("Yes")
        sys.exit()

print("No")

Fixed code:
import sys
S = input()


if S.count("C") != 0 and S.count("F") != 0:
    pass
else:
    print("No")
    sys.exit()

ans = 0
for i in range(len(S)):
    if S[i] == "C":
        if S[i:len(S)].count("F") != 0:
            print("Yes")
            sys.exit()

print("No")
Buggy code:
S = input()
a,b= S.find('C'),S.find('F')
print('Yes') if a>0 and b>0 and> a<b else print('No')

Fixed code:
S = input()
a= S.find('C')
b= S.find('F',a+1)
print('Yes') if a>=0 and b>=0 and a<b else print('No')
Buggy code:
s = input()
if s.index('C') >= 0 and s.index('F') >= 0 and s.index('C') < s.index('F'):
    print('Yes')
else:
    print('No')


Fixed code:
s = input()
if s.find('C') >= 0 and s.find('F') >= 0:
    if s.index('C') < s.rindex('F'):
        print('Yes')
    else:
        print('No')
else:
    print('No')
Buggy code:

S = int(input())

a = 0

for i in S:
  if a == 0 and i == "C":
    a += 1
  if a == 1 and i == "F":
    a += 1
    
if a == 2:
  print ("Yes")
else:
  print ("No")

Fixed code:
S = input()

a = 0

for i in S:
  if a == 0 and i == "C":
    a += 1
  if a == 1 and i == "F":
    a += 1
    
if a == 2:
  print ("Yes")
else:
  print ("No")
Buggy code:
s = input()
n = len(s)

f = 0
for i in range(s):
    if s[i] == 'C' and f = 0:
        f += 1
    if s[i] == 'F' and f = 1:
        print("Yes")
        exit()
print("No")


Fixed code:
s=input()
n=len(s)
c=0
for i in range(n):
  if c==1 and s[i]=="F":
    print("Yes")
    exit()
  if c==0 and s[i]=="C":
    c+=1
print("No")
Buggy code:
s = input()
ans = []

for i in range(len(s)):
  if len(s) < 2 and (s[i] == 'C' or s[i] == 'F'):
    ans.append(s)

if ans[0] == 'C' and ans[1] == 'F':
  print('Yes')
else:
  print('No')

Fixed code:
s = input()
ans = []

for i in range(len(s)):
  if len(ans) == 0 and s[i] == 'C':
    ans.append(s[i])
  elif len(ans) == 1 and s[i] == 'F':
    ans.append(s[i])

if len(ans) == 2 and ans[0] == 'C' and ans[1] == 'F':
  print('Yes')
else:
  print('No')
Buggy code:
s=input()
t,u = 1000
for i in range(n):
  if s[i] == "C":
    t = i
    break
for i in range(n-1,-1,-1):
  if s[i] == "F":
    u = i
    break
if max(t,u) != 1000 and t<u:
  print("Yes")
else:
  print("No")

Fixed code:
s=input()
n=len(s)
t = 1000
u = 1000
for i in range(n):
  if s[i] == "C":
    t = i
    break
for i in range(n-1,-1,-1):
  if s[i] == "F":
    u = i
    break
if max(t,u) != 1000 and t<u:
  print("Yes")
else:
  print("No")
Buggy code:
s = input().strip()
if "C" in s:
    indc = s.index("C")
else:
    indc = 10**3
if "F" in s[indc:]:
    indf = indc+s.index("F")
else:
    indf = -1
if indc<indf:
    print("Yes")
else:
    print("No")


Fixed code:
s = input().strip()
if "C" in s:
    indc = s.index("C")
else:
    indc = 10**3
if "F" in s[indc:]:
    indf = indc+s[indc:].index("F")
else:
    indf = -1
if indc<indf:
    print("Yes")
else:
    print("No")
Buggy code:
s=str(input())
count=0
for i in range(len(s)):
  if count==0 and s[i]==C:
    count+=1
  elif count==1 and s[i]==F:
    count+=1
    print('Yes');exit()
    
print('No')

Fixed code:
s=str(input())
count=0
for i in range(len(s)):
  if count==0 and s[i]=='C':
    count+=1
  elif count==1 and s[i]=='F':
    count+=1
    print('Yes');exit()
    
print('No')
Buggy code:
s=input()
f=0
for i in range(len(s)):
    if s==0:
        if s[i]=='C':
            s=1
    else:
        if s[i]=='F':
            print('Yes')
            exit()
print('No')

Fixed code:
s=input()

f=0
for i in range(len(s)):
    if s[i]=="C":
        f=1
    if s[i]=="F" and f:
        print("Yes")
        exit()
print("No")
Buggy code:
s = input()
c = len(s)
f = 0
for i in s:
  if i == "C":
    c = min(c,i)
  elif i == "F":
    f = max(f,i)
if c < f:
  print("Yes")
else:
  print("No")
  

Fixed code:
s = input()
c = len(s)
f = 0
for x,i in enumerate(s):
  if i == "C":
    c = min(c,x)
  elif i == "F":
    f = max(f,x)
if c < f:
  print("Yes")
else:
  print("No")
Buggy code:
s=input()
c=f=0
for i in range(len(s)):
	if s[i]=="C":
		c=True
	if s[i]=="F":
		f=True
if c==f==True:
	print("Yes")
else:
	print("No")

Fixed code:
s=input()
c=f=0
for i in range(len(s)):
	if s[i]=="C":
		c=True
	if s[i]=="F" and c==True:
		f=True
if c==f==True:
	print("Yes")
else:
	print("No")
Buggy code:
#CF
s = input()
n = len(s)
c = 0
f = 0
for i in range(n):
    if s[i] == 'C' and c == 0:
        c = i
    if s[i] == 'F':
        f = i
if c != 0 and f != 0 and c < f:
    print("Yes")
else:
    print("No")

Fixed code:
#CF
s = input()
n = len(s)
c = 0
f = 0
for i in range(n):
    if s[i] == 'C' and c == 0:
        c = i+1
    if s[i] == 'F':
        f = i+1
if c != 0 and f != 0 and c < f:
    print("Yes")
else:
    print("No")
Buggy code:
s=list(input())
ans=0
for i in range(len(s)):
  if ans==2:
    break
  if s[i]=='C':
    ans+=1
  if ans=1:
    if s[i]=='F':
      ans+=1
if ans==2:
  print('Yes')
else:
  print('No')
  

Fixed code:
s=list(input())
ans=0
for i in range(len(s)):
    if s[i]=='C':
        ans+=1
        break
for j in range(i,len(s)):
    if s[j]=='F':
        ans+=1
        break
if ans==2:
    print('Yes')
else:
    print('No')
Buggy code:
t = s.find("C")
if s[t:].find("F") > 0:
    print("Yes")
else:
    print("No")

Fixed code:
s = input()
t = s.find("C")
if s[t:].find("F") > 0:
    print("Yes")
else:
    print("No")
Buggy code:
def main():
  s=input()
  x = s.find("C")
  y = s.find("F")
  if x<0 or y<0:
    print("No")
    return 0
  while x<len(s):
    if s[x]=="F":
      print("YES")
      return 0
    x+=1

    
main()

Fixed code:
def main():
  s=input()
  x = s.find("C")
  y = s.find("F")
  if x<0 or y<0:
    print("No")
    return 0
  while x<len(s):
    if s[x]=="F":
      print("Yes")
      return 0
    x+=1
  print("No")
  

    
main()
Buggy code:
s = list(input())
for i in range(len(s)):
    if s[i] == "C":
        c = True
    elif c and s[i] == "F":
        print("Yes")
        exit()
print("No")

Fixed code:
s=input()

c=False

for i in range(len(s)):
    if c==False and s[i]=="C":
        c=True
    elif c==True and s[i]=="F":
        print("Yes")
        exit()
print("No")
Buggy code:
S=input()
N=len(S)

if "C" in S and "F" in S:
  print("No")
else:
  c=S.index("C")
  S=S[::-1]
  f=N-S.index("F")-1
  #print(c,f)
  print("Yes" if c<f else "No")



Fixed code:
S=input()
N=len(S)

if "C" in S and "F" in S:
  c=S.index("C")
  S=S[::-1]
  f=N-S.index("F")-1
  #print(c,f)
  print("Yes" if c<f else "No")
else: 
  print("No")
Buggy code:
s=list(input())
n=len(s)
ans="No"
for i in range(n):
    if(s[i]=="C"):
        for j in range(n-i-1):
            if(s[i+j+1]):
                ans="Yes"
print(ans)

Fixed code:
s=list(input())
n=len(s)
ans="No"
for i in range(n):
    if(s[i]=="C"):
        for j in range(n-i-1):
            if(s[i+j+1]=="F"):
                ans="Yes"
print(ans)
Buggy code:
s = list(input())

for i in range(len(s)):
    if s[i] == 'C':
        for i in range(len(s)):
            if s[i] == 'F':
                print('Yes')
                exit(0)

print('No')

Fixed code:
s = input()
i = 0
for i in range(len(s)):
  if s[i] == "C":
    if "F" in s[i:]:
      print("Yes")
      exit()
print("No")