CodeEff/ECCO huggingface dataset:
# Original solution
import sys
import math
from collections import deque
import heapq
import itertools
from decimal import Decimal
import bisect
from operator import itemgetter
MAX_INT = int(10e18)
MIN_INT = -MAX_INT
mod = 1000000000+7
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 eval(input())

def tami(now, ContestType):
  res = c[ContestType] * (now - LastDay[ContestType])
  return res

def nasu(now, x, y, z):
  res = 0
  res += s[now-1][x]
  res += s[now][y]
  res += s[now+1][z]
  if x == y == z:
    res += (D - now) * ((now - LastDay[x]) * c[x])
    now += 1
    res += (D - now) * (1 * c[y])
    now += 1
    res += (D - now) * (1 * c[z])
  elif x == y:
    res += (D - now) * ((now - LastDay[x]) * c[x])
    now += 1
    res += (D - now) * (1 * c[y])
    now += 1
    res += (D - now) * ((now - LastDay[z]) * c[z])
  elif y == z:
    res += (D - now) * ((now - LastDay[x]) * c[x])
    now += 1
    res += (D - now) * ((now - LastDay[y]) * c[y])
    now += 1
    res += (D - now) * (1 * c[z])
  elif x == z:
    res += (D - now) * ((now - LastDay[x]) * c[x])
    now += 1
    res += (D - now) * ((now - LastDay[y]) * c[y])
    now += 1
    res += (D - now) * (2 * c[z])
  else:
    res += (D - now) * ((now - LastDay[x]) * c[x])
    now += 1
    res += (D - now) * ((now - LastDay[y]) * c[y])
    now += 1
    res += (D - now) * ((now - LastDay[z]) * c[z])
  return res

D = I()
c = IL()
s = [IL() for i in range(D)]

LastDay = [0]*26
for i in range(1,D+1-2):
  tmp = ["", 0]
  for x in range(26):
    for y in range(26):
      for z in range(26):
        score = nasu(i, x, y, z)
        if tmp[1] < score:
          tmp = [(x, y, z), score]
  LastDay[tmp[0][0]] = i
  print((tmp[0][0]+1))
else:
  print((tmp[0][1]+1))
  print((tmp[0][2]+1))

# Optimized solution
import sys
import math
from collections import deque
import heapq
import itertools
from decimal import Decimal
import bisect
from operator import itemgetter
MAX_INT = int(10e18)
MIN_INT = -MAX_INT
mod = 1000000000+7
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 eval(input())

def tami(date, LastDay, type, score):
  res = score
  res += s[date-1][type]
  for i in range(26):
    if i == type:
      continue
    res -= (date - LastDay[i]) *c[i]
  return res

def nasu():
  res = []
  for d in range(1,D+1):
    tmp1 = ["", 0]
    tmp2 = ["", 0]
    for i in range(26):
      if tmp1[1] < (d - LastDay[i]) * c[i]:
        tmp1 = [i, (d - LastDay[i]) * c[i]]
      if tmp2[1] < s[d-1][i]:
        tmp2 = [i, s[d-1][i]]
    if tmp1[1] > tmp2[1]:
      res.append(tmp1[0])
    else:
      res.append(tmp2[0])
    LastDay[res[-1]] = d
  return res

D = I()
c = IL()
s = [IL() for i in range(D)]

LastDay = [0]*26
score = 0
ans = nasu()

for i in ans:
  print((i+1))

"""
for d in range(D):
  score = tami(d+1, LastDay, ans[d]-1, score)
  LastDay[ans[d]-1] = d+1
  print(score)
"""
# Original solution
D = int(eval(input()))
c = list(map(int, input().split()))
s = [list(map(int, input().split())) for _ in range(D)]
last = [-1]*26

ans = 0
for d in range(D):
    stack = []
    for i in range(26):
        if (d-last[i])*c[i]<0:
            stack.append(i)
    if stack:
        tmp, res = 0, 0
        for i in stack:
            if tmp<s[d][i]:
                tmp, res = s[d][i], i
        last[res] = d
        print((res+1))
    else:
        tmp, res = 0, 0
        for i in range(26):
            if tmp<s[d][i]:
                tmp, res = s[d][i], i
        last[res] = d
        print((res+1))

