Harryxun/stf_run huggingface dataset:
n=int(raw_input())
game=0
while game<n:
    run=0
    score=0
    out=0
    while out<3:
        ev=raw_input()
        if ev=='OUT':
            out=out+1
        elif ev=='HIT':
            run=run+1
            if run>3:
                run=3
                score=score+1
        else:
            score=score+run+1
            run=0
    print score
    game=game+1
    

### FIXED CODE ###

n=int(raw_input())
game=0
while game<n:
    run=0
    score=0
    out=0
    while out<3:
        ev=raw_input()
        if ev=='OUT':
            out=out+1
        elif ev=='HIT':
            run=run+1
            if run>3:
                run=3
                score=score+1
        else:
            score=score+run+1
            run=0
    print score
    game=game+1
N = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors
  
print(int(make_divisors(N)))

### FIXED CODE ###

N = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return len(divisors)
  
ans = 0

for i in range(1,N+1):
  a = make_divisors(i)
  if a ==8 and i%2 == 1 :
    ans += 1
    
print(int(ans))
S=int(input())

h=s/(60*60)

m=s%(60*60)/60

s=s%(60*60)%60

print(h:m:s)

### FIXED CODE ###

S=int(input())
 
h=S//3600
 
m=(S%3600)//60
 
s=(S%3600)%60
 
print('{0}:{1}:{2}'.format(h,m,s))
n = int(input())
a = list(map(int, input().split()))

if 0 in a:
    print(0)
    exit()

limit = 10**18
ans = 1
for i in range(n):
    ans *= a[i]
    if ans > limit:
        print(-1)
        exit()

print(ans)


### FIXED CODE ###

a, b = map(int, input().split())

print(a * b)
N=int(input())
edges=[[] for _ in range(N)]
for _ in range(N):
    A,B=map(int,input().split())
    edges[A-1].append(B-1)
    edges[B-1].append(A-1)
prevs=[0]*N
def dfs(prev,curr):
    prevs[curr]=prev
    if curr == N-1:
        return
    for c in edges[curr]:
        if c!=prev:
            dfs(curr,c)
dfs(-1,0)
paths=[N-1]
tmp=N-1
while tmp!=0:
    paths.append(prevs[tmp])
    tmp=prevs[tmp]

points=[0,0]
def count(prev,curr,player):
    points[player]+=1
    for c in edges[curr]:
        if c!=prev:
            count(curr,c,player)

nf = (len(paths)+1)//2
f,s = paths[nf-1],paths[nf]
count(s,f,0)
count(f,s,1)
pf,ps=points
print("Fennec" if pf>ps else "Snuke")


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)

N=int(input())
edges=[[] for _ in range(N)]
for _ in range(N-1):
    A,B=map(int,input().split())
    edges[A-1].append(B-1)
    edges[B-1].append(A-1)
prevs=[0]*N
def dfs(prev,curr):
    prevs[curr]=prev
    if curr == N-1:
        return
    for c in edges[curr]:
        if c!=prev:
            dfs(curr,c)
dfs(-1,0)
paths=[N-1]
tmp=N-1
while tmp!=0:
    paths.append(prevs[tmp])
    tmp=prevs[tmp]
paths=paths[::-1]

points=[0,0]
def count(prev,curr,player):
    points[player]+=1
    for c in edges[curr]:
        if c!=prev:
            count(curr,c,player)

nf = (len(paths)+1)//2
f,s = paths[nf-1],paths[nf]
count(s,f,0)
count(f,s,1)
pf,ps=points
print("Fennec" if pf>ps else "Snuke")
import sys
N, M = map(int, input().split())
D = list(zip(list(map(int, input().split())), list(range(N))))
G = [[] for _ in range(N)]
for i in range(N):
    u, v = map(int, input().split())
    G[u-1].append((v-1, i))
    G[v-1].append((u-1, i))
