Problem:
 Score : 100 points    Problem Statement This contest is CODEFESTIVAL , which can be shortened to the string CF by deleting some characters.  Mr. Takahashi, full of curiosity, wondered if he could obtain CF from other strings in the same way.  You are given a string s consisting of uppercase English letters.
Determine whether the string CF can be obtained from the string s by deleting some characters.      Constraints  2 ≤ |s| ≤ 100  All characters in s are uppercase English letters ( A - Z ).         Input The input is given from Standard Input in the following format:  s       Output Print Yes if the string CF can be obtained from the string s by deleting some characters.
Otherwise print No .        Sample Input 1 CODEFESTIVAL      Sample Output 1 Yes  CF is obtained by deleting characters other than the first character C and the fifth character F .       Sample Input 2 FESTIVALCODE      Sample Output 2 No  FC can be obtained but CF cannot be obtained because you cannot change the order of the characters.       Sample Input 3 CF      Sample Output 3 Yes  It is also possible not to delete any characters.       Sample Input 4 FCF      Sample Output 4 Yes  CF is obtained by deleting the first character.

Solution (Python):
s = input()
i = len(s)

C_list = []
C_num = []
F_list = []
F_num = []

for x in range(i):
    if s[x] == 'C':
        C_list.append(s[x])
        C_num.append(x)
    elif s[x] == 'F':
        F_list.append(s[x])
        F_num.append(x)


if len(C_list) > 0 and len(F_list) > 0:
    if C_num[0] < F_num[-1]:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Solution (Python):
s = raw_input()
cFound = False
fFound = False

for c in s:
    if c == 'C' and not cFound:
        cFound = True
    elif c == 'F' and cFound:
        fFound = True
        break

print "Yes" if cFound and fFound else "No"

Solution (Python):
s = input()
if "C" in s and "F" in s:
  a = s.index("C")
  b = s.rindex("F")
  if a < b:
    print("Yes")
  else:
    print("No")
else:
  print("No")

Solution (Python):
import re
S1 = input()
p = r'C.+F|CF'
result = re.search(p, S1)
if result:
    print('Yes')
else:
    print('No')

Solution (Python):
s = input()
C=False
for c in s:
    if C:
        if c=='F':
            print('Yes')
            break
    elif c=='C':
        C=True
else:
    print('No')

Solution (Python):
import sys
for line in sys.stdin:
    a = line.rstrip()
    first = a.find("C")
    if first != -1:
        second = a.find("F",first)
        if second != -1:
            print("Yes")
        else:
            print("No")
    else:
            print("No")

Solution (Python):
import re

str = input()

print("Yes" if re.match(".*C.*F.*", str) else "No")

Solution (Python):
st = input()
l = len(st)
f = 1
for i in range(l):
    if st[i] == 'C' or st[i] == 'c':
        for j in range(i,l
                       ):
            if st[j]=='F' or st[j] == 'f':
                print('Yes')
                f = 0
                break
        if f ==0:
            break

if f:
    print('No')

Solution (Python):
s = input()
state = 0
for c in s:
    if c == 'C':
        if state == 0:
            state = 1
    if c == 'F':
        if state == 1:
            state = 2

if state == 2:
    print('Yes')
else:
    print('No')

Solution (Python):
def check_cf(s):
    try:
        idx_c = s.index('C')
        idx_f = s[idx_c:].index('F') + idx_c
    except:
        return 'No'

    if idx_c < idx_f:
        return 'Yes'

    return 'No'

if __name__ == '__main__':
    print check_cf(raw_input())

Solution (Python):
import re

m = input()

m2 = re.search('C[A-Z]*F', m)

if m2:
    
    print ("Yes")

else:
    print ("No")

Solution (Python):
s = input()
if ("C" in s) and ("F" in s):
    start = s.index("C")
    if "F" in s[start:]:
        print("Yes")
        exit()
print("No")

Solution (Python):
s = raw_input()

c = s.find('C')

t = s[::-1]

f = t.find('F')

if c == -1 or f == -1:
    print 'No'
elif c < len(s)-t.find('F')-1:
    print 'Yes'
else:
    print 'No'

Solution (Python):
S = raw_input()

pc = S.index("C") if "C" in S else -1
pf = S.rindex("F") if "F" in S else -1
if pc > -1 and pf > -1 and pc < pf:
    print "Yes"