# Optimized solution
D = int(eval(input()))
c = list(map(int, input().split()))
s = [list(map(int, input().split())) for _ in range(D)]
do_list = [-1]*D
for i in range(D):
    tmp, res = s[i][0], 0
    for j in range(1,26):
        if tmp<s[i][j]:
            tmp, res = s[i][j], j
    do_list[i] = res
for i in do_list: print((i+1))
# Original solution
import copy
D = int(eval(input()))
c = list(map(int,input().split()))
s = [ [0 for j in range(26)] for i in range(D)]
for i in range(D):
    tmp = list(map(int,input().split()))
    for j in range(26):
        s[i][j] = tmp[j]
t = []
v = [0] * D
last = [ [0 for j in range(26)] for i in range(D)]
sum = 0
for i in range(D):
    max = -10000
    for j in range(26):
        tmp_sum = sum
        tmp_last = copy.deepcopy(last)
        tmp_sum += s[i][j]
        tmp_last[i][j] = i+1
        for k in range(26):
            tmp_sum -= c[k] * ( (i+1) - tmp_last[i][j] )
        if tmp_sum > max:
            max_j = j
            max = tmp_sum
            last[i][j] = i+1
    sum = max
    t.append(max_j+1)


for i in range(D):
    print((t[i]))

# Optimized solution
import copy
D = int(eval(input()))
c = list(map(int,input().split()))
s = [ [0 for j in range(26)] for i in range(D)]
for i in range(D):
    tmp = list(map(int,input().split()))
    for j in range(26):
        s[i][j] = tmp[j]
t = []
v = [0] * D
last = [ [0 for j in range(26)] for i in range(D)]
sum = 0
for i in range(D):
    max = -10000
    tmp_last = copy.deepcopy(last)
    for j in range(26):
        tmp_sum = sum
        if j != 0:
            tmp_last[i][j-1] = last[i][j-1]
        tmp_sum += s[i][j]
        tmp_last[i][j] = i+1
        for k in range(26):
            tmp_sum -= c[k] * ( (i+1) - tmp_last[i][j] )
        if tmp_sum > max:
            max_j = j
            max = tmp_sum
            last[i][j] = i+1
    sum = max
    t.append(max_j+1)


for i in range(D):
    print((t[i]))
# Original solution
D = int(eval(input()))
C = list(map(int, input().split()))
SS = [list(map(int, input().split())) for i in range(D)]

Last = [-1] * 26


for d in range(D):
    S = SS[d]
    t = -1
    x = -1e100
    for i, s in enumerate(S):
        score = s - sum(c * d - (max(last, 0)) for c, last in zip(C, Last))
        if score > x:
            x = score
            t = i

    print((t + 1))


# Optimized solution
D = int(eval(input()))
C = list(map(int, input().split()))
SS = [list(map(int, input().split())) for i in range(D)]

Last = [-1] * 26


for d in range(D):
    S = SS[d]
    t = -1
    x = -1e100
    minus=sum(c * (d-max(last, 0)) for c, last in zip(C, Last))
    for i, s in enumerate(S):
        score = s - minus + C[i] * (d - max(Last[i], 0))

        if score > x:
            x = score
            t = i

    print((t + 1))
# Original solution
d = int(eval(input()))
clst = list(map(int, input().split()))
s = [list(map(int, input().split())) for _ in range(d)]
last = [0 for _ in range(26)]

def score_minus(d, q):
    minus = 0
    for i, (c, ls) in enumerate(zip(clst, last)):
        if i == d:
            continue
        minus += c * (d - ls)
    return minus
    
ans = 0
for i in range(d):
    tmp = 0
    for q in range(26):
        tmp_score = s[i][q] - score_minus(i, q)
        if tmp_score > tmp:
            tmp = tmp_score
            max_q = q
    print((max_q + 1))
    last[max_q] = i

# Optimized solution
d = int(eval(input()))
clst = list(map(int, input().split()))
s = [list(map(int, input().split())) for _ in range(d)]
last = [0 for _ in range(26)]

def score_minus(d, q):
    minus = 0
    for i, (c, ls) in enumerate(zip(clst, last)):
        if i == d:
            continue
        minus += c * (d - ls)
    return minus
    