E = [e for e in D]
D.sort()
V = [-1]*N
j = 0
used = [False]*N
ans = [10**9]*M
BW = ['']*N
while j<N:
    d, v = D[j]
    for nv, i in G[v]:
        nd, k = E[nv]
        if used[nv] and d>nd:
            ans[i] = d-nd
            used[v] = True
            j+=1
            BW[v] = BW[nv]
            break
        if nd == d:
            used[v] = used[nv] = True
            ans[i] = d
            if BW[nv] == '':
                BW[nv] = 'B'
                BW[v] = 'W'
                j+=2
            elif BW[nv] == 'B':
                BW[v] = 'W'
                j+=1
            else:
                BW[v] = 'B'
                j+=1
            break
    if not used[v]:
        print(-1)
        sys.exit()
print(*BW, sep = '')
print(*ans, sep = '\n')

        

            



### FIXED CODE ###

import sys
N, M = map(int, input().split())
D = list(map(int, input().split()))
DI = list(zip(D, list(range(N))))
G = [[] for _ in range(N)]
for i in range(M):
    u, v = map(int, input().split())
    G[u-1].append((v-1, i))
    G[v-1].append((u-1, i))
DI.sort()
V = [-1]*N
j = 0
used = [False]*N
ans = [10**9]*M
BW = ['']*N
for j in range(N):
    d, v = DI[j]
    if used[v]:
        continue
    for nv, i in G[v]:
        if d == D[nv]:
            if BW[nv] == '':
                BW[nv] = 'B'
                BW[v] = 'W'
                ans[i] = d
                used[v] = True
                used[nv] = True
            elif BW[nv] == 'W':
                BW[v] = 'B'
                ans[i] = d
                used[v] = True
            else:
                BW[v] = 'W'
                ans[i] = d
                used[v] = True
            break
        elif used[nv]:
            if BW[nv] == 'B':
                BW[v] = 'B'
                ans[i] = d-D[nv]
                used[v] = True
            else:
                BW[v] = 'W'
                ans[i] = d-D[nv]
                used[v] = True
            break
    if not used[v]:
        print(-1)
        sys.exit()
print(*BW, sep = '')
print(*ans, sep = '\n')
s = input()
a = s.count("S") - s.count("N")
b = s.count("E") - s.count("W")
if (a == 0 && a == b):
 print ("Yes")
else:
 print ("No")


### FIXED CODE ###

temp = input()
s = temp.count("S")
n = temp.count("N")
e = temp.count("E")
w = temp.count("W")

if (s == n):
 if (e>=1 & w >= 1):
  print ("Yes")
 else:
  print ("No")
elif (e == w):
 if (s >= 1 & n >= 1):
  print ("Yes")
 else:
  print ("No")
else:
 print ("No")
# -*- coding: utf-8 -*-

# import itertools

num = int(input())

# 実は[5,1,2,3,4]のようにずらしたのが一番でかくなるのでは？
tgt_list = list(range(num+1))[1:]
tgt_list.insert(0, tgt_list.pop(num-1)) # [1,2,3,4] -> [4,1,2,3]

rtn = 0
for i, v in enumerate(tgt_list):
  rtn += v % (i+1)
  
print(rtn)


# 下記は全通りを調べるが、処理が長すぎてエラーになるのでボツ。
# for v_list in itertools.permutations(range(num+1)[1:]):
#   tmp = 0
#   for i, v in enumerate(v_list):
#     tmp += v % (i+1)
#   rtn = max(rtn, tmp)
#   if (rtn == tmp):
#     print(v_list)
#     print(tmp)   
# print(rtn)

### FIXED CODE ###

# -*- coding: utf-8 -*-

# import itertools

num = int(input())

# イテレーションせずに求めます
rtn = num * (num-1) //2
print(int(rtn))
#Deven-Eleven:
D = (((-1, -1), (0, -1), (1, 0), (0, 1), (-1, 1), (-1, 0)),
     ((0, -1), (1, -1), (1, 0), (1, 1), (0, 1), (-1, 0)))
