Problem:


Score : 500 points

Problem Statement

There is a string s of length 3 or greater.
No two neighboring characters in s are equal.

Takahashi and Aoki will play a game against each other.
The two players alternately performs the following operation, Takahashi going first:

Remove one of the characters in s, excluding both ends. However, a character cannot be removed if removal of the character would result in two neighboring equal characters in s.

The player who becomes unable to perform the operation, loses the game. Determine which player will win when the two play optimally.

Constraints

3 ≤ |s| ≤ 10^5

s consists of lowercase English letters.

No two neighboring characters in s are equal.

Input

The input is given from Standard Input in the following format:

s

Output

If Takahashi will win, print First. If Aoki will win, print Second.

Sample Input 1

aba

Sample Output 1

Second

Takahashi, who goes first, cannot perform the operation, since removal of the b, which is the only character not at either ends of s, would result in s becoming aa, with two as neighboring.

Sample Input 2

abc

Sample Output 2

First

When Takahashi removes b from s, it becomes ac.
Then, Aoki cannot perform the operation, since there is no character in s, excluding both ends.

Sample Input 3

abcab

Sample Output 3

First



Sample input:
aba


Sample output:
Second

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
INF = float("inf")


def solve(s: str):
    N = len(s)
    if (s[0] == s[-1]) ^ (N % 2 == 0):
        print("Second")
    else:
        print("First")

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    s = next(tokens)  # type: str
    solve(s)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()
print("First" if (len(S) & 1) ^ (S[0] == S[-1]) else "Second")

Submission status: Accepted

Solution code:
# 文字が2種類になるまで減る
# 2種類になったら終了
# 両端の文字が違うならその2種類が残る→偶数個残る
# 両端の文字が同じならその文字+1種→奇数個残る

s = input()
iseven = len(s)&1==0
issame = s[0]==s[-1]
print('Second' if iseven^issame else 'First')

Submission status: Accepted

Solution code:
s=raw_input()
print"First"if len(s)%2^int(s[0]==s[-1])else"Second"

Submission status: Accepted

Solution code:
s=input()
print('Second'if(len(s)%2==0)!=(s[0]==s[-1])else'First')

Submission status: Accepted

Solution code:
s = input().strip()
l = len(s)
if s[0] == s[-1]:
    ans = "Second" if l % 2 == 1 else "First"
else:
    ans = "First" if l % 2 == 1 else "Second"
print(ans)

Submission status: Accepted

Solution code:
#降参、editorial参照
s = input()
if (s[0]==s[-1])^(len(s)%2):
    print("First")
else:
    print("Second")

Submission status: Accepted

Solution code:
s = input()
if len(s)%2==0 and s[0] != s[-1]:
    print('Second')
elif len(s)%2==1 and s[0] == s[-1]:
    print('Second')
else:
    print('First')

Submission status: Accepted

Solution code:
# import numpy as np
# import math
import sys
input = sys.stdin.readline().rstrip


def main():
    s = list(input())
    N = len(s)

    if (N % 2 == 0) ^ (s[0] == s[-1]):
        print('Second')
    else:
        print('First')


main()

Submission status: Accepted

Solution code:
s = input()
l = len(s)
if (s[0]==s[-1]) ^ l%2:
  print("First")
else:
  print("Second")

Submission status: Accepted

Solution code:
s = list(input())
if (len(s)%2==0)^(s[0]==s[-1]):
    print('Second')
else:
    print('First')

Submission status: Accepted

Solution code:
a = list(input())
if a[0] == a[-1]:
    if len(a) % 2 == 1:
        print('Second')
    else:
        print('First')
else:
    if len(a) % 2 == 1: 
        print('First')
    else:
        print('Second')

Submission status: Accepted

Solution code:
s = input()
if s[0] == s[-1]:
    if len(s) % 2 == 0:
        print('First')
    else:
        print('Second')
else:
    if len(s) % 2 == 0:
        print('Second')
    else:
        print('First')

Submission status: Accepted

Solution code:
import sys

s = sys.stdin.readline().rstrip()

def main():
    l = len(s)
    if (l & 1) ^ (s[0] == s[-1]):
        return 'First'
    return 'Second'
    
if __name__ == '__main__':
    ans = main()
    print(ans)

Submission status: Accepted

Solution code:
s = input()
print('Second' if (s[0] == s[-1]) == (len(s) % 2) else 'First')