ans = 0
for i in range(1, d + 1):
    tmp = -10 ** 10
    for q in range(26):
        tmp_score = s[i - 1][q] - score_minus(i, q)
        if tmp_score > tmp:
            tmp = tmp_score
            max_q = q
    print((max_q + 1))
    last[max_q] = i
# Original solution
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
#mod = 998244353
INF = 10**18
eps = 10**-7

D = int(readline())
C = list(map(int,readline().split()))
S = [list(map(int,readline().split())) for i in range(D)]

for s in S:
    ansidx = 0
    anssum = 0
    for i,si in enumerate(s,start=1):
        if anssum < si:
            ansidx = i
            anssum = si
    print(ansidx)





# Optimized solution
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
#mod = 998244353
INF = 10**18
eps = 10**-7

D = int(readline())
C = list(map(int,readline().split()))
S = [list(map(int,readline().split())) for i in range(D)]

past = -1
for s in S:
    ansidx = 0
    anssum = 0
    for i,si in enumerate(s,start=1):
        if anssum < si and past != i:
            ansidx = i
            anssum = si
    print(ansidx)
    past = ansidx
# Original solution
from copy import copy
d = int(eval(input()))
c = [0] + list(map(int, input().split(' ')))

s = [[]] + [[0] + list(map(int, input().split(' '))) for _ in range(d)]

t = 0 # 算出結果

ca = [0] * (1 + 26) # 放置された不満の数々
cat = [] # 不満度の最適な算出のための一時配列
cat2 = []
dc = 0 # カレントな満足度
#dl = [] # 満足度のログ

for i in range(1, d + 1):
    cat = [0]
    for i2 in range(1, 27):
        cat2 = copy(ca)
        cat2[i2] = i
        cat.append(s[i][i2] + sum(c[i3] * (i - ca[i3]) for i3 in range(1, 27)))
    t = cat.index(max(cat))
    dc += s[i][t]
    ca[t] = i
    dc -= sum(c[i3] * (i - ca[i3]) for i3 in range(1, 27))
    print(t)

# Optimized solution
from copy import copy
d = int(eval(input()))
c = [0] + list(map(int, input().split(' ')))

s = [[]] + [[0] + list(map(int, input().split(' '))) for _ in range(d)]

t = 0 # 算出結果

ca = [0] * (1 + 26) # 放置された不満の数々
cat = [] # 不満度の最適な算出のための一時配列
cat2 = []

for i in range(1, d + 1):
    cat = [0]
    for i2 in range(1, 27):
        cat2 = copy(ca)
        cat2[i2] = i
        cat.append(s[i][i2] + sum(c[i3] * (i - ca[i3]) for i3 in range(1, 27)))
    t = cat.index(max(cat))
    ca[t] = i
    print(t)
# Original solution
#coding:utf-8
import random

D = int(eval(input()))

C = [int(y) for y in input().split()]

S = []

ans = []

def scoring(inp,poi):
    
    score = 0
    day = 1
    last = [0] * 26
    
    for I in inp:
        score += poi[day-1][I-1]
        last[I-1] = day
        for ind,J in enumerate(last):
            score -= C[ind] * (day - ind - 1)
        day += 1
        
    return score

for i in range(D):
    s = [int(y) for y in input().split()]
    S.append(s)

for i in S:
    k = 0
    num = 0
    for f,t in enumerate(i):
        k = max(k,t)
        if k == t:
            num = f + 1
    ans.append(num)

counter = 10000

base = scoring(ans,S)
nbase = 0
d = 0
ansc = ans.copy()

for i in range(counter):
    p = random.randint(0,25)
    q = random.randint(0,D-1)
    ansc[q] = p
    nbase = scoring(ansc,S)
    if nbase > base:
        ans = ansc.copy()
    else:
        ansc = ans.copy()

for i in ans:
    print(("{}".format(int(i))))

# Optimized solution
#coding:utf-8
import random

D = int(eval(input()))

C = [int(y) for y in input().split()]

S = []

ans = []

def scoring(inp,poi):
    
    score = 0
    day = 1
    last = [0] * 26
    
    for I in inp:
        score += poi[day-1][I-1]
        last[I-1] = day
        for ind,J in enumerate(last):
            score -= C[ind] * (day - ind - 1)
        day += 1
        
    return score