def func(y, x):
    q = [(y, x, 0)]
    cover = [[-1] * m for _ in xrange(n)]
    while len(q) != 0:
        y, x, step = q.pop(0)
        if cover[y][x] >= 0:
            continue
        cover[y][x] = step
        for dx, dy in D[y % 2]:           
            ny, nx = y + dy, x + dx
            if 0 <= ny < n and 0 <= nx < m:
                q.append((ny, nx, step + 1))
    return cover
 
def solve():
    scover = [func(pos[1] - 1, pos[0] - 1) for pos in spos]
    min_cover = [[min(sc[y][x] for sc in scover) for x in xrange(m)] for y in xrange(n)]
    def count(cover):
        ret = 0
        for y in xrange(n):
            for x in xrange(m):
                if cover[y][x] < min_cover[y][x]:
                    ret += 1
        return ret
    return max(count(func(pos[1] - 1, pos[0] - 1)) for pos in tpos)
 
while True:
    data = raw_input().strip()
    if data == "0":
        break
    m, n = map(int, data.split())
    s = input()
    spos = [map(int, raw_input().split()) for _ in xrange(s)]
    t = input()
    tpos = [map(int, raw_input().split()) for _ in xrange(t)]
    print solve()

### FIXED CODE ###

#Deven-Eleven:
D = (((-1, -1), (0, -1), (1, 0), (0, 1), (-1, 1), (-1, 0)),
     ((0, -1), (1, -1), (1, 0), (1, 1), (0, 1), (-1, 0)))
def func(y, x):
    q = [(y, x, 0)]
    cover = [[-1] * m for _ in xrange(n)]
    while len(q) != 0:
        y, x, step = q.pop(0)
        if cover[y][x] >= 0:
            continue
        cover[y][x] = step
        for dx, dy in D[y % 2]:           
            ny, nx = y + dy, x + dx
            if 0 <= ny < n and 0 <= nx < m:
                q.append((ny, nx, step + 1))
    return cover
 
def solve():
    scover = [func(pos[1] - 1, pos[0] - 1) for pos in spos]
    min_cover = [[min(sc[y][x] for sc in scover) for x in xrange(m)] for y in xrange(n)]
    def count(cover):
        ret = 0
        for y in xrange(n):
            for x in xrange(m):
                if cover[y][x] < min_cover[y][x]:
                    ret += 1
        return ret
    return max(count(func(pos[1] - 1, pos[0] - 1)) for pos in tpos)

while True:
    data = raw_input()
    m, n = map(int, data.split())
    if m == 0:
        break
    s = input()
    spos = [map(int, raw_input().split()) for _ in xrange(s)]
    t = input()
    tpos = [map(int, raw_input().split()) for _ in xrange(t)]
    print solve()
S, W = map(int, input().split())

if W >= S:
    print(undafe)
else:
    print(safe)


### FIXED CODE ###

S, W = map(int, input().split())

if W>=S:
    print("unsafe")
else:
    print("safe")
# B Frog 2

n, k = map(int, input().split())
h_list = [int(x) for x in input().split()]

dp = [float('Inf')] * 2*n
dp[0] = 0

for i in range(n):
    for j in range(1,k+1,1):
        dp[i+j] = min(dp[i+j], dp[i] + abs(h_list[i+j]-h_list[i]))

        
print(dp[n-1])

### FIXED CODE ###

# B Frog 2

n, k = map(int, input().split())
h_list = [int(x) for x in input().split()]

dp = [float('Inf')] * n
dp[0] = 0

for i in range(n):
    for j in range(1,k+1,1):
        if i - j < 0:
            continue
        dp[i] = min(dp[i], dp[i-j] + abs(h_list[i-j]-h_list[i]))

        
print(dp[n-1])
N = int(input())
d = {}
for _ in range(N):
    S = input()
    if S in l :
        d[S] += 1
    else :
        d[S] = 1

m = max(d.values())