# 最後の操作後の形
# 頭と尾が同じ->奇数
# 違う->偶数

# sの文字数と最後の操作後の形の偶奇
# 一致->先手負け
# 不一致->後手負け

Submission status: Accepted

Solution code:
s=input()
print("SFeicrosntd"[((len(s)%2)^(s[0]==s[-1]))::2])

Submission status: Accepted

Solution code:
def main():
    s = input()
    l = len(s)
    if (l % 2 == 0 and s[0] == s[-1]) or ((l % 2 == 1 and s[0] != s[-1])):
        print("First")
    else:
        print("Second")


main()

Submission status: Accepted

Solution code:
# 入力値
s = input()

if (len(s)%2==0) ^ (s[0]==s[len(s)-1]):
    print("Second")
else:
    print("First")

Submission status: Accepted

Solution code:
s=input()
n=len(s)
a,b=0,0
if s[0]==s[-1]:
    a=1
if n%2==1:
    b=1
if a==b:
    print("Second")
else:
    print("First")

Submission status: Accepted

Solution code:
S = input()
if len(S) % 2 ^ (S[0] == S[-1]):
    print("First")
else:
    print("Second")

Submission status: Accepted

Solution code:
s = list(input())

c = -1
i = 1
while i < len(s)-1 and len(s) > 2:
    if s[i-1] != s[i+1]:
        s.pop(i)
        i = 1
        c *= (-1)
    else:
        i += 1
        
if c > 0:
    print("First")
else:
    print("Second")

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
    S=input()
    print("First" if((len(S)&1)^(S[0]==S[-1])) else "Second")
resolve()

Submission status: Accepted

Solution code:
s=input()
if(len(s)%2==0):
    if(s[0]==s[-1]):
        print('First')
    else:
        print('Second')
else:
    if(s[0]==s[-1]):
        print('Second')
    else:
        print('First')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
S = list(input())[: -1]
if ((S[0] == S[-1]) + len(S) % 2) % 2: print("First")
else: print("Second")

Submission status: Accepted

Solution code:
s = input()
print("First" if len(s)%2^(s[0]==s[-1]) else "Second")

Submission status: Accepted

Solution code:
import sys
from heapq import heapify, heappop, heappush
MAX_INT = int(10e15)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

s = S()
N = len(s)

if s[0] == s[-1]: #odd
  if N%2 != 0:
    print("Second")
  else:
    print("First")
else:
  if N%2 == 0:
    print("Second")
  else:
    print("First")

Submission status: Accepted

Solution code:
def solve():
    S = input()

    p = 1

    even = False
    if len(S) % 2 == 0:
        even = True

    if S[0] == S[-1]:  # ababa 奇数で終わる
        if even:
            return -p
        else:
            return p
    else:              # abab 偶数で終わる
        if even:
            return p
        else:
            return -p


if __name__ == '__main__':
    res = solve()
    if res < 0:
        print("First")
    else:
        print("Second")

Submission status: Accepted

Solution code:
s=input()
f1=f2=0
if(len(s)%2==0):
    f1=1
if(s[0]==s[len(s)-1]):
    f2=1
    
if((f1==1 and f2==0) or (f1==0 and f2==1)):
    print('Second')
else:
    print('First')

Submission status: Accepted

Solution code:
s=input()
f1=f2=0
if(len(s)%2==0):
    f1=1
if(s[0]==s[len(s)-1]):
    f2=1
    
if((f1==1 and f2==0) or (f1==0 and f2==1)):
    print('Second')
else:
    print('First')

Submission status: Accepted

Solution code:
# python3 (3.4.3)
import sys
input = sys.stdin.readline

# main
S = input().rstrip()

if S[0]==S[-1]:
    print("Second" if len(S)%2==1 else "First")
else:
    print("First" if len(S)%2==1 else "Second")

Submission status: Accepted

Solution code:
def examD():
    St = S()
    N = len(St)
    ans = "Second"
    if St[0]==St[-1]:
        if N%2==0:
            ans = "First"
    else:
        if N%2==1:
            ans = "First"
    print(ans)

import sys
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examD()

Submission status: Accepted

Solution code:
S = input()

if (len(S)%2 == 0 and S[0] == S[-1]) or (len(S)%2 == 1 and S[0] != S[-1]):
    print('First')
else:
    print('Second')