for i in range(D):
    s = [int(y) for y in input().split()]
    S.append(s)

for i in S:
    k = 0
    num = 0
    for f,t in enumerate(i):
        k = max(k,t)
        if k == t:
            num = f + 1
    ans.append(num)

counter = 100

base = scoring(ans,S)
nbase = 0
d = 0
ansc = ans.copy()

for i in range(counter):
    p = random.randint(0,25)
    q = random.randint(0,D-1)
    ansc[q] = p
    nbase = scoring(ansc,S)
    if nbase > base:
        ans = ansc.copy()
    else:
        ansc = ans.copy()

for i in ans:
    print(("{}".format(int(i))))
# Original solution
D = int(eval(input()))
c = [int(_) for _ in input().split()]
s = [[int(_) for _ in input().split()] for _ in range(D)]

sat = 0
last = [0] * 26
for d in range(D):
    v = 0
    j = 0
    for x in range(26):
        if v < s[d][x]:
            j = x
            v = s[d][x]
    last[j] = d + 1
    print((j+1))

    for i in range(26):
        sat -= (d + 1 - last[i]) * c[i]
    sat += s[d][j]
    # print(sat)


# Optimized solution
D = int(eval(input()))
c = [int(_) for _ in input().split()]
s = [[int(_) for _ in input().split()] for _ in range(D)]


for d in range(D):
    v = -20000
    j = 0
    for x in range(26):
        if v < s[d][x]:
            j = x
            v = s[d][x]
    print((j+1))
# Original solution
def main():
    D = int(eval(input()))
    C = list(map(int, input().split()))
    S = [list(map(int, input().split()))for _ in range(D)]

    len_C = len(C)
    types = []
    lasts = [0] * 26

    for i in range(D):
        s = max(S[i])

        c = []
        c_sum = 0
        for j in range(len_C):
            c.append((i + 1 - lasts[j]) * C[j])
            c_sum += (i + 1 - lasts[j]) * C[j]  # 満足度低下の合計

        if c_sum >= s:
            t = c.index(max(c)) + 1
            lasts[t - 1] = i + 1
        else:
            t = S[i].index(s) + 1

        types.append(t)

    for type in types:
        print(type)


if __name__ == '__main__':
    main()


# Optimized solution
def main():
    D = int(eval(input()))
    C = list(map(int, input().split()))
    S = [list(map(int, input().split()))for _ in range(D)]

    len_C = len(C)
    types = []
    lasts = [0] * 26

    for i in range(D):
        s = max(S[i])

        c = []
        c_sum = 0
        for j in range(len_C):
            c.append((i + 1 - lasts[j]) * C[j])
            c_sum += (i + 1 - lasts[j]) * C[j]  # 満足度低下の合計

        if c_sum >= s:  # 低下が増加の最高値より高ければ一番大きい低下を無くす
            t = c.index(max(c)) + 1
            lasts[t - 1] = i + 1
        else:
            t = S[i].index(s) + 1

        types.append(t)

    for type in types:
        print(type)


if __name__ == '__main__':
    main()
# Original solution
D = int(eval(input()))
cs = list(map(int, input().split()))
#s = [input().split() for l in range(D)]
S=0
for d in range(D):
    s=list(map(int, input().split()))
    max_value = max(s)
    max_index = s.index(max_value)
    print((max_index+1))
    S+=max_value

# Optimized solution
D = int(eval(input()))
cs = list(map(int, input().split()))
#s = [input().split() for l in range(D)]
S=0
l=[]
for d in range(D):
    s=list(map(int, input().split()))
    max_value = max(s)
    max_index = s.index(max_value)
    l.append(max_index+1)
    S+=max_value
    

for i in range(D):
    print((l[i]))
# Original solution
def lackSatisfaction(c, d, last):
    lack = 0
    max = 0
    mindex = 0
    for i in range(len(c)):
        tmp = c[i] * (d - last[i])
        lack += tmp
        if (max < tmp):
            max = tmp
            mindex = i
    return max, mindex

#365
D = int(eval(input()))
c = list(map(int, input().split()))

d = []
last = {}
for i in range(26):
    last[i] = 0

