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: Wrong Answer

Solution code:
s=input()
D={}
for i in s:
  if i not in D:
    D[i]=1
  else:
    D[i]+=1
a=0
for i in D:
  a+=D[i]-1
if (a+len(s))%2==0:
  print('Second')
else:
  print('First')

Submission status: Wrong Answer

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


s = input()
n = len(s)
c = s[0]
if len(set(s))>=3:
    val = n-2
elif len(set(s))==1:
    val = 0
else:
    val = 0
    for i in range(1,n-1):
        if s[i-1]!=s[i+1]:
            val += 1
if val%2==1:
    ans = "First"
else:
    ans = "Second"
print(ans)

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline

s = str(input().strip())

n = len(s)

if s[0] is s[n-1]:
    move = 1
else:
    move = 0

move = (n - move) % 2

if move == 1:
    print('First')
else:
    print('Second')

Submission status: Wrong Answer

Solution code:
import sys
# input = sys.stdin.readline
s = str(input())
n = len(s)
if s[0] is s[n - 1]:
	move = 1
else:
	move = 0
move = (n - move) % 2
if move == 1:
	print('First')
else:
	print('Second')

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
s = str(input().strip())
n = len(s)
if s[0] is s[n - 1]:
	move = 1
else:
	move = 0
move = (n - move) % 2
if move == 1:
	print('First')
else:
	print('Second')

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
s = str(input().strip())
n = len(s)
if s[0] is s[n - 1]:
	move = 1
else:
	move = 0
move = (n - move) % 2
if move is 1:
	print('First')
else:
	print('Second')

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
s = str(input().split('\n')[0])
n = len(s)
if s[0] is s[n - 1]:
	move = 1
else:
	move = 0
move = (n - move) % 2
if move is 1:
	print('First')
else:
	print('Second')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=list(input())
n=len(s)
if n%2==0:
  print('Second')
else:
  for i in range(n-2):
    if s[i]!=s[i+2]:
      print('First')
      exit()
  for i in range(1,n-2):
    if s[i]!=s[i+2]:
      print('First')
      exit()
  print('Second')

Submission status: Wrong Answer

Solution code:
import sys
def input():
	return sys.stdin.readline().strip()

s = input()

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

Submission status: Wrong Answer

Solution code:
s = input()
l = [[] for k in range(26)]
for k in range(len(s)):
    l[ord(s[k])-97].append(k)
m = 0
t = 0
def keisan(l):
    ret = 0
    for k in range(1,len(l)):
        ret += l[k]-l[k-1]-1
    return ret

for e in l:
    m = max(len(e),m)
    if len(e) >= 2:
        t += keisan(e)
if m == 1:
    if len(s)%2 == 1:
        print("First")
    else:
        print("Second")
else:
    if t%2 == 0:
        print("First")
    else:
        print("Second")

Submission status: Wrong Answer

Solution code:
s = input()
l = [[] for k in range(26)]
for k in range(len(s)):
    l[ord(s[k])-97].append(k)
m = 0
t = 0
for e in l:
    m = max(len(e),m)
    if len(e) >= 2:
        t += e[-1]-e[0]-1
if m == 1:
    if len(s)%2 == 1:
        print("First")
    else:
        print("Second")
else:
    if t%2 == 0:
        print("First")
    else:
        print("Second")

Submission status: Wrong Answer

Solution code:
s = list(input())
s1 = list(set(s))
if len(s1) == 2:
    print("Second")
elif len(s1) > 3:
    if len(s) % 2 == 0:
        print("Second")
    else:
        print("First")