else:
    print "No"

Solution (Python):
from collections import Counter
S = raw_input().strip()
str = "No"
Cpos = S.find('C')
Fpos = S[Cpos:].find('F')
if Cpos != -1 and Fpos != -1:
  str = "Yes"
print str

Solution (Python):
s = raw_input()

s1 = s.find('C')
s2 = len(s) - 1 - s[::-1].find('F')

if s1 < s2 and s1 >= 0 and s2 < len(s):
    print 'Yes'
else:
    print 'No'

Solution (Python):
s = input()

cl = []
fl = []

for i, c_test in zip(range(len(s)), s):
    if c_test == 'C':
        cl.append(i)

for i, f_test in zip(range(len(s)), s):
    if f_test == 'F':
        fl.append(i)
if len(cl) == 0 or len(fl) == 0:
    print("No")    
elif max(fl) > min(cl):
    print("Yes")
else:
    print("No")

Solution (Python):
def f():
    s = input()
    j = True
    for i in s:
        if j:
            if i == 'C':
                j = False
        else:
            if i == 'F':
                return 'Yes'
    return 'No'

print (f())

Solution (Python):
s = input()
c = s.find('C')
f = s.rfind('F')

if  c != -1 and f != -1 and (c < f):
    print('Yes')
else:
    print('No')

Solution (Python):
S = raw_input()
tt = S.find("C")
if tt == -1:
    print "No"
else:
    S = S[tt+1:]

    t2 = S.find("F")
    if t2 == -1:
        print "No"
    else:
        print "Yes"

Solution (Python):


import re

s = input()
if re.search("C.*F", s) is not None:
    print('Yes')
else:
    print('No')

Solution (Python):


st = str(raw_input())

if st.find('C') != -1:
    i = st.find('C')
    if st.find('F',i) != -1:
        print 'Yes'
    else:
        print 'No'
else:
    print 'No'

Solution (Python):
s = raw_input().strip()
if 'C' in s and 'F' in s and s.find('C') < s.rfind('F'):
    print 'Yes'
else:
    print 'No'

Solution (Python):
import sys


s = raw_input()
i = s.find('C')
if i < 0:
    print 'No'
    sys.exit(0)

s = s[i+1:]
i = s.find('F')
if i < 0:
    print 'No'
else:
    print 'Yes'

Solution (Python):
import sys
s=input()
for i in range(len(s)):
    if i==len(s)-1:
        print("No")
        sys.exit()
    if s[i]=="C":
        for j in range(i+1,len(s)):
            if s[j]=="F":
                print("Yes")
                sys.exit()
            if j==len(s)-1:
                print("No")
                sys.exit()

Solution (Python):
s = input()
result = "No"
for i in range(len(s)):
	if s[i] == "C":
		for j in range(i+1, len(s)):
			if s[j] == "F":
				result = "Yes"
		break
print(result)

Solution (Python):
import re
s = input()
pattern = re.compile(r'C.*F')
match = pattern.search(s)
if match:
	print('Yes')
else:
	print('No')

Solution (Python):
s = raw_input()
s_i = s.find("C")
if s_i == -1:
    print "No"
else:
    s_i2 = s.rfind("F")
    if s_i2 == -1:
        print "No"
    elif s_i > s_i2:
        print "No"
    else:
        print "Yes"

Solution (Python):
import re
s = input()
p = re.compile('C.*F')
if p.search(s) == None:
    print("No")
else:
    print("Yes")

Solution (Python):


a = raw_input()
flags = 0
flage = 0
for s in a:
	if s == 'C':
		flags = 1
	if flags == 1 and s == 'F':
		flage = 1

if flage == 1:
	print 'Yes'
else:
	print 'No'

Solution (Python):
s=input()
a=""
for i in range(len(s)):
    if s[i]=='C':
        a+="c"
    if s[i]=='F':
        a+="f"
if "cf" in a:
    print("Yes")
else:
    print("No")

Solution (Python):
s = input()
C = False
c_index = None
F = False
f_index = None

for i in range(len(s)):
    if s[i] == "C":
        C = True
        c_index = i
    if s[i] == "F":
        F = True
        f_index = i

if C == True and F == True:
    if c_index < f_index:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Solution (Python):
def solve():
    s = raw_input()
    if 'C' not in s:
        return False
    for i in range(s.index('C'), len(s)):
        if s[i] == 'F':
            return True
    return False