for s in sorted(k for k in d if d[k]==m) :
    print(s)


### FIXED CODE ###

N = int(input())
d = {}
for _ in range(N):
    S = input()
    if S in d :
        d[S] += 1
    else :
        d[S] = 1

m = max(d.values())

for s in sorted(k for k in d if d[k]==m) :
    print(s)
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

a = V*T+A
b = W*T+B

if V >= W:
    if abs(A-B)/(V-W) <= T:
        print("YES")
    else:
        print("NO")
else:
    print("NO")

### FIXED CODE ###

A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

a = V*T+A
b = W*T+B

if V > W:
    if abs(A-B)/(V-W) <= T:
        print("YES")
    else:
        print("NO")
else:
    print("NO")
s=input()[:int(input())].replace('1','')
print([s[0],1][s==''])

### FIXED CODE ###

s = input()
if set(s[:int(input())])=={'1'}:
  print(1)
else:
  for i in s:
    if int(i) > 1:
      print(int(i))
      break
a, b = map(int, input().split())

if a%2 == 1 .and. b%2 == 1:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

if __name__ == '__main__':
    a = input().split()
    if int(a[0])%2 == 1 and int(a[1])%2 == 1:
        print("Yes")
    else:
        print("No")
l,r = map(int,input().split())
b = sorted([i%2019 for i in range(l,min(r+1,l+2019))])
print(b[0]*b[1])

### FIXED CODE ###

N,A,B = map(int,input().split())
if N*A > B:
  print(B)
else:
  print(A*N)
a,b=(map(int,input().split())+13)%15;print('Alice' if a>b else 'Bob' if a<b else 'Draw')

### FIXED CODE ###

x,y=map(int,input().split())
a = (x + 13) % 15
b = (y + 13) % 15
print('Alice' if a > b else 'Bob' if a < b else 'Draw')
s = input()
n = len(s)

if n < 2:
    print(0)

else:
    ans, i = 0, 0
    rem = []

    while i < n:

        if not rem:

            if i+1 < n:
                if s[i] == s[i+1]:
                    rem.append(s[i])
                    i += 1

                else:
                    i += 2
                    ans += 2

            else:
                i += 1

        else:
            if rem[-1] != s[i]:
                rem.pop()
                i += 1
                ans += 2
            
            else:
                if i + 1 < n:
                    if s[i] == s[i+1]:
                        rem.append(s[i])
                        i += 1

                    else:
                        i += 2
                        ans += 2

                else:
                    i += 1
print(ans)


### FIXED CODE ###

#%%
s = input()
n = len(s)

if n < 2:
    print(0)

else:
    ans, i = 0, 0
    rem = []

    while i < n:

        if not rem:

            if i+1 < n:
                if s[i] == s[i+1]:
                    rem.append(s[i])
                    i += 1

                else:
                    i += 2
                    ans += 2

            else:
                i += 1

        else:
            if rem[-1] != s[i]:
                rem.pop()
                i += 1
                ans += 2
            
            else:
                if i + 1 < n:
                    if s[i] == s[i+1]:
                        rem.append(s[i])
                        i += 1

                    else:
                        i += 2
                        ans += 2

                else:
                    i += 1
    print(ans)
n = input()
ln = list(n)

for i in range(len(ln)):
    if ln[i] == '1':
        ln[i] = '9'
    elif ln[i] == '9':
        ln[i] = '1'
        
n = ''.join(ln)
print(n = ''.join(ln))

### FIXED CODE ###

n = input()
ln = list(n)
 
for i in range(len(ln)):
    if ln[i] == '1':
        ln[i] = '9'
    elif ln[i] == '9':
        ln[i] = '1'
        
n = ''.join(ln)
print(int(n))
import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
mod=10**9+7

n,k=map(int,input().split())
a=list(map(int,input().split()))
m=0
if k==0:
    m=int(math.log2(1)+1)
else:
    m=int(math.log2(k)+1)