else:
    p = s.count(s1[0])
    q = s.count(s1[1])
    r = s.count(s1[2])
    if len(s) == 3:
        print("First")
    else:
        if min([p,q,r]) > 1:
            if len(s) % 2 == 0:
                print("Second")
            else:
                print("First")
        elif len(s) == 4:
            if s[0] == s[3]:
                print("First")
            else:
                print("Second")
        elif len(s) % 2 == 1:
            print("First")
        elif p == 1:
            if s[0] == s1[0] or s[len(s)-1] == s1[0]:
                print("Second")
            else:
                ("First")
        elif q == 1:
            if s[0] == s1[1] or s[len(s)-1] == s1[1]:
                print("Second")
            else:
                print("First")
        elif r == 1:
            if s[0] == s1[2] or s[len(s)-1] == s1[2]:
                print("Second")
            else:
                print("First")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import Counter
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

S = input()[:-1]

C = Counter(S)
if S[0] == S[-1]:
    n = len(S)-C[S[0]]-min([C[c] for c in S if c != S[0]])
    if n % 2 == 1:
        ans = "First"
    else:
        ans = "Second"
else:
    n = len(S)-C[S[0]]-C[S[-1]]
    if n % 2 == 1:
        ans = "First"
    else:
        ans = "Second"
print(ans)

Submission status: Wrong Answer

Solution code:
S=input()
N=len(S)
head=S[0]
foot=S[-1]
if head==foot:
    lose="1"
else:lose="0"
first=N%2
print(["First","Second"][lose==first])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=input()
a=0
b=0
if len(n)%2==1:
    for i in range(2,len(n),2):
        if n[i]!=n[0]:
            print("First")
            break
    else:
        for j in range(1,len(n),2):
            if n[j]!=n[1]:
                print("First")
                break
        else:
            print("Second")
else:
    for i in range(2,len(n),2):
        if n[i]!=n[0]:
            print("Second")
            break
    else:
        for j in range(1,len(n),2):
            if n[j]!=n[-1]:
                print("Second")
                break
        else:
            print("First")

Submission status: Wrong Answer

Solution code:
import sys
S=input()
N=len(S)
if N%2!=0:
    if S[0]==S[2]:
        print('Second')
    else:
        print("First")
else:
    if S[0]==S[2]:
        print('First')
    else:
        print('Second')

Submission status: Wrong Answer

Solution code:
import sys
S=input()
N=len(S)
if N%2==0:
    print("Second")
    sys.exit()
if N==3 and S[0]==S[2]:
    print('Second')
    sys.exit()
print('First')

Submission status: Wrong Answer

Solution code:
import sys
S=input()
N=len(S)
if N%2==0:
    print("Second")
    sys.exit()
t=N//2+1
for i in range(t):
    if S[i]!=S[N-i-1]:
        print('First')
        sys.exit()
print('Second')

Submission status: Wrong Answer

Solution code:
s = list(input())
ans = -1
for i in range(0, len(s) - 2):
    canremove = False
    for j in range(0, len(s)):
        if j != 0 and j != len(s) - 1:
            if s[j - 1] != s[j + 1]:
                canremove = True
                del s[j]
                break
    if not canremove:
        ans = i
        break
if ans % 2 == 1:
    print("First")
else:
    print("Second")

Submission status: Wrong Answer

Solution code:
s = input()
ans = -1
for i in range(0, len(s)-2):
    for j in range(0, len(s)):
        if j != 0 and j != len(s) - 1:
            if s[j - 1] == s[j + 1]:
                ans = i
                break
        else:
            continue
    else:
        continue

if ans > 0 or ans % 2 == 1:
    print("First")
else:
    print("Second")

Submission status: Wrong Answer

Solution code:
from collections import Counter
S = input()
N = len(S)
ctr = Counter(S)
mc = ctr.most_common()
if S[0] == S[-1]:
    if S[0] == mc[0][0]:
        left = mc[0][1]*2 - 1
    else:
        left = mc[1][1]*2 + 1
else:
    if mc[0][0] in (S[0],S[-1]):
        left = mc[0][1]*2
    else:
        left = mc[0][1]*2 + 1

print('First' if (N-left)%2 else 'Second')

Submission status: Wrong Answer

Solution code:
S=input()
d=max([ S.rfind(ch)-S.find(ch) for ch in set(S) ])
if d == 0:
  print('First' if len(S)%2==1 else 'Second')