if __name__ == '__main__':
    print('Yes' if solve() else 'No')

Solution (Python):
s = list(str(input()))
ans = False
if 'C' in s:
    c_index = s.index('C')
    for i in range(len(s)):
        char = s[len(s) - i - 1]
        if char == 'F':
            f_index = len(s) - i - 1
            if c_index < f_index:
                ans = True
if ans:
    print('Yes')
else:
    print('No')

Solution (Python):
import sys
import re
s = sys.stdin.readline()
c_i = None
f_i = None
for i, c in enumerate(s):
    if c == 'C':
        c_i = i
        break
for i, c in reversed(list(enumerate(s))):
    if c == 'F':
        f_i = i
        break
if c_i is not None and f_i is not None and c_i < f_i:
    print('Yes')
else:
    print('No')

Solution (Python):
S = raw_input()
c = False
cf = False
for _ in S:
	if not c and _ == 'C':
		c = True
	if c and _ == 'F':
		cf = True
		break

print 'Yes' if cf else 'No'

Solution (Python):
s=raw_input()
print 'Yes' if 'C' in s and 'F' in s[s.index('C'):] else 'No'

Solution (Python):
s=raw_input()
f=0
for i in xrange(len(s)):
    if "C"==s[i] and f==0:
        f+=1
    if f==1 and "F"==s[i]:
        print("Yes")
        exit()
print("No")

Solution (Python):
S = raw_input()
count = 0
for s in S:
    if s == 'C' and count == 0:
        count += 1
    elif s == 'F' and count == 1:
        count += 1
        break

if count == 2:
    print 'Yes'
else:
    print 'No'

Solution (Python):
S = input()

c=False
f=False
ans=0
for s in S:
    if not c and s=="C":
        c=True
    if c and s=="F":
        f=True

if s and f:
    print("Yes")
else:
    print("No")

Solution (Python):

s = input()

ans_i = 0
ans_j = 0

for s_i in s:
    if s_i == 'C':
        ans_i = 1

    if ans_i == 1 and s_i == 'F':
        ans_j = 1

if ans_i and ans_j:
    print('Yes')
else:
    print('No')

Solution (Python):
import re

S = input()

if re.match(r'.*C.*F.*', S):
    print('Yes')
else:
    print('No')

Solution (Python):

s=raw_input()

c_index=s.find('C')
if c_index == -1:
    print "No"
    exit()

f_index=s.find('F', c_index)
if f_index == -1:
    print "No"
    exit()
print "Yes"

Solution (Python):
s = raw_input()
flag = 0
for i in s:
    if flag == 0 and i == 'C': flag = 1
    elif flag == 1 and i == 'F': flag = 2
    else: continue
print 'Yes' if flag == 2 else 'No'

Solution (Python):



from __future__ import division, print_function, absolute_import, unicode_literals
import sys

s = input()


start = s.find('C')
if start == -1:
    print("No")
    sys.exit()
start = s.find('F', start)
if start == -1:
    print("No")
else:
    print("Yes")

Solution (Python):
s = raw_input()

flag = 0
flag2 = 0

for i in s:
    if i == "C":
        flag += 1
    if flag > 0 and i == "F":
        flag2 += 1

if flag2 > 0:
    print "Yes"

else:
    print "No"

Solution (Python):
import sys
s=raw_input()
flag=False
for j in range(len(s)):
    if s[j]=='C':
        flag=True
    if s[j]=='F' and flag:
        print "Yes"
        sys.exit()
print "No"

Solution (Python):
import sys

if __name__ == '__main__':
    str = input()
    flg = 0
    for c in str:
        if c == 'C' or flg == 1:
            flg = 1
            if c == 'F':
                print('Yes')
                sys.exit(0)
    print("No")

Solution (Python):



def judge(s):
    rest = "".join(filter(lambda c: c in "CF", s))
    return "CF" in rest


def main():
    if judge(input()):
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()

Solution (Python):
N = input()

if "C" in N and "F" in N:
    c = N.find("C")
    f = N.rfind("F")
    if c < f:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Solution (Python):
s = raw_input()

try:
    c = s.index("C")
    f = len(s) - s[::-1].index("F") - 1
    if c < f:
        print "Yes"
    else:
        print "No"
except:
    print "No"

Solution (Python):
def read_input():
    return input()