lst=[0]*m
for i in range(n):
    for j in range(m):
        if a[i]&(1<<j):
            lst[j]+=1
# print(lst)

ans=0
ans2=0
for i in range(m):
    if lst[m-i-1]<=n/2 and ans+pow(2,m-i-1)<=k:
        ans+=pow(2,m-i-1)
# print(ans)
# print(ans2)
for i in range(n):
    ans2+=ans^a[i]

print(ans2)

### FIXED CODE ###

import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
mod=10**9+7

n,k=map(int,input().split())
a=list(map(int,input().split()))
m=0
if k==0:
    m=int(math.log2(1)+1)
else:
    m=int(math.log2(k)+1)
lst=[0]*m
for i in range(n):
    for j in range(m):
        if a[i]&(1<<j):
            lst[j]+=1
# print(lst)

ans=0
ans2=0
for i in range(m):
    if lst[m-i-1]<=n/2 and ans+pow(2,m-i-1)<=k:
        ans+=pow(2,m-i-1)
# print(ans)
# print(ans2)
for i in range(n):
    ans2+=ans^a[i]

print(ans2)
input()
A = list(map(int, input.split()))

sum = 0

for i in range(1, len(A)):
  if A[i] < A[i-1]:
    sum += A[i-1] - A[i]
    A[i] = A[i-1]
    
print(sum)


### FIXED CODE ###

input()
A = list(map(int, input().split()))

sum = 0

for i in range(1, len(A)):
  if A[i] < A[i-1]:
    sum += A[i-1] - A[i]
    A[i] = A[i-1]
    
