Harryxun/stf_run huggingface dataset:
import copy

H, W = map(int, input().split())
A = [[]for j in range(H)]
white_num = 0
for i in range(H):
    S = input()
    A[i] = S
    for j in range(W):
        if A[i][j] == '.':
            white_num += 1

ans = 0
while white_num > 0:
    A_ = copy.deepcopy(A)
    ans += 1
    for y in range(H):
        for x in range(W):
            if A[y][x] == "#":
                for k in range(4):
                    nx = x + [1, 0, -1, 0][k]
                    ny = y + [0, 1, 0, -1][k]
                    if nx < 0 or ny < 0 or nx >= W or ny >= W:
                        continue
                    if A[ny][nx] == "." and A_[ny][nx] == ".":
                        A_[ny] = A_[ny][:nx] + "#" + A_[ny][nx+1:]
                        white_num -= 1
    A = A_
print(ans)

### FIXED CODE ###

from collections import deque

H, W = map(int, input().split())
que = deque()
A = [[0 for i in range(W)] for j in range(H)]
white_num = 0
for i in range(H):
    S = input()
    for j in range(W):
        if S[j] == '.':
            A[i][j] = -1
            white_num += 1
        elif S[j] == '#':
            A[i][j] = 0
            que.append([j, i])

ans = 0
while len(que) > 0:
    x, y = que.popleft()
    for k in range(4):
        nx = x + [1, 0, -1, 0][k]
        ny = y + [0, 1, 0, -1][k]
        if nx < 0 or ny < 0 or nx >= W or ny >= H:
            continue
        if A[ny][nx] == -1:
            que.append([nx, ny])
            A[ny][nx] = A[y][x] + 1
            ans = max(ans, A[ny][nx])
print(ans)
n = int(input())
# https://note.nkmk.me/python-prime-factorization/
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

table = [0] * n
for i in range(2, n+1):
  p = prime_factorize(i)
  for pi in p:
    table[pi] += 1
ans = 1
for t in table:
  ans *= t+1
print(ans)
  



### FIXED CODE ###

n = int(input())
mod = 10**9+7
# https://note.nkmk.me/python-prime-factorization/
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

table = [0] * (n+1)
for i in range(2, n+1):
  p = prime_factorize(i)
  for pi in p:
    table[pi] += 1
ans = 1
for t in table:
  ans = ans * (t+1) % mod
print(ans)
N, K = map(int, input().split())

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

dp = [float("inf")]*N
dp[0] = 0

for i in range(N):
    for j in range(i+1, N):
        if i+j <= N:
            dp[i+j] = min(dp[i]+abs(H[i+j]-H[i]), dp[i+j])

print(dp[N-1])

### FIXED CODE ###

import numpy as np

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

H = np.array(list(map(int, input().split())))

dp = np.zeros(N, dtype=int)

for i in range(1, N):
    start = max(0, i-K)
    dp[i] = min(dp[start:i]+np.abs(H[i]-H[start:i]))

print(dp[N-1])
c = [1,2,3]

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

c.remove(a)
c.remove(b)

c[0]

### FIXED CODE ###

c = [1,2,3]

a = int(input())
b = int(input())

c.remove(a)
c.remove(b)

print(c[0])
from sys import exit, stderr, stdin
input = stdin.readline
# setrecursionlimit(10**7)

def debug(var, name="hoge"):
    print(name +":" + str(type(var)) + " = " + repr(var), file=stderr)
    return


def main():
    N,M = [int(n) for n in input().split()]
    jobs = [[] for _ in range(10000)]
    v = 0
    for i in range(N):
        a,b = [int(n) for n in input().split()]
        if a <= M:
            jobs[b].append((a,b))
            v = max(v,b)
    jobs = jobs[:v+1]
    # 時間でソート(昇順)
    for i in range(v):
        jobs[i] = sorted(jobs[i])

    # debug(jobs, "(期限、価値) in [価値]")
    ans = 0
    jobs_k = len(jobs)-1

    while(M>0 or jobs_k != 0):
        for i in range(jobs_k,-1,-1):
            if len(jobs[i]) == 0:
                jobs.pop()
                if len(jobs)==0:
                    M = 0
                    break
                continue
            if jobs[i][-1][0] > M:
                jobs[i].pop()
            else:
                ans += jobs[i][-1][1]
                jobs[i].pop()
                M -= 1
                break
        jobs_k = max(len(jobs)-1,0)
    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