def checker(inp_str):
    flag = 0
    for i in list(inp_str):
        if flag == 0:
            if i == "C":
                flag = 1
        if flag == 1:
            if i == "F":
                flag = 2

    if flag == 2:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    checker(read_input())

Solution (Python):

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys

def s():
    return raw_input().strip()
def n():
    return int(raw_input())
def d():
    return float(raw_input())

def ls():
    return raw_input().strip().split()
def ln():
    return map(int, raw_input().strip().split())
def ld():
    return map(float, raw_input().strip().split())

def fs():
    return [raw_input().strip() for i in xrange(input())]
def fn():
    return [int(raw_input().strip()) for i in xrange(input())]
def fd():
    return [float(raw_input().strip()) for i in xrange(input())]

S = s()

a = S.find('C')
b = S.find('F', a)

if a == -1 or b == -1:
    print 'No'
else:
    print 'Yes'

Solution (Python):
s = input()
flag = False
for i in range(len(s)):
    if s[i] == "C":
        if "F" in s[i+1:]:
            flag = True
            break
        else:
            break
if flag:
    print("Yes")
else:
    print("No")

Solution (Python):
def main():
    s = input()
    if 'C' in s and 'F' in s[s.index('C')+1:]:
        print('Yes')
    else:
        print('No')

main()

Solution (Python):
s=raw_input()
ls = list(s)
cflag=False
ansflag=False
for i in ls:
    if i=="C":
        cflag=True
    if i=="F" and cflag:
        ansflag=True
if ansflag:
    print "Yes"
else:
    print "No"

Solution (Python):
s = input()
if "C" in s and "F" in s[s.index("C"):]:
	print("Yes")
else:
	print("No")

Solution (Python):
S = raw_input()
c_flag = False
f_flag = False

for c in S:
    if c == 'C':
        c_flag = True
    elif c == 'F' and c_flag:
        f_flag = True
        break

if f_flag:
    print 'Yes'
else:
    print 'No'

Solution (Python):
s = raw_input()
flg1 = False
flg2 = False
for c in s:
    if not flg1:
        if c=="C":
            flg1 = True
    elif not flg2:
        if c=="F":
            flg2 = True

if flg2:
    print "Yes"
else:
    print "No"

Solution (Python):
c = 0
f = 0
for i in input():
    if i == 'C' : c = 1
    if c and i == 'F':
        f = 1
        break
print( 'Yes' if c + f > 1 else 'No')

Solution (Python):
s = input()
c = False
f= False
for ch in s:
    if ch == 'C':
        c=True
    if c and ch=='F':
        f =True
if f:
    print('Yes')
else:
    print('No')

Solution (Python):
s = input()
a = s.find("C")
b = s.rfind("F")
if 0 <= a < b:
    print("Yes")
else:
    print("No")

Solution (Python):
s = raw_input()
flag1, flag2 = False, False
for ch in s:
    if not flag1:
        if ch == 'C':
            flag1 = True
    else:
        if ch == 'F':
            flag2 = True
            break
if flag1 and flag2:
    print 'Yes'
else:
    print 'No'

Solution (Python):
S = input()
if "C" in S and "F" in S:
    C_ind = S.index("C")
    S_inv = S[::-1]
    S_ind = S_inv.find("F")
    S_ind = len(S) - S_ind - 1
    if C_ind < S_ind:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Solution (Python):
s = raw_input()
f = 0
for i in range(len(s)):
    if f == 0 and s[i] == 'C':
        f = 1
    if f== 1 and s[i] == 'F':
        f = 2
if f==2 :
    print "Yes"
else:
    print "No"

Solution (Python):
s=input()
C=False
F=False
for c in s:
    if c=="C":
        C=True
    if C and c=="F":
        F=True
if F:
    print ("Yes")
else:
    print("No")

Solution (Python):
import re

s = input()

pattern = r".*C.*F"
match = re.match(pattern, s)
if match:
    print('Yes')
else:
    print('No')

Solution (Python):
import re
s = raw_input()
if re.match('.*C.*F.*', s):
    print 'Yes'
else:
    print 'No'

Solution (Python):
s = input()
k1 = len(s) - 1
k2 = 0
for i in range(len(s)):
    if s[i] == 'C' and i < k1:
        k1 = i
    if s[i] == 'F':
        k2 = i
if k2 - k1 > 0:
    print("Yes")
else:
    print("No")