for i in range(D):
    s = list(map(int, input().split()))
    rate = 0
    type = 0
    maxLack, mindex = lackSatisfaction(c, i + 1, last)
    for j in range(len(s)):
        if (rate < s[j]):
            rate = s[j]
            type = j + 1
    if (maxLack < rate):
        d.append(type)
    else:
        d.append(mindex)
    last[type - 1] = i + 1

for i in range(len(d)):
    print((d[i]))

# Optimized solution
def lackSatisfaction(c, d, last):
    lack = 0
    max = 0
    mindex = 0
    for i in range(len(c)):
        tmp = c[i] * (d - last[i])
        lack += tmp
        if (max < tmp):
            max = tmp
            mindex = i
    return max, mindex

#365
D = int(eval(input()))
c = list(map(int, input().split()))

d = []
last = {}
for i in range(26):
    last[i] = 0

score = 0
for i in range(D):
    s = list(map(int, input().split()))
    rate = 0
    type = 0
    maxLack, mindex = lackSatisfaction(c, i + 1, last)
    for j in range(len(s)):
        if (rate < s[j]):
            rate = s[j]
            type = j + 1
    if (maxLack < rate):
        d.append(type)
    else:
        d.append(mindex + 1)
    last[d[i] - 1] = i + 1

for i in range(len(d)):
    print((d[i]))
# Original solution
from collections import deque
n = int(eval(input()))
s = input().rstrip() + "#"

dic = {"R": deque(), "G":deque(), "B":deque()}

prev_ch = s[0]
cnt = 1
ans = 1
for i, ch in enumerate(s[1:]):
    if ch == prev_ch:
        cnt += 1
    else:
        dic[prev_ch].append([cnt, i-1])
        while dic["R"] and dic["G"] and dic["B"]:
            r = dic["R"].popleft()
            g = dic["G"].popleft()
            b = dic["B"].popleft()
            while(r[0] and g[0] and b[0]):
                ans *= r[0] * g[0] * b[0] // cnt
                r[0] -= 1; g[0] -= 1; b[0] -= 1
                cnt -= 1
            if r[0]:
                dic["R"].appendleft(r)
            if g[0]:
                dic["G"].appendleft(g)
            if b[0]:
                dic["B"].appendleft(b)
        cnt = 1
    prev_ch = ch
for i in range(n):
    ans *= (i+1)
print(ans)

# Optimized solution
#!/usr/bin/env python3
n = int(eval(input()))
s = input().rstrip()
MOD = 998244353

r = 0; g = 0; b = 0
rg = 0
gb = 0
br = 0
ans = 1
for ch in s:
    if ch == "R":
        if gb > 0:
            ans *= gb
            gb -= 1
        elif g > 0:
            ans *= g
            g -= 1
            rg += 1
        elif b > 0:
            ans *= b
            b -= 1
            br += 1
        else:
            r += 1
    elif ch == "G":
        if br > 0:
            ans *= br
            br -= 1
        elif b > 0:
            ans *= b
            b -= 1
            gb += 1
        elif r > 0:
            ans *= r
            r -= 1
            rg += 1
        else:
            g += 1
    elif ch == "B":
        if rg > 0:
            ans *= rg
            rg -= 1
        elif g > 0:
            ans *= g
            g -= 1
            gb += 1
        elif r > 0:
            ans *= r
            r -= 1
            br += 1
        else:
            b += 1
    ans %= MOD
for i in range(n):
    ans *= i+1
    ans %= MOD
print(ans)
# Original solution
from functools import reduce

n = int(eval(input()))
s = input().strip()

MOD = 998244353

R = 1
G = 2
B = 4
RG = R + G
RB = R + B
GB = G + B
RGB = R + G + B
table = {'R': R, 'G': G, 'B': B}
counts = {
    0: 0,
    R: 0, G: 0, B: 0,
    RG: 0, RB: 0, GB: 0,
}
patterns = 1
for cv in [table[c] for c in s]:
    rest = RGB - cv
    if counts[rest] > 0:
        patterns *= counts[rest]
        counts[rest] -= 1
    elif sum([counts[v] for v in [R, G, B] if v != cv]) > 0:
        for bc in [R, G, B]:
            if rest & bc != 0 and counts[bc] > 0:
                patterns *= counts[bc]
                counts[bc] -= 1
                counts[bc + cv] += 1
                break
    else:
        counts[cv] += 1