from sys import exit, stderr, stdin
input = stdin.readline
import heapq
# from collections import defaultdict
# setrecursionlimit(10**7)

def debug(var, name="hoge"):
    print(name +":" + str(type(var)) + " = " + repr(var), file=stderr)
    return


def main():
    N,M = [int(n) for n in input().split()]
    # {期限:価値}
    jobs = [[]]*N
    v = 0
    for i in range(N):
        jobs[i] = [int(n) for n in input().split()]
    # 価値降順→期間昇順
    jobs = sorted(jobs,key=lambda x:-x[1])
    jobs = sorted(jobs,key=lambda x:x[0])
    cur = 0
    ans = 0
    cand = []
    for i in range(1,M+1):
        while(cur < N and i >= jobs[cur][0]):
            heapq.heappush(cand,-jobs[cur][1])
            cur += 1
        if len(cand) != 0:
            ans -= cand[0]
            heapq.heappop(cand)
    print(ans)



if __name__ == "__main__":
    main()
import math

N, X = map(int, input().split())
x = list(map(int, input().split()))

min_distance = abs(x[0] - X)
for i in x[1:]: min_distance = math.gcd(abs(i - X), min_distance)

print(min_distance)


### FIXED CODE ###

import fractions

N, X = map(int, input().split())
x = list(map(int, input().split()))

min_distance = abs(x[0] - X)
for i in x: min_distance = fractions.gcd(abs(i - X), min_distance)

print(min_distance)
N = int(input())
A = [int(input()) for i in range(N)]
B = 0
for i in A:
    if A.count(i) != 0:
        if A.count(i)%2 == 1: 
            B += 1
        else:
            while i in A:A.remove(i)
print(B)

### FIXED CODE ###

N = input()
print('Yes' if '9' in N else 'No')
n,m = map(int,input().split())
l = [0]*n
for i in range(n):
  a,b = map(int,input().split())
  l[a-1] += 1
  l[b-1] += 1
for i in l:
  print(i)

### FIXED CODE ###

n,m = map(int,input().split())
l = [0]*n
for i in range(m):
  a,b = map(int,input().split())
  l[a-1] += 1
  l[b-1] += 1
for i in l:
  print(i)
n = [0]*3
for i in range(len(n)):
  n[i] = input()

tmp = n[0]
n[0] = n[1]
n[1] = tmp

tmp = n[0]
n[0] = n[2]
n[2] = tmp

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


### FIXED CODE ###

a,b,c=(int(x) for x in input().split())

a,b = b,a
a,c = c,a

print(a, b, c)
import fraction
from functools import reduce

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

print(reduce(fraction.gcd, a))

### FIXED CODE ###

from fractions import gcd
from functools import reduce

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

print(reduce(gcd, a))
a = str(input())
q = int(input())
s = [input().split() for i in range(q)]
for i in range(q):
    if int(s[i][0]) == 1 and len(a)>1:
        a = a[::-1]
    elif int(s[i][0])== 2 and int(s[i][1])==1:
        a=s[i][2]+a
    else:
        a=a+s[i][2]
print(a)

### FIXED CODE ###

a = str(input())
if a == 'AAA' or a == 'BBB':
    print('No')
else:
    print('Yes')
A,B,K = map(int,input().split())
tmp = list(range(A,B+1))
ans = []
flag = 1
for i in range(min([len(tmp),K])):
    ans.append(tmp[i])
for j in range(min([len(tmp),K])):
    ans.append(tmp[-j-1])
ans = sorted(list(set(ans)))
for k in range(len(ans)):
    print(ans[k])

### FIXED CODE ###

A,B,K = map(int,input().split())
if A == B:
    print(A)
