Harryxun/stf_run huggingface dataset:
n = int(input())
if n % 3:
    ans = 'No'
else:
    a = sorted(map(int, input().split()))
    m = n // 3
    if a[0] ^ a[m] ^ a[2 * m]:
        ans = 'No'
    elif any(x != y for i, x, y in enumerate(zip(a, a[1:]), 1) if i % m):
        ans = 'No'
    else:
        ans = 'Yes'
print(ans)


### FIXED CODE ###

R = lambda: map(int, input().split())

n = int(input())
if n % 3:
    ans = 'YNeos'[any(R())::2]
else:
    a = sorted(map(int, input().split()))
    m = n // 3
    if a[0] ^ a[m] ^ a[2 * m]:
        ans = 'No'
    elif any(len(set(a[i:i + m])) > 1 for i in range(0, n, m)):
        ans = 'No'
    else:
        ans = 'Yes'
print(ans)
CODE

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
i, j = b[n // 2 - 1], b[n // 2]
for x in a:
    if x <= i:
        print(j)
    else:
        print(i)
#反例　459 = 216 * 1 + 81 * 3
N = int(input())

count = 0

flag = True
a = N
while flag:
    if a//6 != 0:
        count += 1
        a = a//6
    else:
        flag = not flag

lst = []
for i in range(count+1):
    if (6 ** i)<= N:
        lst += [6 ** i]
        if   (9 ** i)<=N:
            lst += [9 ** i]

lst.sort(reverse = True)
#print (lst)

def hikidashi(j, n): #j番目より小さい数でnまで引き出すときの最小
    if j == len(lst):
        return n #残りをすべて1で埋める場合
    elif lst[j] > n: #引き出したい数 > 残額の時
        return hikidashi(j+1, n)
    else:
        a = hikidashi(j+1, n) #使わずに次の番目に行く
        b = hikidashi(j, n-lst[j]) + 1 #一つ使う
        return min (a, b)

print (hikidashi(0, N))





### FIXED CODE ###

#DP　動的計画法

N = int(input())

INF = 10 ** 9
dp = [INF] * (N+1) #初期化配列

dp[0] = 0
for n in range(1, N+1):
    power = 1
    while power <= N:
        dp[n] = min(dp[n], dp[n-power]+1)
        power *= 6
    power = 1
    while power <= N:
        dp[n] = min(dp[n], dp[n-power]+1)
        power *= 9

#print (dp)
print (dp[N])
a=list(str(input()))
l=[0,1,2]
for i in a:
  for j in l:
    if i == '7':
      print('Yes')
      break
    else if l == 2:
      print('No')

### FIXED CODE ###

a = str(input())
if '7' in a:
  print('Yes')
else:
  print('No')
#二分法による非線型方程式の解法プログラム
import numpy as np  #数値計算用モジュール

#解きたい方程式
def func_f(A,B,x):
    return -(int(A*x/B)-A*int(x/B))


#二分法（方程式の関数項、探索区間の左端、探索区間の右端、誤差範囲、最大反復回数）
def bisection(func_f, x_min, x_max, A, B, error=1e-10, max_loop=100):
    #初期値を表示
    num_calc = 0  #計算回数
    #print("{:3d}:  {:.15f} <= x <= {:.15f}".format(num_calc, x_min, x_max))
    
    #中間値の定理の条件を満たすか調べる
    if(0.0 < func_f(A,B,x_min)*func_f(A,B,x_max)):
        #print("error: Section definition is invalid (0.0 < func_f(x_min)*func_f(x_max)).")
        quit()

    #ずっと繰り返す
    while(True):
        #新たな中間値の計算
        x_mid = (x_max +x_min)/2.0
        
        x_mid_max = (x_max +x_mid)/2.0
        x_mid_mim = (x_min +x_mid)/2.0
        
        #探索区間を更新
        if func_f(A,B,x_max) < func_f(A,B,x_mid):
            x_min = x_mid
        elif func_f(A,B,x_min) < func_f(A,B,x_mid):
            x_max = x_mid
        elif func_f(A,B,x_mid_max) < func_f(A,B,x_mid_mim):  #中間と右端の値が同じの時
            x_max = x_mid  #右端を更新
        else:  #中間と左端の値が同じの時
            x_min = x_mid  #左端を更新
        
        #結果を表示
        num_calc += 1  #計算回数を数える
#print("{:3d}:  {:.15f} <= x <= {:.15f}".format(num_calc, x_min, x_max))
        
        #「誤差範囲が一定値以下」または「計算回数が一定値以上」ならば終了
        if((x_max-x_min <= error) or max_loop <= num_calc):
            break

    #最終的に得られた解
    #print("x = {:.15f}".format(x_mid))

    return x_mid


#メイン実行部
if (__name__ == '__main__'):
    A,B,N=(int(x) for x in input().split())
    #二分法で非線型方程式の解を計算
    solution = bisection(func_f, 0, N,A,B)
    print(-func_f(A,B,solution))


### FIXED CODE ###

check=0
K=int(input())
A,B = (int(x) for x in input().split())
if (A>=K and A%K == 0) or (B>=K and B%K==0):
    print('OK')
elif B-A>=K:
    print('OK')
else:
    for i in range(A,B+1,1):
        if i%K == 0:
            check=1
            break
    if check == 1:
        print('OK')
    else:
        print('NG')
from sys import setrecursionlimit as srl; srl(10**7)
rr = lambda: int(raw_input())
rrm = lambda: map(raw_input().split())



A,B,C = rrm()
if A==B!=C or A==C!=B or B==C!=A:
    print "Yes"
else:
    print "No"

### FIXED CODE ###

from sys import setrecursionlimit as srl; srl(10**7)
rr = lambda: int(raw_input())
rrm = lambda: map(int, raw_input().split())
 
A,B,C = rrm()
if A==B!=C or A==C!=B or B==C!=A:
    print "Yes"
else:
    print "No"
import math

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

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append(i)
    if temp!=1:
        arr.append(temp)
    return arr

d = math.gcd(a,b)
print(len(factorization(d)) + 1)



### FIXED CODE ###

from fractions import gcd

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

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append(i)

    if temp!=1:
        arr.append(temp)

    return arr
  
d = gcd(a,b)
print(len(factorization(d)) + 1)
S = input()
T = input()
count = 0
for i in len(S):
    if S[i] != T[i]
        count+= 1
print(count)
    


### FIXED CODE ###

S = input()
T = input()
count = 0
for i in range(len(S)):
    if S[i] != T[i]:
        count+= 1
print(count)
choise = input()
week = {'SUN':7, 'MUN':6, 'TUE':5, 'WED':4, 'THU':3, 'FRI':2, 'SAT':1}
print(week[choise])

### FIXED CODE ###

week = { 'SUN': 7, 'MON': 6, 'TUE': 5, 'WED': 4, 'THU': 3, 'FRI': 2, 'SAT': 1 }
print(week[input()])
N, Y = map(int, input().aplit())
boolean = False
for i in range(N+1):
    for j in range(N+1-i):
        if (Y - 10000 * i + 5000 * j) % 1000 == N:
            boolean = True

if boolean:
    print(i, j, N - i - j)
else:
    print(-1, -1, -1)

### FIXED CODE ###

N, Y = map(int, input().split())
boolean = False
for i in range(N+1):
    if boolean:
        break
    for j in range(N+1-i):
        if (Y - 10000 * i - 5000 * j) / 1000 == (N - i - j):
            boolean = True
            print(i, j, N - i - j)
            break

if not boolean:
    print(-1, -1, -1)
a, b = map(int, input().spkit())
print((a - 1) * (b - 1))

### FIXED CODE ###

a, b = map(int, input().split())
print((a - 1) * (b - 1))
a,b,c,d=map(int,input().split())
if a*b>=c*d:
    print(a*b)
else:
    primt(c*d)

### FIXED CODE ###

a,b,c,d=map(int,input().split())
if a*b>=c*d:
    print(a*b)
else:
    print(c*d)
a, b = input().split()

if (a * b) % 2 == 0:
    print('Even')
else:
    print('odd')


### FIXED CODE ###

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

if c % 2 == 0:
  print('Even')
else:
  print('Odd')
N, D = (int(a) for a in input().split())
X2Y2 = [[int(a) ** 2 for a in input().split()] for b in range(N)]
X2, Y2 = [list(i) for i in zip(*X2Y2)]

c = 0
DD = D ** 2
for i in range(N):
    if X2[i] + Y2[i] <= DD:
        c += 1
print(c)

### FIXED CODE ###

K = int(input())
if (K % 5 == 0) | (K % 2 == 0):
  print(-1)

else:
  a = 7
  for i in range(K):
    if a % K == 0:
      print(i + 1)
      exit()
    a = (10 * a + 7) % K
  print(-1)
import sys
from collections import deque
from collections import defaultdict

H, W,M = map(int, input().split())
h = [0] * M
w = [0] * M
mine = [[0] * W for i in range(H)]
for i in range(M):
    x, y = map(int, input().split())
    w[x-1] += 1
    h[y-1] += 1
    mine[x-1][y-1] = 1

w_max = max(w)
h_max = max(h)

w_list = []
h_list = []
for i in range(M):
    if w[i] == w_max:
        w_list.append(i)
    if h[i] == h_max:
        h_list.append(i)

for y in h_list:
    for x in w_list:
        if mine[y][x] == 0:
            print(w_max + h_max)
            sys.exit()

print(w_max+h_max-1)

### FIXED CODE ###

import sys


H, W, M = map(int, input().split())
bomb = [tuple(map(lambda x: int(x) - 1, s.split())) for s in sys.stdin.readlines()]
X = [0] * H  # X:各行の爆破対象の個数
Y = [0] * W  # Y:各列の爆破対象の個数
for h, w in bomb:
    X[h] += 1
    Y[w] += 1
maxX = max(X)
maxY = max(Y)

R = [h for h, x in enumerate(X) if x == maxX]  # R:爆破対象の数が最大となる行の番号
C = [w for w, y in enumerate(Y) if y == maxY]  # C:爆破対象の数が最大となる列の番号

bomb = set(bomb)
for r in R:
    for c in C:
        # (r, c)に爆破対象が存在しないとき, maxX + maxY が答えとなることが確定するため, 
        # 即座に探索を終了する.
        if (r, c) not in bomb:
            print(maxX + maxY)
            exit()
print(maxX + maxY - 1)
s = input()
print(''.join(s[0], str(len(s) - 2), s[-1]))


### FIXED CODE ###

s = input()
print('{}{}{}'.format(s[0], str(len(s) - 2), s[-1]))
n=int(input())
a=list(map(int,input().split()))
b=sorted(a)
p,q=b[n//2-1],b[n//2+1]
for i in a:print(p if i>=q else q)


### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
b=sorted(a)
p,q=b[n//2-1:n//2+1]
for i in a:print(p if i>=q else q)
s = input()
if(len(s) != 26):
    for c in range(ord('a'), ord('z')+1):
        c = chr(c)
        if(not c in s):
            print(s+c)
            exit()
s = list(s)
t = []
while(True):
    for c in t:
        if(c > s[-1]):
            print(''.join(s[:-1]) + c)
            exit()
    t.append(s.pop())


### FIXED CODE ###

s = input()
if(len(s) != 26):
    for c in range(ord('a'), ord('z')+1):
        c = chr(c)
        if(not c in s):
            print(s+c)
            exit()
s = list(s)
t = []
while(s):
    for c in t:
        if(c > s[-1]):
            print(''.join(s[:-1]) + c)
            exit()
    t.append(s.pop())
print(-1)
r,g,b,n=map(int,input().split())
ans=0
for i in range((n//r)+1):
  for j in range(((n-r*i)//g+1)):
  	if (n-i*r-j*g)%b==0:
    	ans+=1
print(ans)


### FIXED CODE ###

r,g,b,n=map(int,input().split())
ans=0
for i in range((n//r)+1):
    for j in range(((n-r*i)//g+1)):
        if (n-i*r-j*g)%b==0:
            ans+=1
print(ans)
a,b = map(int,input().split()) 
c=
 
if (a*b)%2==0:
  print("even")
else:
  print("odd")


### FIXED CODE ###

a, b = map(int, input().split())
 
if (a * b) % 2 == 0:
    print("Even")
elif (a * b) % 2 != 0:
    print("Odd")
n = int(input())
a = sorted(list(map(int, input().split())))
print(a[n/2] - a[n/2-1])

### FIXED CODE ###

n = int(input())
a = sorted(list(map(int, input().split())))
print(a[n//2] - a[n//2-1])
a,b,x,y,s,m = map(int,input().split())

#a,b,x,y,s,m = (1,2,1,2,100,1000)
a *= 100
b *= 100

#入れられる水の候補
waterlist=[]
amax = int(m/a)
for i in range(amax+1):
  bmax = int((m-a*i)/b)
  for j in range(bmax+1):
    waterlist.append(a*i + b*j)
waterlist = set(waterlist)

#砂糖の組み合わせから最大を
def makesatolist(maxsato,x,y):
  satolist = []
  xmax = int(maxsato/x)
  for i in range(xmax+1):
    ymax  = int((maxsato-x*i)/y)
    for j in range(ymax+1):
      satolist.append(x*i + y*j)
  return max(satolist)
  

nownodo = 0
ans = []
for i in waterlist:
  if i == 0:
    continue
 
  # iグラムの水に何グラムの砂糖まで解ける？
  maxsato = i * s/100
  if i + maxsato > m:
    maxsato = m - i

  sato = makesatolist(maxsato,x,y)
  satowater = i + sato
  nodo = sato / satowater
  if nodo > nownodo:
    nownodo = nodo
    ans = [satowater,sato]

print(ans[0]," ",ans[1])

### FIXED CODE ###

a,b,x,y,s,m = map(int,input().split())

#a,b,x,y,s,m = (1,2,1,2,100,1000)
a *= 100
b *= 100

#入れられる水の候補
waterlist=[]
amax = int(m/a)
for i in range(amax+1):
  bmax = int((m-a*i)/b)
  for j in range(bmax+1):
    water = a*i + b*j
    if water:
      waterlist.append(a*i + b*j)
waterlist = set(waterlist)

#砂糖の組み合わせから最大を
def makesatolist(maxsato,x,y):
  satolist = []
  xmax = int(maxsato/x)
  for i in range(xmax+1):
    ymax  = int((maxsato-x*i)/y)
    for j in range(ymax+1):
      satolist.append(x*i + y*j)
  return max(satolist)
  
nownodo = 0
ans = [0] * 2
for i in waterlist:
 
  # iグラムの水に何グラムの砂糖まで解ける？
  maxsato = i * s/100
  if i + maxsato > m:
    maxsato = m - i

  sato = makesatolist(maxsato,x,y)
  satowater = i + sato
  nodo = sato / satowater
  if nodo >= nownodo:
    nownodo = nodo
    ans = [satowater,sato]

print(ans[0]," ",ans[1])
T  = int(input())
def gcd(a,b):
 if b==0: return a
 return gcd(b, a%b)
for _ in range(T):
 a,b,c,d =list( map(int, input().split()) )
 a %= b
 d%=b
 d = gcd(d,b)
 if c>= b:
  print('Yes')
  continue
 x = (b-a)//d
 y = a+ x*d
 if y == b: y-=d
 if y>=c:
  print('No')
 else:
  print('Yes')

### FIXED CODE ###

N  = int(input())
za = list( map(int, input().split()) )
res = 0
for i in range(1,N):
 if za[i]==za[i-1]:
  za[i] = -1
  res+=1

print(res)
n=int(input())
s = list(map(int, input().split()))
z=[]*n
for  i in range(len(s)):
    z[s[i]-1]+=1
for j in range(n):
    print(z[j])

### FIXED CODE ###

n=int(input())
s = list(map(int, input().split()))
z=[0]*n
for  i in range(len(s)):
    k=s[i]-1
    z[k]+=1
for j in range(n):
    print(z[j])
t=list(input())
n=len(t)
if t[0]=="?":
    if t[1]=="P":
            t[i]="D"
    if t[1]=="D":
            t[i]="P"
for i in range(1,n):
    if t[i]=="?":
        if t[i-1]=="P":
            t[i]="D"
        if t[i-1]=="D":
            t[i]="P"
print("".join(t))

### FIXED CODE ###

t=list(input())
n=len(t)
for i in range(n):
    if t[i]=="?":
        t[i]="D"
print("".join(t))
# -*- coding: utf-8 -*-
# !/usr/bin/env python
# vim: set fileencoding=utf-8 :

"""
#
# Author:   Noname
# URL:      https://github.com/pettan0818
# License:  MIT License
# Created:  2016-09-28
#

# Usage
#
"""
import sys

def input_single_line():
    """Receive Inputs."""
    return input()

def input_two_line():
    """Receive Two Lined Inputs.
    Like this.

    N
    1 2 3 4 5
    """
    sys.stdin.readline()
    target = sys.stdin.readline()
    target = target.rstrip("\n")
    target = target.split(" ")

    return target


def search_lovers(target_list: list) -> None:
    """Search Simple."""
    lovers = []
    for i in target_list:
        if target_list[i-1] == i-1:
            lovers.append(i-1)

    print(len(lovers))


if __name__ == "__main__":
    import doctest
    doctest.testmod()

    target = input_two_line()

    search_lovers(target)



### FIXED CODE ###

# -*- coding: utf-8 -*-
# !/usr/bin/env python
# vim: set fileencoding=utf-8 :

"""
#
# Author:   Noname
# URL:      https://github.com/pettan0818
# License:  MIT License
# Created:  2016-09-28
#

# Usage
#
"""
import sys

def input_single_line():
    """Receive Inputs."""
    return input()

def input_two_line():
    """Receive Two Lined Inputs.
    Like this.

    N
    1 2 3 4 5
    """
    sys.stdin.readline()
    target = sys.stdin.readline()
    target = target.rstrip("\n")
    target = target.split(" ")

    return target


def search_lovers(target_list: list) -> None:
    """Search Simple.
    >>> target_list = [2, 3, 1]
    >>> search_lovers(target_list)
    0
    >>> target_list = [2, 1, 4, 3]
    >>> search_lovers(target_list)
    2
    >>> target_list = [5, 5, 5, 5, 1]
    >>> search_lovers(target_list)
    1
    """
    target_list = [int(i) - 1 for i in target_list]
    lovers = []
    ans = 0
    for i, n in enumerate(target_list):
        if target_list[n] == i:
            ans = ans + 1

    print(int(ans/2))


if __name__ == "__main__":
    import doctest
    doctest.testmod()

    target = input_two_line()

    search_lovers(target)
n=int(input())
yr_m=[]
sum_m=0
for i in range(n):
  yr_m.append(list(map(float,input().split())))

  
for j in range(n):
  if yr_m[j][1]=="BTC":
    yr_m[j][0]=yr_m[j][0]*380000.0
  sum_m=sum_m+yr_m[j][0]

print(sum_m)


### FIXED CODE ###

n=int(input())
yr_m=[]
sum_m=0
for i in range(n):
    yr_m.append(list(map(str,input().split())))

for k in range(n):
    yr_m[k][0]=float(yr_m[k][0])

for j in range(n):
    if yr_m[j][1]=="BTC":
        yr_m[j][0]=yr_m[j][0]*380000.0
    sum_m=sum_m+yr_m[j][0]

print(sum_m)
N, M, R = map(int, input().split())
r = list(map(int, input().split()))
abc = [list(map(int, input().split())) for _ in range(M)]

cost = [[float('inf')] * N for _ in range(N)]
for i in range(M):
    a, b, c = abc[i][0], abc[i][1], abc[i][2]
    cost[a-1][b-1] = c
    cost[b-1][a-1] = c

from scipy.sparse.csgraph import floyd_warshall
dist = floyd_warshall(cost)

mindist = float('inf')
import itertools
for it in itertools.permutations(r):
    it = list(it)
    d = 0
    for i in range(R - 1):
        d += int(dist[it[i]-1][it[i+1]-1])
    # print(it)
    mindist = min(mindist, d)
print(mindist)


### FIXED CODE ###

N, M, R = map(int, input().split())
r = list(map(int, input().split()))
abc = [list(map(int, input().split())) for _ in range(M)]

cost = [[float('inf')] * N for _ in range(N)]
for i in range(M):
    a, b, c = abc[i][0], abc[i][1], abc[i][2]
    cost[a-1][b-1] = c
    cost[b-1][a-1] = c

from scipy.sparse.csgraph import floyd_warshall
dist = floyd_warshall(cost)

mindist = float('inf')
import itertools
for it in itertools.permutations(r):
    it = list(it)
    d = 0
    for i in range(R - 1):
        d += int(dist[it[i]-1][it[i+1]-1])
    # print(it)
    mindist = min(mindist, d)
print(mindist)
S=int(input())
a=S//500
b=S%500
c=b//5
print(a*1000+c*5)


### FIXED CODE ###

S = input()
if S[2] == S[3] and S[4] == S[5]:
  print('Yes')
else:
  print('No')
count_ac=0
count_wa=0
count_tle=0
count_re=0
n=int(input())
for i in range(n):
    d=input()
    if s == "AC":
        count_ac += 1
    elif s == "WA":
        count_wa += 1
    elif s == "TLE":
        count_tle += 1
    else:
        count_re += 1
print("AC x "+str(count_wa))
print("WA x "+str(count_ac))
print("TLE x "+str(count_tle))
print("RE x "+str(count_re))

### FIXED CODE ###

count_ac=0
count_wa=0
count_tle=0
count_re=0
n=int(input())
for i in range(n):
    s=input()
    if s == "AC":
        count_ac += 1
    elif s == "WA":
        count_wa += 1
    elif s == "TLE":
        count_tle += 1
    else:
        count_re += 1
print("AC x "+str(count_ac))
print("WA x "+str(count_wa))
print("TLE x "+str(count_tle))
print("RE x "+str(count_re))
s = input()
t = input()
ss = s+s+s
f=0
for i in range(len(s)):
    if ss[i:len(s)+i] == t:
    f = 1
if f:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

s = input()
t = input()
ss = s+s
f=0
for i in range(len(s)):
    if ss[i:len(s)+i] == t:
        f = 1
if f:
    print("Yes")
else:
    print("No")
# -*- coding: utf-8 -*-
import numpy as np
from numpy.linalg import solve

n = int(input())
a = np.array(list(map(int, input().split())))
a = a*2

x = np.identity(n)
x[::][1:] += x[::][:n-1]
x = x.T
x[n-1][0] += 1

print(" ".join(solve(x, a).astype(np.int64).astype('str')))


### FIXED CODE ###

# -*- coding: utf-8 -*-
n = int(input())
a = list(map(int, input().split()))

x = [0 for _ in range(n)]
_x = 0
for i, _a in enumerate(a):
    if i % 2 == 0:
        _x += _a
    else:
        _x -= _a

x[0] = _x

for i in range(1, n):
    x[i] = a[i-1] * 2 - x[i-1]

print(" ".join(map(str, x)))
import sys

n, m = map(int, input().split())
nums = []

for i in range(n):
    nums.append(i + 1)

for i in range(m):
    l, r = map(int, input().split())
    nums = list(filter(lambda x: l <= x <= r, nums))
    if len(nums) == 0:
        print(0)
		sys.exit()

print(len(nums))


### FIXED CODE ###

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

if a >= 13:
    print(b)
elif 6 <= a <= 12:
    print(int(b/2))
else:
    print(0)
X,N=map(int,input().split())
if N>0:
    p=list(map(int,input().split()))
else:
    print(X)
    exit()
l=[]
for i in range(1,101):
    l.append(i)
for i in p:
    if i in l:
        l.pop(l.index(i))
L=list(map(lambda x:abs(X-x), l))
m=min(L)
if X-m in l:
    print(X-m)
else:
    print(X+m)
















        


























            
    


    


    
    














    


    














### FIXED CODE ###

X,N=map(int,input().split())
if N>0:
    p=list(map(int,input().split()))
else:
    print(X)
    exit()
if X not in p:
    print(X)
    exit()
Y=X
Z=X
s=0
t=0
while s==0:
    Y+=1
    if Y not in p:
        break
while t==0:
    Z-=1
    if Z not in p:
        break
if abs(X-Y)<abs(X-Z):
    print(Y)
elif abs(X-Y)>abs(X-Z):
    print(Z)    
else:
    print(Z)
word1,word2,word3 = map(str,input().split())
if word1[-1] == word2[1] and word1[-1] == word2[1]:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

word1,word2,word3 = map(str,input().split())
if word1[-1] == word2[0] and word2[-1] == word3[0]:
  print("YES")
else:
  print("NO")
inp = input()
inp = input()
 
def mp(nums):
  n = 1
  limit= 10 ** 10
  for num in nums:
    n *=num
  	if num > limit:
  		print(-1)
  		return
  print(num)
  return
 
mp([int(x) for x in inp.split(" ")])
 

### FIXED CODE ###

inp = input()
inp = input()
 
def mp(nums):
  if 0 in nums:
    print(0)
    return
  n = 1
  limit = 10**18
  for num in nums:
    n *=num
    if n > limit:
      print(-1)
      return
  print(n)
 
mp([int(x) for x in inp.split(" ")])
A,B=map(int,input().split())
if A<=2*B:
  print(0)
else A>2*B:
  print(A-(2*B))

### FIXED CODE ###

A,B=map(int,input().split())
if A<=2*B:
  print(0)
else :
  print(A-(2*B))
s = input()
l=len(s)-2
t=f'{s[0]}{l}{s[l+1]}'
print(t)

### FIXED CODE ###

s = input()
l=len(s)-2
t=s[0]+str(l)+s[l+1]
print(t)
N = int(input())
A = list(map(int, input().split()))


for i in range(N):
    A[i] -= i + 1
    
A.sort()

min = A[int(N/2)]
max = A[int(N/2)+1]+1
sad = 2e15
for b in range(min, max):
    s = 0
    for i in range(N):
        s += abs(A[i] - b)

    if s < sad:
        sad = s

print("{}".format(sad))    


### FIXED CODE ###

import statistics
N = int(input())
A = list(map(int, input().split()))

for i in range(N):
    A[i] -= i + 1

b = int(statistics.median(A))
sad = 0
for i in A:
    sad += abs(i - b)
print(sad)
from operator import itemgetter
tik = [[1,2],[7,3],[4,4],[5,5],[3,5],[2,5],[9,6],[8,7],[6,6]]
dic = {"1":2,"7":3,"4":4,"5":5,"3":5,"2":5,"9":6,"8":7,"6":6}
n,k = map(int, input().split())
x = list(map(int, input().split()))
#print(x)
q = []
for i in range(k):
    q.append([x[i],dic[str(x[i])]])
#print(q)
q = sorted(q, key=itemgetter(1), reverse=False)
#print(q)
if (2 not in x or 7 not in x) and 4 in x and 6 in x:
    s = []
    p=0
    t = 0
    while n>0:
        #print(s)
        if n>=q[p][1]:
            n-=q[p][1]
            s.append(str(q[p][0]))
            t = 1
        elif t == 1:
            p+=1
            n+=int(dic[str(s[0])])
            s = s[1:]
        else:
            p+=1
else:

    s = []
    p=0
    t = 0
    while n>0:
        #print(s)
        if n>=q[p][1]:
            n-=q[p][1]
            s.append(str(q[p][0]))
            t = 1
        elif t == 1:
            n+=q[p][1]
            p+=1
            s.pop()
        else:
            p+=1

#print(s)
s.sort()
s=s[::-1]
print(''.join(s))

### FIXED CODE ###

from operator import itemgetter
tik = [[1,2],[7,3],[4,4],[5,5],[3,5],[2,5],[9,6],[8,7],[6,6]]
dic = {"1":2,"7":3,"4":4,"5":5,"3":5,"2":5,"9":6,"8":7,"6":6}

n,k = map(int, input().split())
x = list(map(int, input().split()))
dp = [0]+[-1]*(n+10)
q = []
for i in range(k):
    q.append([x[i],dic[str(x[i])]])

q = sorted(q, key=itemgetter(1), reverse=False)

s = []
p=0
t = 0
for i in range(n):
    for j in range(k):
        if i+q[j][1] <=n:
            if dp[i]!=-1:
            
                if  dp[i]==0:
                    ko = q[j][0]
                    dp[i+q[j][1]] = max(q[j][0],dp[i+q[j][1]])

                else:
                    ko = dp[i]+q[j][0]
                    dp[i+q[j][1]] = max(dp[i]*10+q[j][0], dp[i+q[j][1]])
        #if i+q[j][1] ==n:
            #print(dp[20])
s = list(str(dp[n]))
s.sort()
s = s[::-1]
print(''.join(s))
s=raw_input()
if s.islower():
    print('a')
else:
    print("A")





### FIXED CODE ###

s=input()
if s.islower():
    print('a')
else:
    print("A")
a=input()
b=int(input())
c=0
if a[0]!="1":
  print(a[0])
if a[0]=="1":
  for i in range(len(a)-1):
    if a[i]=="1" and a[i+1]=="1":
      c=c+1
    else:
      break
  if c>b:
    print(1)
  else:
    if c>=len(a):
      print(1)
    else:
      print(a[c+1])


### FIXED CODE ###

a=input()
b=int(input())
c=1
if a[0]!="1":
  print(a[0])
if a[0]=="1":
  for i in range(len(a)-1):
    if a[i]=="1" and a[i+1]=="1":
      c=c+1
    else:
      break
  if c>=b:
    print(1)
  else:
    print(a[c])
N,K = map(int,input().split())
S = input()

print(S[:k-1]+S[k-1].lower()+S[k:])

### FIXED CODE ###

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

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