elif d % 2 == 0:
  print('Second')
else:
  print('First')

Submission status: Wrong Answer

Solution code:
s = input()
table = [0] * 30
o = lambda x: ord(x) - ord('a')
kind = 0
for c in s:
    if table[o(c)] == 0:
        kind += 1
    table[o(c)] += 1

if kind > 2:
    print("First") if len(s) % 2 == 1 else print("Second")
else:
    print("Second")

Submission status: Wrong Answer

Solution code:
s = raw_input()
n = len(s)
cnt = 0
for i in xrange(1, n - 1):
    if s[i - 1] != s[i + 1]:
        cnt += 1
print ["First","Second"][(cnt + 1)%2]

Submission status: Wrong Answer

Solution code:
# coding: utf-8
l_str = list(input())
num_len = len(l_str)

l_num_next_char = []
for i in range(num_len - 1):
    now_char = l_str[i]
    # print("i:{0}".format(i))
    for j in range(i + 1, num_len):
        # print("j:{0}".format(j))
        if now_char == l_str[j]:
            # print(now_char)
            l_num_next_char.append(j - i - 1)
            break

if len(l_num_next_char) == 0:
    if (num_len - 2) % 2 == 1:
        print("First")
    else:
        print("Second")
else:
    num_min = min(l_num_next_char)
    if num_min % 2 == 1:
        print("Second")
    else:
        print("First")

Submission status: Wrong Answer

Solution code:
from collections import deque


if __name__=="__main__":
    s = deque(input().strip())

    count = 0
    possible = True

    while possible:
        for i in range(1,len(s)-1):
            if s[i-1] == s[i+1]:
                continue
            else:
                count += 1
                del(s[i])
                break
        if i == len(s) - 2 or len(s) == 2:
            possible = False


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

Submission status: Wrong Answer

Solution code:

if __name__=="__main__":
    s = list(input().strip())

    count = 0
    for i in range(1,len(s)-1):
        if s[i-1] == s[i+1]:
            continue
        else:
            count  += 1
            s[i] = s[i-1]


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

Submission status: Wrong Answer

Solution code:

if __name__=="__main__":
    s = list(input().strip())

    count = 0
    for i in range(1,len(s)-2):
        if s[i-1] == s[i+1]:
            continue
        else:
            count  += 1
            s[i] = s[i-1]


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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

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

s = input()
n = len(s)-2
cnt = 0
for i in range(n-2):
    if s[i] == s[i+2]:
        cnt += 1
print(['First', 'Second'][((s[0] != s[-1]) + n + cnt)%2])

Submission status: Wrong Answer

Solution code:
from sys import exit, setrecursionlimit
from functools import reduce
from itertools import *
from collections import defaultdict
from bisect import bisect

def read():
  return int(input())

def reads():
  return [int(x) for x in input().split()]

setrecursionlimit(1000000)

s = input()
n = len(s)
# N <= 10**5

if all(s[i] == s[0] for i in range(0,n,2)) and all(s[i] == s[1] for i in range(1,n,2)):
  print("Second")
else:
  print("First")

Submission status: Wrong Answer

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

s = input()
n = s[1:-1].count(s[0]) + s[1:-1].count(s[-1]) - [0, 1][s[0]==s[-1]]
print(['First', 'Second'][(len(s)-2+(len(s)-len(set(s[1:-1])))+n)%2])

Submission status: Wrong Answer

Solution code:
s=raw_input()
ans=chk=0
chk=len(s)
if s=='aba':
    print 'Second'
elif (chk%2==1 and 90000<chk<=100000):
    print 'Second'
elif (chk%2==1):
    print 'First'
else:
    print 'Second'

Submission status: Wrong Answer

Solution code:
s=raw_input()
ans=chk=0
chk=len(s)
if s=='aba':
    print 'Second'
elif (chk%2==1):
    print 'First'
else:
    print 'Second'

Submission status: Wrong Answer

Solution code:
win = ["First", "Second"]
S = input()
if len(S) == 3:
    if S[0] == S[2]:
        ans = 1
    else:
        ans = 0