else:
    if K > B - A:
        K = B - A
    tmp1 = list(range(A,A+K))
    tmp2 = list(range(B-K+1,B+1))
    ans = sorted(list(set(tmp1 + tmp2)))
    for i in ans:
        print(i)
#include<stdio.h>
int main()
{ char a[3],A=10,B=11,C=12,D=13,E=14,F=15; 
  int i; 
 
       gets(a);
         for(i=0;i<3;i++) 
          {if(a[i]=='A')
	        a[i]=10;
	         if(a[i]=='B')
	          a[i]=11;
	         if(a[i]=='C')
	        a[i]=12;
	         if(a[i]=='E')
	        a[i]=14;
	         if(a[i]=='F')
	        a[i]=15;
	         if(a[i]=='D')
	        a[i]=13;}
	     if(a[0]>a[2])
       {printf(">\n");}
        
        else if(a[0]==a[2])
       {printf("=\n");}
        
    	 else if(a[0]<a[2])
       {printf("<\n");}
       	
    
} 

### FIXED CODE ###

def main():
    while True:
        try:
            inputList = input().split()
            firstChar = inputList[0]
            secondChar = inputList[1]
            firstNum = ord(firstChar)
            secondNum = ord(secondChar)
            if(firstNum > secondNum):
                print(">")
            elif(firstNum < secondNum):
                print("<")
            elif(firstNum == secondNum):
                print("=")
        except:
            break
main()
k=int(input())
print((k/2)**2 if k%2==0 else ((k/2)-0.5)((k/2)+0.5))

### FIXED CODE ###