Submission status: Accepted

Solution code:
s = list(input())
f = 1 
h = {-1:"First", 1:"Second"}
r = True
while r:
        p = 0 
        r = False 
        for i in s:
                if p+2 < len(s):
                        if s[p] != s[p+2]:
                                del s[p+1]
                                r = True
                                f = -f
                        else:
                                p += 1
print(h[f])

Submission status: Accepted

Solution code:

s = input()

a = 0
b = 0

for i in s:

    if i == s[0] or i == s[-1]:
        a += 1
    else:
        b += 1

if s[0] == s[-1]:
    a -= 1
else:
    a -= 2


if a % 2 == 0:

    if b % 2 == 1:
        print ("First")
    else:
        print ("Second")

else:

    if b % 2 == 1:
        print ("Second")
    else:
        print ("First")

Submission status: Accepted

Solution code:
s = input()

x = len(s)%2
if s[0] == s[-1]:
  y = 1
else:
  y = 0

z = (x+y)%2

if z == 0:
  print("Second")
else:
  print("First")

Submission status: Accepted

Solution code:
s=input()

if (len(s)%2==0 and s[0]!=s[-1]) or (len(s)%2!=0 and s[0]==s[-1]):
  print('Second')
else: 
  print('First')

Submission status: Accepted

Solution code:
s = input().strip()
n = len(s)
if s[0]==s[-1]:
    if n%2==0:
        print("First")
    else:
        print("Second")
else:
    if n%2==0:
        print("Second")
    else:
        print("First")

Submission status: Accepted

Solution code:

def solve(s):
    return 'First' if (len(s)+(s[0]==s[-1]))%2==1 else 'Second'



if __name__ == '__main__':
    print(solve(input()))

Submission status: Accepted

Solution code:
s = input()


if s[0] == s[-1]:
    if len(s) % 2 == 0:
        print('First')
    else:
        print('Second')
else:
    if len(s) % 2 == 0:
        print('Second')
    else:
        print('First')

Submission status: Accepted

Solution code:
s=input()
if s[0]==s[-1]:
    opt=len(s)-3 
    if opt&1: 
        print('First')
    else:
        print('Second')
else: 
    opt=len(s)-2 
    if opt&1:
        print('First')
    else:
        print('Second')

Submission status: Accepted

Solution code:
s = input()
print("Second") if((s[0] == s[-1]) != (len(s)%2 == 0)) else print("First")

Submission status: Accepted

Solution code:
s=input()
turn=0
n=len(s)
if n%2==0:
    a=1
else:
    a=0
if s[0]==s[-1]:
    b=1
else:
    b=0
if a^b==1:
    print("Second")
else:
    print("First")

Submission status: Accepted

Solution code:
S = input()

if (len(S) % 2 == 0) ^ (S[0] == S[-1]):
    print("Second")
else:
    print("First")

Submission status: Accepted

Solution code:
s=input()
n=len(s)
if s[0]==s[-1]:
  n+=1
if n%2:
  print('First')
else:
  print('Second')

Submission status: Accepted

Solution code:
s = input()
if s[0] == s[-1]:
  if len(s) % 2 == 0:
    print("First")
  else:
    print("Second")
else:
  if len(s) % 2 == 0:
    print("Second")
  else:
    print("First")

Submission status: Accepted

Solution code:
s = input()
N = len(s)

if (s[0] == s[-1]) ^ (N % 2 == 1):
  print("First")
else:
  print("Second")

Submission status: Accepted

Solution code:
s = input()
print("First" if (len(s) % 2 == 0 and s[0] == s[-1]) or (len(s) % 2 != 0 and s[0] != s[-1]) else "Second")

Submission status: Accepted

Solution code:
import collections

def main():
    s = list(str(input()))
    l = collections.Counter(s)
    if len(l) == 2:
        print("Second")
    else:
        if s[0] == s[-1]:
            if len(s)%2 == 0:
                print("First")
            else:
                print("Second")
        else:
            if len(s)%2 == 0:
                print("Second")
            else:
                print("First")

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
s = list(input())
str_count = 0
if s[0] == s[-1]:
    if len(s) % 2 == 0:
        print("First")
    else:
        print("Second")
else:
    if len(s) % 2 == 0:
        print("Second")
    else:
        print("First")

Submission status: Accepted

Solution code:
s = input()
ANS = ["First", "Second"]