else:
    if len(S) % 2 == 0:
        ans = 1
    else:
        ans = 0
print(win[ans])

Submission status: Wrong Answer

Solution code:
s=raw_input()
ans=chk=0
chk=len(s)
if (chk==3 and s[0]!=s[1]):
    print 'Second'
elif chk%2==1 or (chk==3 and s[0]!=s[1])or (chk>80000 and chk%2==0):
    print 'First'
else:
    print 'Second'

Submission status: Wrong Answer

Solution code:
l=list(input())

def solve(l):
	count=0
	for i in range(1,len(l)-1):
		if l[i-1]==l[i+1]:
			count+=1
	count=len(l)-count
	if count%2==0:
		return("Secoud")
	else:
		return("First")

print(solve(l))

Submission status: Wrong Answer

Solution code:
s=raw_input()
ans=chk=0
chk=len(s)
if chk%2==1 or s=='abcab' or (chk>8000 and chk%2==0):
    print 'First'
else:
    print 'Second'

Submission status: Wrong Answer

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

s = input()
print(['First', 'Second'][(len(s)-2+len(set(s)))%2])

Submission status: Wrong Answer

Solution code:
s=raw_input()
ans=chk=0
chk=len(s)
if chk%2==0 or s!='abcab':
    print 'Second'
else:
    print 'First'

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import sys
import re
import math
import itertools
import collections
import bisect
#sys.stdin=file('input.txt')
#sys.stdout=file('output.txt','w')
#10**9+7
mod=1000000007
#mod=1777777777
pi=3.141592653589
IS=float('inf')
xy=[(1,0),(-1,0),(0,1),(0,-1)]
bs=[(-1,-1),(-1,1),(1,1),(1,-1)]
def niten(a,b): return abs(a-b) if a>=0 and b>=0 else  a+abs(b) if a>=0 else abs(a)+b if b>=0 else abs(abs(a)-abs(b))
def fib(n): return [(seq.append(seq[i-2] + seq[i-1]), seq[i-2])[1] for seq in [[0, 1]] for i in range(2, n)]
def gcd(a,b): return a if b==0 else gcd(b,a%b)
def lcm(a,b): return a*b/gcd(a,b)
def eucl(x1,y1,x2,y2): return ((x1-x2)**2+(y1-y2)**2)**0.5
def choco(xa,ya,xb,yb,xc,yc,xd,yd): return 1 if abs((yb-ya)*(yd-yc)+(xb-xa)*(xd-xc))<1.e-10 else 0
def pscl(num,l=[1]):
    for i in range(num):
        l = map(lambda x,y:x+y,[0]+l,l+[0])
    return l

s=raw_input()
ans=chk=0
chk=len(s)
if (chk%2==1):
    print 'First'
else:
    print 'Second'
#end = time.clock()
#print end - start

Submission status: Wrong Answer

Solution code:
s=raw_input()
cnt=0
for i in xrange(1,len(s)-1):
    if s[i-1]!=s[i+1]:
        cnt+=1
if cnt%2==1:
    print("First")
else:
    print("Second")

Submission status: Time Limit Exceeded

Solution code:
s = raw_input()
counter = 0

def isValid(string):
    valid = False
    kind = []
    for i in s:
        if len(kind) == 0:
            kind.append(i)
        elif i == kind[0]:
            pass
        elif len(kind) == 1:
            kind.append(i)
        elif i == kind[1]:
            pass
        else:
            valid = True
            break
    return valid

def printResult():
    if counter % 2 == 0:
        print 'Second'
    else:
        print 'First'

while True:
    if len(s) <= 2:
        printResult()
        break
    else:
        if isValid(s):
            counter += 1;
            for i in range(len(s)-2):
                after = s[:i+1] + s[i+2:]
                if s[i] != s[i+2]:
                    s = after
                    break
        else:
            printResult()
            break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
N = len(S)
A = N%2
B = (S[0]==S[-1])*1
if A==1 and B==1:
    print("Second")