import math
k=int(input())
if k%2==0:
  print((k//2)**2)
else:
  a=int(math.floor(k/2))
  print(a*(a+1))
import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
import copy as cp
import sys
def sinput(): return sys.stdin.readline()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(): return list(imap())
def farr(): return list(fmap())
def sarr(): return sinput().split()

n,a = imap()
x = np.array(iarr()) - a

# dp[i][和 + NA]
# 本来のSの範囲は、n*(1-a)からn*(50-a)
# 負の数はdp半以外なのでNAたすと、1*nから50*N
# 和０のときは dp[n][0+NA]
dp = np.zeros((n+1, 50*n+1)).astype(int)
dp[0][n*a] = 1

for i in range(n):
    for s in range(2*n*a+1):
        dp[i+1][s] = dp[i][s] + dp[i][s-x[i]] if s-x[i]>=0 else dp[i][s]

ans = dp[n][n*a] - 1 #実際は初期条件の０個選ぶパターンを除外
print(ans)



### FIXED CODE ###

import numpy as np
import scipy.sparse as sps
import scipy.misc as spm
import collections as col
import functools as func
import itertools as ite
import fractions as frac
import math as ma
import copy as cp
import sys
def sinput(): return sys.stdin.readline()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(): return list(imap())
def farr(): return list(fmap())
def sarr(): return sinput().split()

n,a = imap()
x = np.array(iarr()) - a

# dp[i][和 + NA]
# 本来のSの範囲は、1N-NAから50N-NA
# 負の数はdp範囲外なのでNAたすと、1Nから50N
# 和０のときは dp[n][0+NA]
dp = np.zeros((n+1, 50*n+100)).astype(int)
dp[0][n*a] = 1

for i in range(n):
    for s in range(50*n+1):
        dp[i+1][s] = dp[i][s] + dp[i][s-x[i]] if s-x[i]>=0 else dp[i][s]

ans = dp[n][n*a] - 1 #実際は初期条件の０個選ぶパターンを除外
print(ans)
import collections
N=int(input())
S=input()
lis=list(S)
C= collections.Counter(lis)
count=list(C.values())
c=0
for i in range(N):
    for j in range(i,(N+i-1) // 2+1):
        if(lis[i]!=lis[j]):
            if(lis[j]!=lis[2*j-i]):
                if(lis[i]!=lis[2*j-i]):
                    c+=1
print(count[0]*count[1]*count[2]-c)


### FIXED CODE ###

import collections
N=int(input())
S=input()
lis=list(S)
C= collections.Counter(lis)
count=list(C.values())
c=0
for i in range(N):
    for j in range(i,(N+i-1) // 2+1):
        if(lis[i]!=lis[j]):
            if(lis[j]!=lis[2*j-i]):
                if(lis[i]!=lis[2*j-i]):
                    c+=1
if(len(count)==3):
    print(count[0]*count[1]*count[2]-c)
else:
    print(0)
a,b,c  = map (int, input().split())
if a < b && b < c:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

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

ans = False

for i in range(k):
	if c <= b:
      	c *= 2
    elif b <= a:
      	b *= 2
    else:
      	ans = True
        break

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

### FIXED CODE ###

a, b, c = list(map(int, input().split()))
k = int(input())
 
ans = False
 
for i in range(k):
    if c <= b:
        c *= 2
    elif b <= a:
        b *= 2
    else:
        ans = True
        break
if c > b and b > a:
    ans = True

if ans:
  	print("Yes")
else:
  	print("No")
a=int(input())
s=list(input())
t=[len(s)]
list=[chr(i) for i in range(65, 65+26)]
for i in s:
  t.append(list.index(i))
u=[i+a for i in t]
u=[i-26 if i>26 else i for i in u]
b=[]
for i in u :
  b.append(list[i])
k=""
for s in b:
  k+=s
print(k)

### FIXED CODE ###

a=int(input())
s=list(input())
t=[]
list=[chr(i) for i in range(65, 65+26)]
for i in s:
  t.append(list.index(i))
u=[i+a for i in t]
u=[i-26 if i>=26 else i for i in u]
b=[]
for i in u :
  b.append(list[i])
k=""
for s in b:
  k+=s
print(k)
a, b, c, x = map(int, [input() for i in range(4)])
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if i * 500 + j * 100 + k * 50 == x:
                ans += 1
print(ans)

### FIXED CODE ###

import math
n = input()
a = list(map(int, input().split()))
ans = float("inf")
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)
print(round(ans))
N = input()
list = [a for a in input().split()]
count = 0
for i in range(len(list)):
    if not list[i] == list.count(i):
        list.remove(list[i])
        count += 1
    if i == len(list)-1:
        break
print(count)
        

### FIXED CODE ###

N = int(input())
list = [int(a) for a in input().split()]
dict = dict()
for i in range(N):
    if list[i] in dict:
        dict[list[i]] += 1
    else:
        dict[list[i]] = 1
count = 0
for i, j in dict.items():
#    print(i, j) 
    if i <= j:
        count += j - i
    else:
        count += j
              
print(count)
n=int(input())
p=input().split()
q=input().split()
N=[i for i in range(1,n+1)]
def kaijou(x):
    if x==1:
        return 1
    if x==2:
        return 2
    if x==3:
        return 6
    if x==4:
        return 24
    if x==5:
        return 120
    if x==6:
        return 720
    if x==7:
        return 5040

s1=1
s2=1
j=1
for i in p:
    s1 += kaijou(n-j)*(i-1)
    j+=1
j=1
for i in q:
    s2 += kaijou(n-j)*(i-1)
    j+=1
k=s1-s2
if k<0:
    print(-k)
else:
    print(k)


### FIXED CODE ###

n=int(input())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
N=[i for i in range(1,n+1)]
p1=[i for i in range(1,n+1)]
q1=[i for i in range(1,n+1)]
def kaijou(x):
    if x==0:
        return 0
    elif x==1:
        return 1
    elif x==2:
        return 2
    elif x==3:
        return 6
    elif x==4:
        return 24
    elif x==5:
        return 120
    elif x==6:
        return 720
    elif x==7:
        return 5040

s1=1
s2=1
j=1
for i in p:
    s1 += kaijou(n-j)*int(p1.index(i))
    j+=1
    p1.remove(i)
j=1
for i in q:
    s2 += kaijou(n-j)*int(q1.index(i))
    j+=1
    q1.remove(i)
k=s1-s2
if k<0:
    print(-k)
else:
    print(k)
s={"A":"T","T":"A","C":"G","G":"C"}
a=input()
print(a[s])


### FIXED CODE ###

a=input()
s={"A":"T","T":"A","C":"G","G":"C"}
print(s[a])
from collections import defaultdict
H,W = map(int,input().split())
d = defaultdict(int)
for _ in range(H):
    for c in list(input()):
        d[c] += 1
for i in range((H-1)//2+1):
    for j in range((W-1)//2+1):
        s = set([(x,y) for x,y in [(i,j),(i,W-1-j),(H-1-i,j),(H-1-i,W-1-j)] if 0<=x<H and 0<=y<W])
        f = True
        for k,_ in sorted(d.items(),key=lambda x:x[1]):
            if d[k] >= len(s):
                d[k] -= len(s)
                f = False
                for x,y in s:
                    test[x][y] = k
                break
        if f:
            print("No")
            exit(0)
print("Yes")

### FIXED CODE ###

from collections import defaultdict
H,W = map(int,input().split())
d = defaultdict(int)
for _ in range(H):
    for c in list(input()):
        d[c] += 1
for i in range((H-1)//2+1):
    for j in range((W-1)//2+1):
        s = set([(x,y) for x,y in [(i,j),(i,W-1-j),(H-1-i,j),(H-1-i,W-1-j)] if 0<=x<H and 0<=y<W])
        f = True
        for k,_ in sorted(d.items(),key=lambda x:x[1]):
            if d[k] >= len(s):
                d[k] -= len(s)
                f = False
                break
        if f:
            print("No")
            exit(0)
print("Yes")
a = int(input())

if (a//10 == 9 || a%10 == 9):
    print("yes")
else:
    print("No")

### FIXED CODE ###

a = int(input())
 
if (a//10 == 9 or a%10 == 9):
    print("Yes")
else:
    print("No")
n = input()
ans1=int(n[0])
for i in n:
  ans1 += int(i)
ans2=int(n[0])-1+9*(len(n)-1)
print(max(ans1,ans2)

### FIXED CODE ###

n = input()
ans1=sum(int(i)for i in n)
ans2=int(n[0])-1+9*(len(n)-1)
print(max(ans1,ans2))
from collections import Counter
from collections import defaultdict
from collections import deque
from heapq import heapify
from heapq import heappop
from heapq import heappush


h,w,m=[int(x) for x in input().split()]

#defaultdictにすることにより後に使うmax関数のコストを削減
hcnt=defaultdict(int)
wcnt=defaultdict(int)
#存在チェックのアクセスがリストで持たせるより高速
#リストは突っ込めないので注意(hashabeのみOK)
bomb=defaultdict(False)
#O(H)
for _ in range(m):
    hi,wi=[int(x)-1 for x in input().split()]
    hcnt[hi]+=1
    wcnt[wi]+=1
    bomb[(hi,wi)]=True

#O(H)
hmax=max(hcnt.values())
wmax=max(wcnt.values())

#O(H)
hidx=[x for x,y in hcnt.items() if y==hmax]
widx=[x for x,y in wcnt.items() if y==wmax]

#O(H**2)
ofst=-1
for i in hidx:
    for j in widx:
        if not bomb[(hi,wi)]:
            ofst=0
            break
                
print(hmax+wmax+ofst)


### FIXED CODE ###

from collections import Counter
from collections import defaultdict
from heapq import heapify
from heapq import heappop
from heapq import heappush
from _collections import defaultdict

h,w,m=[int(x) for x in input().split()]

hcnt=defaultdict(int)
wcnt=defaultdict(int)
bomb=set()
for _ in range(m):
    hi,wi=[int(x)-1 for x in input().split()]
    hcnt[hi]+=1
    wcnt[wi]+=1
    bomb.add((hi,wi))

hmax=max(hcnt.values())
wmax=max(wcnt.values())

hidx=[x for x,y in hcnt.items() if y==hmax]
widx=[x for x,y in wcnt.items() if y==wmax]

ofst=-1
for i in hidx:
    for j in widx:
        if not (i,j) in bomb:
            ofst=0
            break
                
print(hmax+wmax+ofst)
import numpy as np
h,w=map(int,input().split())
L=[[i for i in input()] for i in range(h)]
L_first=np.zeros((2,w),dtype=str)
L_first2=np.zeros((1,1),dtype=str)
L=np.array(L,dtype=str)
L=np.insert(L_first,1,L,axis=0)
L=np.insert(L,0,L_first2,axis=1)
L=np.insert(L,w+1,L_first2,axis=1)
ans=np.zeros((h,w),dtype=str)
for i in range(1,h+1):
    for j in range(1,w+1):
        num = 0
        if L[i][j]==".":
            L2=L[i-1:i+2,j-1:j+2]
            ans[i-1][j-1]=np.sum(L2=="#")
        else:ans[i-1][j-1]="#"
for i in range(h):
    print("".join(ans[i]))

### FIXED CODE ###

import numpy as np
h,w=map(int,input().split())
L=[[i for i in input()] for i in range(h)]
L_first=np.zeros((2,w),dtype=str)
L_first2=np.zeros((1,1),dtype=str)
L=np.array(L,dtype=str)
L=np.insert(L_first,1,L,axis=0)
L=np.insert(L,0,L_first2,axis=1)
L=np.insert(L,w+1,L_first2,axis=1)
ans=np.zeros((h,w),dtype=str)
for i in range(1,h+1):
    for j in range(1,w+1):
        num = 0
        if L[i][j]==".":
            L2=L[i-1:i+2,j-1:j+2]
            ans[i-1][j-1]=np.sum(L2=="#")
        else:ans[i-1][j-1]="#"
for i in range(h):
    print("".join(ans[i]))
import copy
n = input()
k = int(input())

n_list = []
for a in n:
    n_list.append(int(a))
n_num = len(n_list)

dp = [[0] * 2 for _ in range(n_num)]
dp[0][0] = 1
for i in range(n_num):
    nxt = [[0] * 2 for _ in range(n_num + 1)]
    for j in range(n_num):
        for l in range(2):
            lim = 9 if l else n_list[i]
            for x in range(lim + 1):
                if x != 0:
                    ns = j + 1
                else:
                    ns = j
                nlt = l | (x < n_list[i])
                nxt[ns][nlt] += dp[j][l]
    dp = copy.deepcopy(nxt)
ans = dp[k][0] + dp[k][1]
print(ans)

### FIXED CODE ###

s, t = input().split()
a, b = map(int, input().split())
u = input()

if u == s:
    a -= 1
elif u == t:
    b -= 1

print('{0} {1}'.format(a, b))
n, k = map(int,input().split())
a = list(map(int,input().split()))

ans = 0
b = [1]
for i in range(k):
  if a[b[-1] - 1] in b:
    c = a[b[-1] - 1]
    break
  b.append(a[b[-1] - 1])

d = b[:b.index(c)]
b = b[b.index(c):]

k = k - len(d) - k // len(b) * len(b)
#print(d,b,k)
ans =a[k]
#print(ans)
print(ans)

### FIXED CODE ###

# coding: utf-8
# Your code here!
n,k = map(int,input().split())

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

b = [1 for i in range(n)]


now = 0
next = a[now] - 1
c = []
for i in range(n):
    if b[next] == 0:
        d = c[:c.index(next)]
        e = c[c.index(next):]
        #print(d,e)
        break
    #print(now)
    b[now] = 0
    c.append(now)
    next = a[now] - 1
    #print(" ",next)
    now = next

if k >= len(d):
    k = k - len(d)
    k = k % len(e)
    print(e[k]+1)

else:
    print(d[k]+1)
c=a[0:int((len(a)-1)/2)]
b=''.join(list(reversed(a)))
d=a[int((len(a)+3)/2)-1:]
 
if a!=b:
  print("No")
elif c!=d:
  print("No")
else:
  print("Yes")

### FIXED CODE ###

a=input()
#b=reversed(a)
c=a[0:int((len(a)-1)/2)]
b=''.join(list(reversed(a)))
d=a[int((len(a)+3)/2)-1:]
 
if a!=b:
  print("No")
elif c!=d:
  print("No")
else:
  print("Yes")
N = int(input())
st = set()
for _ in range(N):
  S = input()
  st.insert(S)

print(len(st))

### FIXED CODE ###

N = int(input())
st = set()
for _ in range(N):
  S = input()
  st.add(S)

print(len(st))
a,b = map(int,input().split())
A = int((a+b)/2)
print(A if (A%2 == 0 else int(A+0.5))

### FIXED CODE ###

a,b = map(int,input().split())
print((a+b-1)//2+1)
import bisect

N,M=map(int,input().split())
A=list(map(int,input().split()))
BC=[list(map(int,input().split())) for i in range(M)]

A.sort()
BC.sort(key=lambda x: x[1],reverse=True) 
ans=0
for j in range(M):
    if A[0]>=BC[j][1] or len(A)==0:
        break
    else:
        b=BC[j][0]
        c=BC[j][1]
        R=bisect.bisect_left(A,c)
        n=len(A)
        if R>=b:
            if b>=n:
                A=[]
                ans+=b*c
                break
            else:
                del A[0:b]
                ans+=b*c
        else:
            del A[0:R]
            ans+=R*c
        
print(sum(A)+ans)

### FIXED CODE ###

import bisect

N,M=map(int,input().split())
A=list(map(int,input().split()))
BC=[list(map(int,input().split())) for i in range(M)]

A.sort()
BC.sort(key=lambda x: x[1],reverse=True) 
ans=0
for j in range(M):
    if A[0]>=BC[j][1]:
        break
    else:
        b=BC[j][0]
        c=BC[j][1]
        R=bisect.bisect_left(A,c)
        n=len(A)
        if R>b:
            if n<=b:
                A=[]
                ans+=n*c
                break
            else:
                del A[0:b]
                ans+=b*c
        else:
            del A[0:R]
            ans+=R*c
    if len(A)==0:
        break        
print(sum(A)+ans)
n,k = map(int, input().split())
di=[0]*k
Ap=[0]*n
for i in range(0,k):
    di[i] = int(input())
    A = list(map(int, input().split()))
    ai=0
    for j in range(1,n+1):
        if A[ai]==j:
            ai=ai+1
            Ap[j-1]=1
num=0
for l in range(0,n):
    if Ap[l]==0:
        num=num+1
print(num)

### FIXED CODE ###

n,k = map(int, input().split())
di=[0]*k
Ap=[0]*n
for i in range(0,k):
    di[i] = int(input())
    A = list(map(int, input().split()))
    ai=0
    A.append(-100)
    for j in range(1,n+1):
        if A[ai]==j:
            ai=ai+1
            Ap[j-1]=1
num=0
for l in range(0,n):
    if Ap[l]==0:
        num=num+1
print(num)
s,a=input(),int(input());ans=""
for i in range(len(s)):
  if i%n==0:ans+=s[i]
print(ans)

### FIXED CODE ###

s,n=input(),int(input());ans=""
for i in range(len(s)):
  if i%n==0:ans+=s[i]
print(ans)
import numpy as np
ans=0
D=int(input())
C=np.array(list(map(int,input().split())))
last_day=np.array([0 for _ in range(26)])

for day in range(1,D+1):
    score=np.array(list(map(int,input().split())))
    tmp=C*(last_day-day)
    #今回行うコンテストで得られる
    idx=np.argmax(tmp+score)
    # ans=ans+score[idx]+np.sum(tmp)+abs(tmp[idx])
    # last_day[idx]=day
    print(idx+1)

### FIXED CODE ###

import numpy as np
ans=0
D=int(input())
C=np.array(list(map(int,input().split())))
last_day=np.array([0 for _ in range(26)])

for day in range(1,D+1):
    score=np.array(list(map(int,input().split())))
    tmp=C*(last_day-day)
    #今回行うコンテストで得られる
    idx=np.argmax(tmp+score)
    # ans=ans+score[idx]+np.sum(tmp)+abs(tmp[idx])
    last_day[idx]=day
    print(idx+1)