Solution (Python):
a = raw_input()
ans = False
flag = False
for c in a:
    if c == "F" and flag:
        ans = True
    if c == "C":
        flag = True
print "Yes" if ans else "No"

Solution (Python):
S = raw_input()
flag = False
for s in S:
    if s == 'C':
        flag = True
    if s == 'F' and flag:
        print 'Yes'
        break
else:
    print 'No'

Solution (Python):
s = input()

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

Solution (Python):
s = input()

f = False
ans = "No"
for c in s:
    if c=="C":
        f = True
    elif f and c=="F":
        ans = "Yes"
        break

print(ans)

Solution (Python):



def rl(s): return xrange(len(s))


INF = 2147483647


import sys
stdin = sys.stdin

s =        ( stdin.readline().strip() )

c = s.find('C')
if -1 != c:
    f = s[c:].find('F')
    if f != -1:
        print "Yes"
        s = None

if s is not None:
    print "No"

Solution (Python):
s = raw_input()
f1 = False
f2 = False
for i in s:
    if i == "C":
        f1 = True
    if f1:
        if i == "F":
            f2 = True
if f1 and f2:
    print "Yes"
else:
    print "No"

Solution (Python):
s = input()

c_exists = False
f_exists = False
for c in s:
    if c == 'C' and not c_exists:
        c_exists = True
    if c_exists and c == 'F' and not f_exists:
        f_exists = True

if c_exists and f_exists:
    print("Yes")
else:
    print("No")

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf = 10**10
mod = 10**9 + 7


def f():
    s = input()
    if re.match(r'.*C.*F.*', s):
        return 'Yes'
    return 'No'

print(f())

Solution (Python):



import re
s = input()
t = []
for ch in s:
    if ch == 'C' or ch == 'F':
        t.append(ch)
t = "".join(t)
if "CF" in t:
    print("Yes")
else:
    print("No")

Solution (Python):
import sys
a = raw_input()

c = False

for i in a:
    if(i=='C'):
        c = True
    if(c and i=='F'):
        print 'Yes'
        sys.exit()

print 'No'

Solution (Python):
import re
if re.search('C.*F', raw_input()):
    print 'Yes'
else:
    print 'No'

Solution (Python):
s = raw_input()
a = s.find('C')
if a != -1:
    b = s.find('F', a + 1)
    if b != -1:
        print "Yes"
    else:
        print "No"
else:
    print "No"

Solution (Python):
S = input()
c, f = S.find("C"), S.rfind("F")
print("Yes" if c != -1 and f != -1 and c < f else "No")

Solution (Python):
import re
print('Yes' if re.search('C.*F', input()) else 'No')

Solution (Python):







ans = 0
s = input()
for c in s:
	if ans == 0:
		if c == 'C':
			ans += 1
	else:
		if c == 'F':
			ans += 1
			break

if ans == 2:
	print("Yes")
else:
	print("No")

Solution (Python):
s = raw_input()
t = False
for i in s:
    if i == "C":
        t = True
    if i == "F" and t:
        print "Yes"
        exit()

print "No"

Solution (Python):
S = raw_input()
c = 0
f = 0
for s in S:
    if s == "C":
        c = 1
    if s == "F" and c:
        f = 1
print "Yes" if f else "No"

Solution (Python):
S = input()

NEED = "CF"
for c in S:
    if len(NEED) > 0 and NEED[0] == c:
        NEED = NEED[1:]

if NEED == "":
    print("Yes")
else:
    print("No")

Solution (Python):

import sys,copy,math,heapq,itertools as it,fractions,re,bisect,collections as coll

s = raw_input()
c, f = 1e10, -1
for i, si in enumerate(s):
    if si == "C":
        c = min(c, i)
    if si == "F":
        f = max(f, i)
print "Yes" if c < f else "No"

Solution (Python):


s = raw_input()
if s.find('C') == -1:
    print 'No'
else:
    if s[s.find('C'):].find('F') == -1:
        print 'No'
    else:
        print 'Yes'

Solution (Python):
s = input()
i = ['C','F']
ind = 0
for c in s:
    if i[ind] == c:
        ind += 1
    if ind == 2:
        break
print("Yes") if ind == 2 else print("No")

Solution (Python):
import re

s = raw_input()
if re.search(r'.*C.*F.*', s):
    print 'Yes'
else:
    print 'No'