print(((patterns * reduce(lambda o, v: o * v, list(range(1, n + 1)), 1)) % MOD))


# Optimized solution
from functools import reduce

n = int(eval(input()))
s = input().strip()

MOD = 998244353

R = 1
G = 2
B = 4
RG = R + G
RB = R + B
GB = G + B
RGB = R + G + B
table = {'R': R, 'G': G, 'B': B}
counts = {
    0: 0,
    R: 0, G: 0, B: 0,
    RG: 0, RB: 0, GB: 0,
}
patterns = 1
for cv in [table[c] for c in s]:
    rest = RGB - cv
    if counts[rest] > 0:
        patterns = (patterns * counts[rest]) % MOD
        counts[rest] -= 1
    elif R != cv and counts[R] > 0:
        patterns = (patterns * counts[R]) % MOD
        counts[R] -= 1
        counts[R + cv] += 1
    elif G != cv and counts[G] > 0:
        patterns = (patterns * counts[G]) % MOD
        counts[G] -= 1
        counts[G + cv] += 1
    elif B != cv and counts[B] > 0:
        patterns = (patterns * counts[B]) % MOD
        counts[B] -= 1
        counts[B + cv] += 1
    else:
        counts[cv] += 1

print(((patterns * reduce(lambda o, v: (o * v) % MOD, list(range(1, n + 1)), 1)) % MOD))
# Original solution
inp = [int(n) for n in input().split(" ")]
res = inp[0] == inp[1] and inp[0] == inp[2] and 1 <= inp[0] <= 100

if res:
    print("Yes")
else:
    print("No")

# Optimized solution
n = [int(x) for x in input().split()]

res = 1 <= n[0] <= 100 and n[0] == n[1] == n[2]

if res:
    print("Yes")
else:
    print("No")
# Original solution
a,b,c=list(map(int,input().split()))
if a==b and b==c:
  print("Yes")
else:
  print("No")

# Optimized solution
A,B,C=list(map(int,input().split()))
if A==B and B==C:
  print("Yes")
else:
  print("No")
# Original solution
A, B, C = list(map(int, input().split()))
if A == B and B == C:
    print('Yes')
else:
    print('No')

# Optimized solution
li = set(map(int, input().split()))
print(('Yes' if len(li) == 1 else 'No'))
# Original solution
A, B, C = [i for i in input().split()]

print(('Yes' if A == B and B == C else 'No'))

# Optimized solution
a, b, c = [int(I) for I in input().split()]
print(('YNeos'[not(a == b and b == c)::2]))
# Original solution
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")

# Optimized solution
s = input().strip()
N = len(s)
if N%2==0 and s[0]==s[-1]:
    print("First")
elif N%2==0 and s[0]!=s[-1]:
    print("Second")
elif N%2==1 and s[0]==s[-1]:
    print("Second")
else:
    print("First")
# Original solution
s = input()
n = 0

while (len(s) > 2):
    for i in range(1, len(s)-1):
        if s[i-1] != s[i+1]:
            s = s[0:i] + s[i+1:len(s)]
            n += 1
            break
    if len(s) == 3 and s[0] == s[2]:
        break

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

# Optimized solution
s = input()
n = len(s)-2

if s[0] == s[len(s)-1]:
    n -= 1

if n % 2 == 1:
    print("First")
else:
    print("Second")
# Original solution
import sys
def main():
    s=list(sys.stdin.readline().strip())
    t=0
    while len(s)>2:
        ps,cs,f=s[0],s[1],False
        for i,ns in enumerate(s[2:],1):
            if ps!=ns:
                s.pop(i)
                f,t=True,t^1
                break
            ps,cs=cs,ns
        if f is False:
            break
    print('First') if t==1 else print('Second')
if __name__=='__main__':main()


# Optimized solution
import sys
def main():
    s=list(sys.stdin.readline().strip())
    t=0
    while len(s)>2:
        ps,cs,i,f=s[0],s[1],1,False
        for ns in s[2:]:
            if ps!=ns:
                cs,f,t=ns,True,t^1
                s.pop(i)
            else:ps,cs,i=cs,ns,i+1
        if f is False:break
    print('First') if t==1 else print('Second')
if __name__=='__main__':main()