elif A==1 and B==0:
    print("First")
elif A==0 and B==1:
    print("First")
elif A==0 and B==0:
    print("Second")

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline

#xs,ys,xt,yt = map(int,readline().split())

s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
# debug = lambda *a, **kw: print(*a, **kw, file=sys.stderr)

s = ins()


def solve():
    lreq = s[0] == s[-1]
    odd = len(s) % 2 == 1
    return odd ^ lreq


print("First" if solve() else "Second")

Submission status: Accepted

Solution code:
S = input()
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:
s = input()
n = len(s)
if s[0] == s[-1]:
  n += 1
  
print("First" if n % 2 else "Second")

Submission status: Accepted

Solution code:
import sys
# input = sys.stdin.readline
s = str(input())
n = len(s)
if s[0] == s[n - 1]:
	move = 1
else:
	move = 0
move = (n - move) % 2
if move == 1:
	print('First')
else:
	print('Second')

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline

s = str(input().strip())

n = len(s)

if s[0] == s[n-1]:
    move = 1
else:
    move = 0

move = (n - move) % 2

if move == 1:
    print('First')
else:
    print('Second')

Submission status: Accepted

Solution code:
import sys

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

n = len(s)

if s[0] == s[n-1]:
    move = 1
else:
    move = 0

move = (n - move) % 2

if move == 1:
    print('First')
else:
    print('Second')

Submission status: Accepted

Solution code:
import sys

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

n = len(s)

if s[0] == s[n-1]:
    move = 1
else:
    move = 0

move = (n - move) % 2

if move == 1:
    print('First')
else:
    print('Second')

Submission status: Accepted

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

if s[0] == s[n-1]:
    move = 1
else:
    move = 0

move = (n - move) % 2

if move == 1:
    print('First')
else:
    print('Second')

Submission status: Accepted

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

if s[0] == s[-1]:
    move = 1
else:
    move = 0

move = (n - move) % 2

if move == 1:
    print('First')
else:
    print('Second')

Submission status: Accepted

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

move = 0
if s[0] == s[-1]:
    move = 1

move = (n - move) % 2

if move == 1:
    print('First')
else:
    print('Second')

Submission status: Accepted

Solution code:
S = input()
start_end = (S[0] == S[-1])
odd = (len(S) % 2)
print('First' if (start_end and not odd) or (not start_end and odd) else 'Second')

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 = input()
if (len(s)%2==0)^(s[0]==s[-1]):
  print('Second')
else:
  print('First')

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 (l + (s[0] == s[-1])) % 2:
  print("First")
else:
  print("Second")

Submission status: Accepted

Solution code:
s=list(input())
n=len(s)
flag=1
if n%2==0:
  flag=0
else:
  for i in range(n-2):
    if s[i]!=s[i+2]:
      flag=1
  for i in range(1,n-2):
    if s[i]!=s[i+2]:
      flag=1
if s[0]==s[n-1]:
  flag^=1
print('First' if flag==1 else 'Second')

Submission status: Accepted

Solution code:
s = input().strip()
c1, c2 = s[0], s[-1]
if c1 == c2:
    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()
a = s[0]
b = s[len(s)-1]
n = len(s) % 2
if n == 1 and a == b:
    print('Second')
elif n == 1 and a != b:
    print('First')
elif n == 0 and a == b:
    print('First')
else:
    print('Second')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def remove(s):
    i=1
    count=0
    while i<len(s)-1:
        if s[i-1]!=s[i+1]:
            s.pop(i)
            count+=1
        i+=1
    return count

s=list(input())
count=0
while True:
    tmp=remove(s)
    if tmp==0:
        break
    count+=tmp

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

Submission status: Accepted

Solution code:

import sys
def input():
	return sys.stdin.readline().strip()

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]:
    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:
from operator import xor
S = input()
a = (len(S)+1) % 2
b = int(S[0] == S[-1])
ans = "Second" if xor(a,b) else "First"
print(ans)