print(sum)
A=map(int,input().split())
A.sort()
print(A[1]*A[2]//2)



### FIXED CODE ###

A=list(map(int,input().split()))
A.sort()
print(A[0]*A[1]//2)
a, b, x = map(int, input().split())
count = len(list(filter(lambda t: t % x == 0, list(range(a, b + 1)))))
print(count)

### FIXED CODE ###

a, b, x = map(int, input().split())
br = b//x
ar = (a-1)//x
print(br-ar)
# coding: utf-8
# Here your code !
import math

r = int(input())

print("{0:.8f} {1:.8f}".format(r ** 2 * math.pi,2 * math.pi * r))

### FIXED CODE ###

from math import pi

r = float(input())
print(r**2 * pi, 2 * r * pi)
a,b,c = map(int,input().split())
if a[-1]==b[0] and b[-1]==c[0]:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

a,b,c = map(str,input().split())
if a[-1]==b[0] and b[-1]==c[0]:
  print("YES")
else:
  print("NO")
import math

def gcd_list(numbers):
    gcdv = numbers[0]
    for n in range(1, len(numbers)):
        gcdv = math.gcd(gcdv, numbers[n])
    return gcdv

def main():
    n = int(input())
    a = [int(a) for a in input().split()]

    maxv = 0
    for nn in range(n):
        gcdv = gcd_list(a[:nn]+a[nn+1:])
        if gcdv > maxv:
            maxv = gcdv
    print(maxv)

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import math
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

def input(): return sys.stdin.readline()[:-1]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def MAT(h): return [list(map(int, input().split())) for _ in range(h)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    N = INT()
    A = LIST()
    L = [0] * N
    R = [0] * N
    M = [0] * N
    for i in range(N - 1):
        L[i + 1] = gcd(L[i], A[i])
        R[N - i - 2] = gcd(R[N - i - 1], A[N - i - 1])
    maxv = 0
    for i in range(N):
        M[i] = gcd(L[i], R[i])
        if maxv < M[i]:
            maxv = M[i]
    print(maxv)

if __name__ == '__main__':
    main()
a,b,c,x,y = map(int,input().split())
if 2*c-a-b >= 0:
  print(a*x+b*y)
else:
  s = 0
  if x => y:
    s += 2*c*x
    x -= y
    s += min(2*c,a)*x
    print(s)
  else:
    s += 2*c*y
    y -= x
    s += min(2*c,b)*y
    print(s)

### FIXED CODE ###

a,b,c,x,y = map(int,input().split())
if 2*c-a-b >= 0:
  print(a*x+b*y)
else:
  s = 0
  if x >= y:
    s += 2*c*y
    x -= y
    s += min(2*c,a)*x
    print(s)
  else:
    s += 2*c*x
    y -= x
    s += min(2*c,b)*y
    print(s)
def d_c(s):
  count = 0
  x = ''
  for i in range(len(s)):
    if x == s[0]:
      count += 1
      x = ''
    else:
      x = s[0]
    s = s[1:]
  return count

s = input()
k = int(input())
if s[0]==s[-1]:
  print(d_c(s*k))
else:
  print(d_c(s)*k)

### FIXED CODE ###

def d_c(s):
  count = 0
  x = ''
  for i in range(len(s)):
    if x == s[0]:
      count += 1
      x = ''
    else:
      x = s[0]
    s = s[1:]
  return count
 
def num_con(s):
  x = s[0]
  s = s[1:]
  count = 1
  for i in range(len(s)):
    if s[0] == x:
      count += 1
      x = s[0]
      s = s[1:]
    else:
      break
  return count
      
    
s = input()
k = int(input())
 
if len(s)==1:
  print(k//2)
elif num_con(s)==len(s):
  print((len(s)*k)//2)
elif s[0]==s[-1]:
  f = num_con(s)
  m = num_con(s[::-1])
  dis = (f//2 + m//2 - (f+m)//2)*(k-1)
  print(d_c(s)*k-dis)
else:
  print(d_c(s)*k)
stay = int(input())
change_day = int(input())
first_cost = int(input())
change_cost = int(input())
total_cost = 0
 
for i in range(stay):
 if(i < change_day):
  total_cost += first_cost
 else:
  total_cost += change_cost
print(total_cost)

### FIXED CODE ###

number = int(input())
total = 0

for i in range(number+1):
 total += i

print(total)
def main():
    s=input()
    c=0
    for i in range(len(s)):
        for j in range(i+5, len(s)+1):
            if int(s[i:j])%2019==0:
                c+=1
    print(c)
main()

### FIXED CODE ###

def main():
    s,w=map(int,input().split())
    print('unsafe' if w>=s else 'safe')
main()
def ans(n, AA, x):
    tmp = n + AA[0]
    if len(AA) == 1:
        try: x[tmp] = 1
        except: pass
    else:
        ans(n, AA[1:], x)
        try:
            x[tmp] = 1
            ans(tmp, AA[1:],x)
        except:
            pass
    return
 
n = raw_input()
A = map(int, raw_input().split())
q = raw_input()
M = map(int, raw_input().split())
 
x = [0 for i in range(max(M)+1)]
f3(0, A, x)
 
for e in M:
    if x[e] == 1:
        print 'yes'
    else:
        print 'no'

### FIXED CODE ###

def ans(n, AA, x):
    tmp = n + AA[0]
    if len(AA) == 1:
        try: x[tmp] = 1
        except: pass
    else:
        ans(n, AA[1:], x)
        try:
            x[tmp] = 1
            ans(tmp, AA[1:],x)
        except:
            pass
    return
 
n = raw_input()
A = map(int, raw_input().split())
q = raw_input()
M = map(int, raw_input().split())
 
x = [0 for i in range(max(M)+1)]
ans(0, A, x)
 
for e in M:
    if x[e] == 1:
        print 'yes'
    else:
        print 'no'
a=int(input())
b=int(input())

c=a*b
d=2*a+2*b

print(str(c)+" "+str(d))



### FIXED CODE ###

l = input().split()

a=int(l[0])*int(l[1])
b=2*int(l[0])+2*int(l[1])

print(str(a)+" "+str(b))
a,b=map(int,input().split());a,b=(a+11)%13,(b+11)%13
if a>b:print("Alice");else:print("Bob")

### FIXED CODE ###

a,b=map(int,input().split());a,b=(a+11)%13,(b+11)%13
if a>b:print("Alice")
elif a==b:print("Draw")
else:print("Bob")
N = int(input)
print(N^3)

### FIXED CODE ###

N = int(input())
print(N*N*N)
N = int(input())
graph = {}
root = -1
for n in range(N-1):
    u, v, w = map(int, input().split())
    u -= 1
    v -= 1

    if root == -1:
        root = u
    if u not in graph:
        graph[u] = {}
    if v not in graph:
        graph[v] = {}
    graph[u][v] = w
    graph[v][u] = w    

answer = [-1] * N
def search(node, depth):
    answer[node] = depth
    for n in graph[node]:
        if answer[n] == -1:
            search(n,depth + graph[node][n])
if N == 1:
    print('0')
else:
    search(root, 0)
    for a in answer:
        print('0' if a % 2 else '1')

### FIXED CODE ###

N, K = map(int, input().split())
S = input()

S = S[:K-1] + S[K-1].lower() + S[K:]

print(S)
x = input()

if -40 <= x and x <= 40:
    if x >= 30:
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

x = int(input())

if -40 <= x and x <= 40:
    if x >= 30:
        print("Yes")
    else:
        print("No")
import sys
import math
a, b, x = [int(i) for i in sys.stdin.readline().split()]
if x < a**2*b / 2:
    print(90.0 - math.degrees(math.atan(x / (a*b**2/2))))
else:
    print(90.0 - math.degrees(math.atan(a**3 / 2 / (a**2*b-x))))

### FIXED CODE ###

import sys
import math
a, b, x = [float(i) for i in sys.stdin.readline().split()]

if x < a**2*b / 2:
    print(90.0 - math.degrees(math.atan(x / (a*b**2/2))))
elif a**2*b-x == 0:
    print(0.0)
else:
    print(90.0 - math.degrees(math.atan(a**3 / 2 / (a**2*b-x))))
a b c = map(int, input().split())

if a<=c and c<=b:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a, b, c = map(int, input().split())
 
if a<=c and c<=b:
    print("Yes")
else:
    print("No")
N = int(input())
S = input()

pair_cnt = S.count("()")
head_cnt = S.count("(") - pair_cnt
tail_cnt = S.count(")") - pair_cnt

res = S
res = tail_cnt * "(" + res
res = res + head_cnt * ")"

print(res)


### FIXED CODE ###

indata = [int(i) for i in input().split()]

a = indata[1]*10 + indata[2]*1
if a % 4 == 0:
    print("YES")
else:
    print("NO")
k,a,b=[int(p) for p in input().split()]
if(a+2>=b or (k)/(a+2)<1 or 2*a+2==b):
    print(k+1)
elif(2*a+2>b):
    print(1+k+(int((1+k)/(2*a-b+2)))*(b-a-2))
else:
    print(1+k+(int((1+k-a)/2))*(b-a-2))

### FIXED CODE ###

nk=[int(x) for x in input().split()]
if(nk[0]>=2*nk[1]-1):
    print("YES")
else:
    print("NO")
n=int(input())
a=list(map(int,input().split()))
a.sort()

c4=0
c2=0

for i in range(n):
    if a[i]%4==0:
        c4+=1
for i in range(n):
    if a[i]%4!=0 and a[i]%2==0:
        c2+=1

if n<=2*c4 + c2
    print('Yes')
else:
    print('No')

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
c4=0
c2=0

for i in range(n):
    if a[i]%4==0:
        c4+=1
for i in range(n):
    if a[i]%2==0:
        c2+=1

if n<=(2*c4 + max(1,c2-c4)):
    print('Yes')
else:
    print('No')
if len(set([int(x) for x in input().split("")])) = 2:
  print("yes")
else:
  print("No")

### FIXED CODE ###

lst = [int(i) for i in input().split(" ")]

if len(set(lst)) == 2:
  print("Yes")
else:
  print("No")