print(ANS[(s[0]==s[-1]) ^ (len(s)%2==0)])

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
#ABC48 D

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

s = input()
n = len(s)
if s[0] == s[-1]:
    if n % 2:
        print('Second')
    else:
        print('First')
else:
    if n % 2:
        print('First')
    else:
        print('Second')

Submission status: Accepted

Solution code:
S = list(input())

flag1 = (len(S) % 2 == 0)
flag2 = (S[0] == S[-1])

judge = flag1 ^ flag2
#print(flag1, flag2, judge)

if judge:
    print("Second")
else:
    print('First')

Submission status: Accepted

Solution code:
s = input()
n = len(s)

if s[0]==s[-1]:
  if n&1: print("Second")
  else: print("First")
else:
  if n&1: print("First")
  else: print("Second")

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations
import sys
import string
from bisect import bisect_left


INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LIM(): return list(map(lambda x:int(x) - 1, sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def LIRM(n): return [LIM() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
mod = 1000000007


s = S()
if s[0] == s[-1]:
    if len(s) % 2:
        print('Second')
    else:
        print('First')
else:
    if len(s) % 2:
        print('First')
    else:
        print('Second')

Submission status: Accepted

Solution code:
s = input()

def xor(a, b):
  if a == b:
    return False
  else:
    return True
    
if len(s) % 2 == 0:
  even_string = 1
else:
  even_string = 0
  
if s[0] == s[len(s) - 1]:
  same_char = 1
else:
  same_char = 0
  
if xor(even_string, same_char):
  print("Second")
else:
  print("First")

Submission status: Accepted

Solution code:
s=list(input())
x=len(s)%2
y=0
if s[0]==s[-1]:
  y=1
if (x+y)%2==0:
  print('Second')
else:
  print('First')

Submission status: Accepted

Solution code:
s=input()
a,b=s[0],s[-1]
n=len(s)
if a==b:
  print("First" if n%2==0 else "Second")
else:
  print("First" if n%2==1 else "Second")

Submission status: Accepted

Solution code:
from collections import Counter

s = input()

ans = ['Second', 'First']
c = Counter(s)
flag = 0 if len(c) == 2 else 1
same = 1 if s[0] == s[-1] else 0
print(ans[((len(s) + same) % 2) * flag])

Submission status: Accepted

Solution code:

S = input()
L = len(S)%2==1
if S[0] != S[-1]:
  print("Second" if not L else "First")
else:
  print("Second" if L else "First")

Submission status: Accepted

Solution code:
s=input()

first_c=s[0]
last_c=s[-1]

if first_c==last_c:
  if len(s)%2==0:
    print('First')
  else:
    print('Second')
else:
  if len(s)%2==0:
    print('Second')
  else:
    print('First')

Submission status: Accepted

Solution code:
s=input()
n=len(s)
if (s[0]==s[-1]) ^ (n%2==0):
  print('Second')
else:
  print('First')

Submission status: Accepted

Solution code:
s=input()
n=len(s)
moji1=s[0]
moji2=s[1]
count=0
flag=False
for i in range(n-2):
  if (i+count)%2==0:
    if s[i+2]!=moji1:
      count+=1
      if i+2==n-1:
        flag=True
  else:
    if s[i+2]!=moji2:
      count+=1
      if i+2==n-1:
        flag=True
  if count==2:
    break
if count==0:
  print('Second')
  exit()
if count==1:
  if flag:
    if (n-2)%2==0:
      print('Second')
    else:
      print('First')
  else:
    print('First')
  exit()
if s[0]==s[-1]:
  if (n-3)%2==0:
    print('Second')
  else:
    print('First')
else:
  if (n-2)%2==0:
    print('Second')
  else:
    print('First')

Submission status: Accepted

Solution code:
s = input()
if (len(s)%2 != 0) ^ (s[0] == s[-1]):
  print("First")
else:
  print("Second")

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8

def ri():
    return int(input())

def rl():
    return list(input().split())

def rli():
    return list(map(int, input().split()))

ans = ["First", "Second"]

def main():
    s = input()
    if s[0] == s[-1]:
        print(ans[len(s)%2])
    else:
        print(ans[1-len(s)%2])


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()
if (len(s)%2 != 0) ^ (s[0] == s[-1]):
  print("First")
else:
  print("Second")

Submission status: Accepted

Solution code:
s = str(input())

#first 0
#second 1

state = 0

def remove(s):
    if len(s) == 2:
        return s
    else:
        for i in range(1,len(s)-1):
            if s[i-1] != s[i+1]:
                s_new = s[:i]+s[i+1:]
                break
        else:
            s_new = s
        return s_new

while True:
    #print(s,remove(s))
    state = (state+1)%2
    if s == remove(s):
        break
    else:
        s = remove(s)

if state ==0:
    print("First")
else:
    print("Second")

Submission status: Accepted

Solution code:
a = input()
t = len(a)-2
if a[0]==a[-1]:
    if t%2==0:
        print('First')
    else:
        print('Second')
else:
    if t%2==0:
        print('Second')
    else:
        print('First')

Submission status: Accepted

Solution code:
s = input()

n = len(s)
even = (n%2 == 0)
same = (s[0] == s[-1])
if (even and not same) or (not even and same):
    print("Second")
else:
    print("First")

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

import sys
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline #文字列入力のときは注意

#n = int(input())
s = input()
a = s[0] == s[-1]
b = len(s)%2==0
#print(a,b)

if a == b:
    print("First")
else:
    print("Second")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
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 = float('INF')

#A
def A():
    s = LS()
    print(s[0][0]+s[1][0]+s[2][0])
    return

#B
def B():
    a, b, x = LI()
    print(b // x - (a - 1) // x)
    
    return

#C
def C():
    n, x = LI()
    a = LI()
    ans = 0
    for i in range(n-1):
        if a[i] + a[i + 1] > x:
            if x > a[i]:
                ans += a[i] + a[i + 1] - x
                a[i + 1] = x - a[i]
            else:
                ans += a[i] + a[i + 1] - x
                a[i + 1] = 0
    print(ans)
    return

#D
def D():
    s = S()
    ans = ["First", "Second"]
    if s[-1] == s[0]:
        print(ans[len(s) % 2])
    else:
        print(ans[len(s) % 2 - 1])
    return


#Solve
if __name__ == '__main__':
    D()

Submission status: Accepted

Solution code:
S = input()

nl = len(S)
if S[0]==S[-1]:
    nl -= 1
if nl%2 == 0:
    print("Second")
else:
    print("First")

Submission status: Accepted

Solution code:
s=input()
print('SFeicrosntd'[len(s)%2==(s[0]!=s[-1])::2])

Submission status: Accepted

Solution code:
s = input()
if s[0] != s[-1]:
  print("First" if len(s) % 2 else "Second")
else:
  print("Second" if len(s) % 2 else "First")

Submission status: Accepted

Solution code:
from collections import defaultdict

s = input()

def judge() :
    d = defaultdict(int)
    for s_ in s :
        d[s_] += 1
    
    if len(d) == 3 :
        one = []
        for k, v in d.items() :
            if v == 1 :
                one.append(k)
        
        if len(one) == 1 :
            for i in range(1, len(s) - 1) :
                if s[i] == one[0] :
                    if s[i-1] != s[i+1] :
                        return 'First'
                    else :
                        return 'Second'

    if (len(s) + (1 if s[0] == s[-1] else 0)) % 2 == 1 :
        return 'First'
    else :
        return 'Second'
       
print(judge())

Submission status: Accepted

Solution code:
s = raw_input()
if len(s) % 2 == 1:
    if s[0] == s[-1]:
        print "Second"
    else:
        print "First"
else:
    if s[0] == s[-1]:
        print "First"
    else:
        print "Second"

Submission status: Accepted

Solution code:
import bisect
import heapq
import itertools
import math
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18

S = sys.stdin.readline().rstrip()
if S[0] == S[-1]:
    if len(S) % 2 == 0:
        print('First')
    else:
        print('Second')
else:
    if len(S) % 2 == 1:
        print('First')
    else:
        print('Second')

Submission status: Accepted

Solution code:
s=input()
if len(s)%2==0^(s[0]==s[-1]):
    print('Second')
else:
    print('First')

Submission status: Accepted

Solution code:
s = list(input())
cnt = 0
while(1):
    tmp = 0
    for i in range(1,len(s)-1):
        if s[i-1] != s[i+1]:
            cnt += 1
            tmp = 1
            s.pop(i)
            break
    if tmp == 0:
        break

if cnt % 2 == 0:
    print("Second")
else:
    print("First")

Submission status: Accepted

Solution code:
s = input()

if len(s) % 2 == 0: # 偶数
    if s[0] == s[-1]: # 奇数
        print("First")
    else: # 偶数
        print("Second")
else: # 奇数
    if s[0] == s[-1]: # 奇数 
        print("Second")
    else: # 偶数
        print("First")

Submission status: Accepted

Solution code:
S=input()
N=len(S)
if S[0]==S[N-1]:
    a=S[0]
    count=0
    for i in range(N):
        if S[i]==a:
            count+=1
    num=N-(count*2-1)
elif N%2==1:
    f=True
    i=0
    a=S[0]
    while(i<N):
        if S[i]!=a:
            f=False
            break
        i+=2
    if f:
        num=0
    else:
        num=N-2
else:
    s=S[0]+S[-1]
    if S==s*(N//2):
        num=0
    else:
        num=N-2
if num%2==1:
    print("First")
else:
    print("Second")

Submission status: Accepted

Solution code:
s=input().rstrip()
x=list(s)
A=0;
while(1):
    G=0;
    for i in range(1,len(x)-1):
        if x[i-1]!=x[i+1]:
            del(x[i])
            A+=1;
            G=1;
            break;
    if G==0:
        break;
if A%2==0:
    print("Second")
else:
    print("First")

Submission status: Accepted

Solution code:
s = list(input())
N = len(s)

if s[0] == s[N-1]:
    flag1 = True
else:
    flag1 = False
if N%2 == 0:
    flag2 = True
else:
    flag2 = False

if (flag1 != flag2):
    print ('Second')
else:
    print ('First')

Submission status: Accepted

Solution code:
import sys
import numpy as np


def main():
    s = input()
    n = len(s)
    if (s[0] == s[n - 1] and n % 2 == 1) or (s[0] != s[n - 1] and n % 2 == 0):
        print("Second")
    else:
        print("First")


main()

Submission status: Accepted

Solution code:
s=input()
n=len(s)%2==0
a=s[0]==s[-1]
print('Second' if a^n else 'First')

Submission status: Accepted

Solution code:
def solve(s):
    return "First" if (len(s) % 2 == 1) ^ (s[0] == s[-1]) else "Second"
s = input()
print(solve(s))

Submission status: Accepted

Solution code:
s = input()
N = len(s)
f, l = (s[0], s[N-1])
if f == l:
    if N%2 == 0:
        print("First")
    else:
        print("Second")
else:
    if N%2 == 0:
        print("Second")
    else:
        print("First")

Submission status: Accepted

Solution code:
s = input()
a, b = (s[0], s[1])
N = len(s)
l = s[N-1]
for c in s:
    if c not in (a, b):
        if a == l:
            if N%2 == 0:
                print("First")
            else:
                print("Second")
        else:
            if N%2 == 0:
                print("Second")
            else:
                print("First")
        break
else:
    print("Second")

Submission status: Accepted

Solution code:
s=input()
print('First' if (s[0]==s[-1])^(len(s)%2) else 'Second')

Submission status: Accepted

Solution code:
# 終了状態は2種の数からなる、長さが偶数
# 長さ偶数で手番を迎え続ける側が厳しい
# 両端が異なるなら奇数側が生存確定
# 両端が同一なら偶数側が生存確定

S = input()
L = len(S)
x,y = S[0],S[-1]

odd = L&1
same = (x == y)

first = odd ^ same

answer = 'First' if first else 'Second'

print(answer)

Submission status: Accepted

Solution code:
s = input()
if (s[0] == s[-1]) ^ (len(s) % 2 == 1):
    print('First')
else:
    print('Second')

Submission status: Accepted

Solution code:
s = input()
if s[0] == s[-1]:
    if len(s)%2==0:
        print("First")
    else:
        print("Second")
else:
    if len(s)%2 == 0:
        print("Second")
    else:
        print("First")

Submission status: Accepted

Solution code:
s=input()
if (len(s)+(s[0]==s[-1]))%2:
    print("First")
else:
    print("Second")

Submission status: Accepted

Solution code:

def read_input():
    s = input()
    return s


def submit():
    s = read_input()

    n = len(s)
    l = s[0]
    r = s[-1]

    if l == r:
        if n % 2 == 1:
            print('Second')
        else:
            print('First')
    else:
        if n % 2 == 1:
            print('First')
        else:
            print('Second')


if __name__ == '__main__':
    submit()

Submission status: Accepted

Solution code:
s = raw_input()

if s[0] != s[-1]:
	if len(s) % 2 == 0: print "Second"
	else: print "First"
else:
	if len(s) % 2 == 0: print "First"
	else: print "Second"

Submission status: Accepted

Solution code:
s=input()
L=len(s)

if L%2==0:
    if s[0]==s[L-1]:
        print('First')
    else:
        print('Second')
    
else:
    if s[0]==s[L-1]:
        print('Second')
    else:
        print('First')

Submission status: Accepted

Solution code:
s = input().rstrip()
if (len(s) % 2) ^ (s[0] != s[-1]):
    print("Second")
else:
    print("First")

Submission status: Accepted

Solution code:
s=input()
if(s[0]==s[len(s)-1]):
    if(len(s) & 1):
        print('Second')
    else:
        print('First')
else:
    if(len(s) & 1):
        print('First')
    else:
        print('Second')

Submission status: Accepted

Solution code:
import sys

def check(S):
    even = set()
    odd = set()
    for i in range(len(S)):
        if i % 2 == 0:
            odd.add(S[i])
        else:
            even.add(S[i])

    return len(even) == len(odd) == 1


def can_checkmate(S):
    chrs = set(S)
    if len(chrs) != 3:
        return False

    for c in chrs:
        S_ = S
        S_.remove(c)
        if check(S_):
            return True

    return False


def main():
    input = sys.stdin.readline
    S = [c for c in input().strip()]

    if check(S):
        return 'Second'

    if S[0] == S[-1]:
        if len(S) % 2 == 0 or can_checkmate(S):
            return 'First'

        else:
            return 'Second'
    else:
        if len(S) % 2 == 1:
            return 'First'

        else:
            return 'Second'


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

Submission status: Accepted

Solution code:
def main():
    s = input()
    if s[0] == s[-1]:
        if len(s) % 2 == 0:
            print("First")
        else:
            print("Second")
    else:
        if len(s) % 2 == 0:
            print("Second")
        else:
            print("First")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
s = input()
print('Second' if (s[0] == s[-1]) != (len(s) % 2 == 0) else 'First')

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

s = input()

if s[0] == s[-1]:
	if len(s)%2 == 0:
		print("First")
	else:
		print("Second")
else:
	if len(s)%2 == 0:
		print("Second")
	else:
		print("First")

Submission status: Accepted

Solution code:
def an_ordinary_game(s: str) -> str:
    return 'First' if (len(s) % 2) ^ (s[0] == s[-1]) else 'Second'


if __name__ == "__main__":
    s = input()
    ans = an_ordinary_game(s)
    print(ans)

Submission status: Accepted

Solution code:
s = input()
ls = len(s)
if s[0] == s[-1]:
    if ls % 2 == 0:
        ans = 'First'
    else:
        ans = 'Second'
else:
    if ls % 2 == 0:
        ans = 'Second'
    else:
        ans = 'First'
print(ans)

Submission status: Accepted

Solution code:
s=input();print('SFeicrosntd'[len(s.rstrip(s[0]))%2::2])

Submission status: Accepted

Solution code:
from functools import reduce

def main():
    # 切り捨て
    # 4 // 3
    # 切り上げ
    #-(-4 // 3)
    
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10
    
    # 1文字のみを読み込み
    # 入力:2
    # a = input().rstrip()
    # 変数:a='2'
    
    # スペース区切りで標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a, b, c, d = (int(_) for _ in input().split())  
    # 変数:a=2 b=4 c=5 d =7
    
    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2 4 5 7
    # a = list(int(_) for _ in input().split())
    # 変数:a = [2, 4, 5, 7]    

    # 1文字ずつ標準入力を配列として読み込み
    # 入力:2457
    # a = list(int(_) for _ in input())
    # 変数:a = [2, 4, 5, 7]    
    s = list(_ for _ in input())

    if(s[0] == s[-1]):
        if(len(s) % 2 == 0):
            print('First')
        else:
            print('Second')
    else:
        if(len(s) % 2 == 0):
            print('Second')
        else:
            print('First')
            
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s=input()
if (s[0]==s[-1]) == (len(s)%2==0):
  print("First")
else:
  print("Second")