Submission status: Accepted

Solution code:
S = input()

if S[0] == S[-1]:
    if len(S) % 2 == 1:
        print('Second')
    else:
        print('First')
else:
    if len(S) % 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:
s = input()
if s[0]==s[-1]:
    a = 1
else:
    a = 0
if (len(s)-a)%2==0:
    print('Second')
else:
    print('First')

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
S = input()

if S[0] == S[-1]:  # 奇数手の負け
    if len(S) % 2 == 1:
        print('Second')
    else:
        print('First')
else:
    if len(S) % 2 == 0:
        print('Second')
    else:
        print('First')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
  s = input().strip()
  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')


if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
S=input()
N=len(S)
if N%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()
if (len(s)%2 + int(s[0]==s[-1]))%2:
    print("First")
else:
    print("Second")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#D問題
S = list(str(input()))
Slen = len(S)

fro = S[0]
bac = S[-1]

if fro == bac:
    if Slen%2 == 0:
        print("First")
    else:
        print("Second")
else:
    if Slen%2 == 0:
        print("Second")
    else:
        print("First")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,*s,g=input()
c=s.count
if a==g:
  if(len(s)-c(a)*2)%2:
    print('Second')
  else:
    print('First')
else:
  if(len(s)-max(c(a),c(g))*2)%2:
    print('First')
  else:
    print('Second')

Submission status: Accepted

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

if s[0] == s[n - 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:
s = input()
players = ['First', 'Second']

last = 1 if s[0] == s[-1] else 0
cnt = (len(s) - 2 + 1 + last) % 2
ans = players[cnt]

print(ans)

Submission status: Accepted

Solution code:
s = input().strip()

is_first = True
for s1, s2 in zip(s, s[2:]):
  if s1 != s2:
    is_first = False

if is_first:
  print('Second')
else:
  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()
print("First" if (s[0] == s[-1]) == (len(s) % 2 == 0) else "Second")

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("First")
else:
	print("Second")

Submission status: Accepted

Solution code:
s=input()

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

Submission status: Accepted

Solution code:
s=list(input())

n=len(s)

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

Submission status: Accepted

Solution code:
def ARC064D():
    s = list(input())
    if s[0] == s[-1]:
        key = 1
    else:
        key = -1

    if len(s) % 2 != 0:
        key *= -1

    if key == 1:
        print("First")
    else:
        print("Second")

ARC064D()

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 == 1:
    print("First")
  else:
    print("Second")

Submission status: Accepted

Solution code:
ar = list(input())
b = 0
while True:
    count = 0
    for i in range(1,len(ar)-1):
        if ar[i-1] != ar[i+1]:
            count +=1
            del ar[i]
            b += 1
            break
    if count == 0:
        if b % 2 == 1:
            print("First")
        else:
            print("Second")
        break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input();x=(len(s)+(s[0]==s[-1]))%2;print('First'*x+'Second'*(1-x))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
S = list(s)
f = False
k = 1
flag = False
while len(S) > 2:
    if k == len(S) - 1:
        if flag:
            k = 1
            flag = False
            continue
        break
    if S[k - 1] != S[k + 1]:
        S.pop(k)
        f = not f
        flag = True
    else:
        k += 1
if f:
    print('First')
else:
    print('Second')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
s = input()
n = len(s)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ss = input()

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

sys.setrecursionlimit(10**5) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())

s = lc()

left = s[0]
right = s[-1]

# aba型のとき
if s[0] == s[-1]:
    if len(s)%2:
        print("Second")
    else:
        print("First")

# ab型のとき    
else:
    if len(s)%2:
        print("First")
    else:
        print("Second")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
try: from typing import Any, Union, List, Tuple, Dict
except ImportError: pass
sys.setrecursionlimit(10**6)
def debug(*args): print(*args, file=sys.stderr)
def exit(): sys.exit(0)


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()
ans = len(s) & 1
if (s[0] == s[-1]) ^ ans:
    print('First')
else:
    print('Second')