Harryxun/stf_run huggingface dataset:
m = int(input())
a = []
sosu = []
import math
def sosuuhantei(x):
    p = x
    if p < 2:
        return False
    elif  n == 2:
        return p
    else:
        for i in range(3,math.floor(math.sqrt(x)) + 1,2):
            if x % i == 0:
                return False
        else:
             sosu.append(x)
            
    


for i in range(55565):
    sosuuhantei(i)
    
import random
s = random.sample(sosu,m)

strs = ''
for i in range(5):
    strs = strs + str(s[i]) + ' '

### FIXED CODE ###

import math
import random
m = int(input())
n = 10000
def sosuuhantei(x):
    p = x
    if p < 2:
        return false
    elif  n == 2:
        return p
    else:
        for i in range(3,math.floor(math.sqrt(x)) + 1,2):
            if x % i == 0:
                return False
        else:
             return x
sosulist = []
 
if n < 2:
    None
elif n == 2:
    sosulist.append(2)
else:
    sosulist.append(2)
    for i in range(3,n+1,2):
        sosulist.append(sosuuhantei(i))
        
while False in sosulist:
    sosulist.remove(False)

s = []
for i in range(len(sosulist)):
    if sosulist[i] % 5 == 1:
        s.append(sosulist[i])

strs = ''
for i in range(m):
    strs = strs + str(s[i]) + ' '
print(strs)
import numpy as np
from collections import deque

def main():


  h,w=map(int,input().split())
  field1=[list("#"*(w+2))]
  field2=[list("#"+input()+"#") for _ in range(h)]

  f=(field1+field2+field1)


  f=np.array(f)
  visited=np.array([[-1000]*(w+2) for _ in range(h+2)])

  slist=[]
  for i in range(1,w+1):
    for j in range(1,h+1):
      if f[i][j]=="#":
        slist.append((i,j))

  def dfs(maze,visited,slist):
    stack=deque([])
    for i,j in slist:
      visited[i][j]=0
      stack.append([i,j])

    while stack:
      x,y=stack.popleft()
      for i,j in ((1,0),(-1,0),(0,1),(0,-1)):
        x_new,y_new=x+i,y+j
        if maze[x_new][y_new]==".":# and visited[x_new][y_new]==-1000:
          visited[x_new][y_new]=visited[x][y]+1
          maze[x_new][y_new]="#"
          stack.append([x_new,y_new])

  dfs(f,visited,slist)      
  #print(f)
  print(visited.max())

main()

### FIXED CODE ###

#copipe
#1次元で格納

def main():
    h,w = map(int,input().split())
    a = []
    for i in range(h):
        a.append(input())

    used = [True]*(h*w)

    p = []
    for i in range(h):
        for j in range(w):
            if a[i][j] == '#':
                p.append(i*w+j)
                used[i*w+j] = False


    
    res = 0
    while p:
        tank = []
        for e in p:
            if e>w-1 and used[e-w]:
                tank.append(e-w)
                used[e-w] = False
            if e%w > 0 and used[e-1]:
                tank.append(e-1)
                used[e-1] = False
            if e<(h-1)*w and used[e+w]:
                tank.append(e+w)
                used[e+w] = False
            if e%w<w-1 and used[e+1]:
                tank.append(e+1)
                used[e+1] =  False
        p = tank
        res += 1
    print(res-1)

if __name__ == '__main__':
    main()
#!/usr/bin/env python
#-*- coding: utf-8 -*-

import sys

if __name__ == '__main__':
    line = None
    while 1:
        line = raw_input()
        if line == '0 ? 0':
            break
        a, op, b = line.split()
        if op == '+':
            print int(a) + int(b)
        elif op == '-':
            print int(a) - int(b)
        elif op == '*':
            print int(a) * int(b)
        elif op == '/':
            print int(a) / int(b)



### FIXED CODE ###

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

import sys

if __name__ == '__main__':
    line = None
    while 1:
        line = raw_input()
        a, op, b = line.split()
        if op == '+':
            print int(a) + int(b)
        elif op == '-':
            print int(a) - int(b)
        elif op == '*':
            print int(a) * int(b)
        elif op == '/':
            print int(a) / int(b)
        elif op == '?':
        	break
n = int(input())
record = [ [ [ [0 for r in range(10)] for f in range(3)] ] for b in range(4)]
for i in range(n):
    b,f,r,v = [int(a) in input().split(" ")]
    record[b - 1][f - 1][r - 1] += v
for b in range(4):
    for f in record[b]:
        print( " ".join([str(x) for x in f]))
    if b != 3:
        print("#" * 20)
        

### FIXED CODE ###

n = int(input())
record = [ [ [0 for r in range(10)] for f in range(3)] for b in range(4)]
for _ in range(n):
    b,f,r,v = [int(i) for i in input().split(" ")]
    record[b - 1][f - 1][r - 1] += v
for b1 in range(4):
    for f in record[b1]:
        print(" "+" ".join([str(x) for x in f]))
    if b1 != 3:
        print("#" * 20)
N,A,B=map(int,input().split())
H=[inp(input()) for _ in range(N)]
H=sorted(H,reverse=True)

ok=max(H)//B+1
ng=0
mid=(ok+ng)//2
while ok-ng>1:
  cntlive=0
  for h in H:
    h-=B*mid
    if h>0:
      cntlive+=1
  if cntlive<=mid:
    ok=mid
  else:
    ng=mid
  mid=(ok+ng)//2
print(ok)

### FIXED CODE ###

N,A,B=map(int,input().split())
H=[int(input()) for _ in range(N)]
H=sorted(H,reverse=True)

ok=max(H)//B+1
ng=0
mid=(ok+ng)//2
while ok-ng>1:
  cntlive=0
  for h in H:
    h-=B*mid
    if h>0:
      cntlive+=(h+A-B-1)//(A-B)
  if cntlive<=mid:
    ok=mid
  else:
    ng=mid
  mid=(ok+ng)//2
print(ok)
x,a,b=[int(s) for s in input().split()]
if abs(a-x)<abs(b-x):
  print('A'):
else:
  print('B')

### FIXED CODE ###

x,a,b=[int(s) for s in input().split()]
if abs(a-x)<abs(b-x):
  print('A')
else:
  print('B')
ls=list(map(int,input().split()))
A=ls[0]
B=ls[1]
C=ls[2]
if (A==B==5 and C=7) or (A==C==5 and B==5) or (A==7 or B==C==5):
  print('YES')
else:
  print('NO')

### FIXED CODE ###

ls=list(map(int,input().split()))
ls1=[[5,7,5],[5,5,7],[7,5,5]]
if ls in ls1:
	print('YES')
else:
	print('NO')
n = int(input())

for i in range(1, n+1):
    if i%3==0 or i%5==0:
        sum += i
print(sum)

### FIXED CODE ###

n = int(input())

sum = 0
for i in range(1, n+1):
    if not(i%3==0 or i%5==0):
        sum += i
print(sum)
S=input()
T=S[:N//2]
U=S[N//2+1:]
N=len(S)
flg=0
for i in range(int((N-1)/2)):
  if(S[i]!=S[-i]):
    break
  flg+=1

for j in range(len(T)//2):
  if(T[j]!=T[-j]):
    break
  flg+=1

for k in range(len(U)//2):
  if(U[k]!=U[-k]):
    break
  flg+=1

if(flg==3):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S=input()
N=len(S)
T=S[:N//2]
U=S[N//2+1:]

flg=0

for i in range(int((N-1)/2)):
  if(S[i]!=S[-i-1]):
    flg=1
    break
  
for j in range(len(T)//2):
  if(T[j]!=T[-j-1]):
    flg=1
    break
  
for k in range(len(U)//2):
  if(U[k]!=U[-k-1]):
    flg=1
    break

if(flg==0):
  print("Yes")
else:
  print("No")
H,W = list(map(int,input().split()))
N = int(input())
A = list(map(int,input().split()))
cnt = 0
L = []
i = 1
while cnt<H*W:
    if A[i-1]>0:
        A[i-1]+=-1
        L.append(i)
        cnt+=1
    else:
        i+=1
for i in range(H):
    out = [0]*W
    if i%2==0:
        for j in range(W):
            out[j]=L[H*i+j]
    else:
        for j in range(W):
            out[W-1-j]=L[H*i+j]
    print(*out)

### FIXED CODE ###

H,W = list(map(int,input().split()))
N = int(input())
A = list(map(int,input().split()))
cnt = 0
L = []
i = 1
while cnt<H*W:
    if A[i-1]>0:
        A[i-1]+=-1
        L.append(i)
        cnt+=1
    else:
        i+=1
for i in range(H):
    out = [0]*W
    if i%2==0:
        for j in range(W):
            out[j]=L[W*i+j]
    else:
        for j in range(W):
            out[W-1-j]=L[W*i+j]
    print(*out)
# C - Tsundoku
import sys
sys.setrecursionlimit = 10**7

N, M, K = map(int, input().split())
A = list(int(a) for a in input().split())
B = list(int(b) for b in input().split())
la = len(A)
lb = len(B)
T = 0
r = 0
ans = 0
def dfs(i, j, T, r):
    global ans
    ans = max(ans, r)
    if i < la and T+A[i] <= K:
        dfs(i+1, j, T+A[i], r+1)
    if j < lb and T+B[j] <= K:
        dfs(i, j+1, T+B[j], r+1)

dfs(0, 0, T, 0)
print(ans)

### FIXED CODE ###

# C - Tsundoku

import bisect
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

Asum = [0]
for i in range(N):
    Asum.append(Asum[i] + A[i])

Bsum = [0]
for j in range(M):
    Bsum.append(Bsum[j] + B[j])

ans = 0
for i in range(N+1):
    if Asum[i] > K:
        continue
    tmp = K - Asum[i]
    j = bisect.bisect_right(Bsum, tmp) - 1
    ans = max(ans, i+j)
print(ans)
w=list(input())
ans=sorted(w)

print(ans)
while ans[-1]==ans[-2]:
  del ans[-2:]
  if ans==[] or len(ans)==1:
    break
  print(ans)

if ans==[]:
  print('Yes')
else:
  print('No')



### FIXED CODE ###

w=list(input())
ans=sorted(w)

if len(ans)>1:
  while ans[-1]==ans[-2]:
    del ans[-2:]
    if len(ans)==0 or len(ans)==1:
      break

if len(ans)==0:
  print('Yes')
else:
  print('No')
i=input()

a=int(i[0])
b=int(i[1])
c=int(i[2])
d=int(i[3])

if a+b+c+d==7:
    x="+"
    y="+"
    z="+"
elif a+b+c-d==7:
    x="+"
    y="+"
    z="-"
elif a+b-c+d==7:
    x="+"
    y="-"
    z="+"    
elif a-b+c+d==7:
    x="-"
    y="+"
    z="+"
elif a-b-c+d==7:
    x="-"
    y="-"
    z="+"
elif a-b+c-d==7:
    x="-"
    y="+"
    z="-"
elif a-b-c+d==7:
    x="-"
    y="-"
    z="+"
elif a-b-c-d==7:
    x="-"
    y="-"
    z="-"
    
    
print(a,end="")
print(x,end="")
print(b,end="")
print(y,end="")
print(c,end="")
print(z,end="")
print(d,end="")
print("=7")

### FIXED CODE ###

i=input()

a=int(i[0])
b=int(i[1])
c=int(i[2])
d=int(i[3])

if a+b+c+d==7:
    x="+"
    y="+"
    z="+"
elif a+b+c-d==7:
    x="+"
    y="+"
    z="-"
elif a+b-c+d==7:
    x="+"
    y="-"
    z="+"    
elif a-b+c+d==7:
    x="-"
    y="+"
    z="+"
elif a-b-c+d==7:
    x="-"
    y="-"
    z="+"
elif a-b+c-d==7:
    x="-"
    y="+"
    z="-"
elif a+b-c-d==7:
    x="+"
    y="-"
    z="-"
elif a-b-c-d==7:
    x="-"
    y="-"
    z="-"
    
    
print(a,end="")
print(x,end="")
print(b,end="")
print(y,end="")
print(c,end="")
print(z,end="")
print(d,end="")
print("=7")
n,m = map(int,input().split())
l = []
for i in range(m):
    l.append(list(map(int,input().split())))
ans = -1
if n == 1:
    for i in range(10):
        i = str(i)
        flag = True
        for j in range(m):
            if i[l[j][0]-1] != str(l[j][1]) :
                flag = False
        if flag:
            ans = int(i)
            break
else:
    for i in range(10**(n-1),10**n):
    i = str(i)
    flag = True
    for j in range(m):
        if i[l[j][0]-1] != str(l[j][1]) :
            flag = False
    if flag:
        ans = int(i)
        break
print(ans)


### FIXED CODE ###

n,m = map(int,input().split())
l = []
for i in range(m):
    l.append(list(map(int,input().split())))
ans = -1
if n == 1:
    for i in range(10):
        i = str(i)
        flag = True
        for j in range(m):
            if i[l[j][0]-1] != str(l[j][1]) :
                flag = False
        if flag:
            ans = int(i)
            break
else:
    for i in range(10**(n-1),10**n):
        i = str(i)
        flag = True
        for j in range(m):
            if i[l[j][0]-1] != str(l[j][1]) :
                flag = False
        if flag:
            ans = int(i)
            break
print(ans)
s = input()

if len(s) > 26:
    a = [0 for _ in range(26)]

    for i in range(len(s)):
        a[ord(s[i]) - ord("a")] += 1

    ans = s
    for i in range(26):
        if a[i] == 0:
            ans += chr(i+ord("a"))
            break

    print(ans)
    exit()


for i in range(24,-1,-1):
    for j in range(25,i,-1):
        if s[i]<s[j]:
            print(s[:i]+s[j])
            exit()

print(-1)

### FIXED CODE ###

s = input()

if len(s) < 26:
    a = [0 for _ in range(26)]

    for i in range(len(s)):
        a[ord(s[i]) - ord("a")] += 1

    ans = s
    for i in range(26):
        if a[i] == 0:
            ans += chr(i+ord("a"))
            break

    print(ans)
    exit()


for i in range(24,-1,-1):
    for j in range(25,i,-1):
        if s[i]<s[j]:
            print(s[:i]+s[j])
            exit()

print(-1)
n=int(input())
re=0
for i in range(1,n+1):
 if (i%3!=0) and (i%5!=0)
  re+=i
print(re)

### FIXED CODE ###

n=int(input())
re=0
for i in range(1,n+1):
 if (i%3!=0) and (i%5!=0):
  re+=i
print(re)
s = input()
alphabet = ["abcdefghijklmnopqrstuvwxyz"]
if s == str(alphabet[::-1]):
  print(-1)
else:
  if len(set(s))<26:
    for ele in alphabet:
      if ele not in s:
        print(s+ele)
        break
  else:
    suf=[s[-1]]
    for i in range(len(s)-1, 0, -1):
      if s[i]<s[i-1]:
        suf.append(s[i-1])
      else:
        last = i-1
        break
    suf.sort()
    for i in range(len(suf)):
      if s[last]<suf[i]:
        print(s[:last]+suf[i])
        break

### FIXED CODE ###

s = input()
from string import ascii_lowercase
a = ascii_lowercase
if s == a[::-1]:
  print(-1)
else:
  if len(set(s))<26:
    for ele in a:
      if ele not in s:
        print(s+ele)
        break
  else:
    suf=[s[-1]]
    for i in range(25, 0, -1):
      if s[i]<s[i-1]:
        suf.append(s[i-1])
      else:
        last = i-1
        break
    suf.sort()
    for i in range(len(suf)):
      if s[last]<suf[i]:
        print(s[:last]+suf[i])
        break
# 一泊X円、N(泊数)がK泊より多ければその分だけ一泊Y円
N,K,X,Y = map(int,input().split())
# K泊より多い場合はその分だけ単価Y円を掛ける
if N > K:
    total_price = K * X + (N - K) * Y
# K泊より少ない場合は泊数に単価X円を掛ける
else:
    total_price = N * X

print(total_price)


### FIXED CODE ###

# 一泊X円、N(泊数)がK泊より多ければその分だけ一泊Y円
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
# K泊より多い場合はその分だけ単価Y円を掛ける
if N >= K:
    total_price = K * X + (N - K) * Y
# K泊より少ない場合は泊数に単価X円を掛ける
else:
    total_price = N * X

print(total_price)
N,M = map(int,input().split())
dic = {}
for i in range(M):
  a,b = map(int,input().split())
  if a not in dic:
    dic[a] = 1
  else:
    dic[a] +=1
  if b not in dic:
    dic[b] = 1
  else:
    dic[b] +=1

for j in range(N):
  print(dic[j+1])

### FIXED CODE ###

N,M = map(int,input().split())
dic = {}

for i in range(N):
  dic[i+1] = 0

for i in range(M):
  a,b = map(int,input().split())
  dic[a] += 1
  dic[b] += 1
output = dic.values()
for item in output:
  print(item)
N,A,B = [ int(i)for i in input().split()]
c = N*A
if c >= B:
    print(B)
elif c <= B:
    print(C)

### FIXED CODE ###

N,A,B = [int(zz) for zz in input().split()]
i = N*A
if i <= B:
    print(i)
elif i >= B:
    print(B)
import math
import bisect
import itertools
import sys


def most_simRL(ds, x):
    index = bisect.bisect_left(ds, x)
    if index == 0:
        return [ds[0]]
    elif index == len(ds):
        return [ds[-1]]
    return ds[index-1:index+1]

if __name__ == '__main__':
    A, B, Q = map(int, input().split())


    s_list = [-math.inf] + [int(input()) for i in range(A)] + [math.inf]
    t_list = [-math.inf] + [int(input()) for i in range(B)] + [math.inf]
    x_list = [int(input()) for i in range(Q)]


    for xi in x_list:
        s_RL = most_simRL(s_list, xi)
        t_RL = most_simRL(t_list, xi)

        answer = sys.maxsize

        for a, b in itertools.product(s_RL, t_RL):
            answer = min(answer, min(abs(xi-a), abs(xi-b)) + abs(a-b))

        print(answer)


### FIXED CODE ###

import bisect
import itertools
import sys


def most_simRL(ds, x):
    index = bisect.bisect_left(ds, x)
    if index == 0:
        return [ds[0]]
    elif index == len(ds):
        return [ds[-1]]
    return ds[index-1:index+1]

if __name__ == '__main__':
    A, B, Q = map(int, input().split())


    s_list = [-sys.maxsize] + [int(input()) for i in range(A)] + [sys.maxsize]
    t_list = [-sys.maxsize] + [int(input()) for i in range(B)] + [sys.maxsize]
    x_list = [int(input()) for i in range(Q)]


    for xi in x_list:
        s_RL = most_simRL(s_list, xi)
        t_RL = most_simRL(t_list, xi)

        answer = sys.maxsize

        for a, b in itertools.product(s_RL, t_RL):
            answer = min(answer, min(abs(xi-a), abs(xi-b)) + abs(a-b))

        print(answer)
from numpy import ceil,array,sum

def is_ok(m):

    tmp = h - m*B

    if not any(tmp):
        return True

    rem = [ceil(i/(A-B)) for i in tmp[tmp>0]]
    
    if rem > m:
        return False

    return True

N,A,B = map(int,input().split())
h = array(list(int(input()) for _ in range(N)))
s = sum(h)
##二分散策

r = 10**9
l = 0

while abs(l-r) > 1:

    m = (r+l)//2

    if is_ok(m):
        r = m
    else:
        l = m

print(r)

### FIXED CODE ###

import sys
from math import ceil

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

def check(k):
    tmp = list(h)
    for i in range(N):
        tmp[i] -= B*k
    if sum([int(i<=0) for i in tmp]) == N:
        return True

    lf = 0
    for i in tmp:
        if i > 0:
            lf += ceil(i/(A-B))

    if lf <= k:
        return True
    else:
        return False

N,A,B = map(int,input().split())
h = tuple(int(input()) for _ in range(N))

left = -1
right = 1e9

while abs(left-right) > 1:

    mid = (left+right)//2
    if check(mid):
        right = mid
    else:
        left = mid

print(int(right))
import numpy as np
import math

A, B, H, M = map(int, input().split())

d = np.sqrt((B*math.cos(6*M)-A*math.cos(6*H+M/4))**2+/
            (B*math.sin(6*M)-A*math.sin(6*H+M/4))**2)
print(d)

### FIXED CODE ###

import numpy as np
import math


A, B, H, M = map(int, input().split())

d = np.sqrt((B*math.cos(math.radians(6*M))-A*math.cos(math.radians(30*H+M/2)))**2+(B*math.sin(math.radians(6*M))-A*math.sin(math.radians(30*H+M/2)))**2)
print(d)
a = input()
s = input()

if a >= 3200:
    print(s)
else:
    print("red")

### FIXED CODE ###

a = input()
s = raw_input()

if a >= 3200:
    print(s)
else:
    print("red")
n,t=map(int,input().split())
ct=[list(map(int,input().split())) for i in range(n)]
ct=[i for i in ct if i[1]<=t]
ct.sort()
print(ct[0][0])

### FIXED CODE ###

n,t=map(int,input().split())
ct=[list(map(int,input().split())) for i in range(n)]
ct=[i for i in ct if i[1]<=t]
if len(ct)==0:
  print("TLE")
  exit()
ct.sort()
print(ct[0][0])
#### import ####
import sys
import math
from collections import defaultdict

#### 設定 ####
sys.setrecursionlimit(10**7)
def input():
  return sys.stdin.readline()[:-1]

#### 定数 ####
mod = 10**9 + 7

#### 読み込み ####
def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
  read_all = [tuple(map(int, input().split())) for _ in range(N)]
  return map(list,zip(*read_all))

#################

N = I()
u,v,w = Line(N-1)

c = [[float('inf')]*N for _ in range(N)]
for i in range(N-1):
  c[i][i] = 0
  c[u[i]-1][v[i]-1] = w[i]
  c[v[i]-1][u[i]-1] = w[i]

for k in range(N):
  for i in range(N):
    for j in range(N):
      c[i][j]=min(c[i][j],c[i][k]+c[k][j])

from scipy.sparse.csgraph import floyd_warshall
cost=floyd_warshall(c)
print(cost)

for i in range(N):
  if c[i][0]%2==0:
    print('0')
  else:
    print('1')

### FIXED CODE ###

#### import ####
import sys
import math
from collections import defaultdict

#### 設定 ####
sys.setrecursionlimit(10**7)
def input():
  return sys.stdin.readline()[:-1]

#### 定数 ####
mod = 10**9 + 7

#### 読み込み ####
def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
  read_all = [tuple(map(int, input().split())) for _ in range(N)]
  return map(list,zip(*read_all))

#################

N = I()
u,v,w = Line(N-1)

c = [[] for _ in range(N)]
for i in range(N-1):
  c[u[i]-1].append([v[i]-1, w[i]])
  c[v[i]-1].append([u[i]-1, w[i]])

d=[-1]*N
v=0
check_visited = [False]*N
check_visited[v] = True
S = [v]
d[v]=0
while S:
  v1 = S.pop()
  for i in c[v1]:
    if check_visited[i[0]] == False:
      check_visited[i[0]] = True
      d[i[0]] = d[v1] + i[1]
      S.append(i[0])

for i in range(N):
  if d[i]%2==0:
    print('0')
  else:
    print('1')
N = int(input())

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

def cost(n):
    if n == 1:
        return 0
    if n == 2:
        return abs(H[0]-H[1])
    return min(cost(n-1)+abs(H[n-2]-H[n-1]), cost(n-2)+abs(H[n-3]-H[n-1]))

print(cost(N))


### FIXED CODE ###

inf = 1e10
n = int(input())
h = [int(i) for i in input().split()]
dp = [inf]*n
for i in range(n):
    if i == 0:
        dp[i] = 0
    elif i == 1:
        dp[i] = abs(h[i-1]-h[i])
    else:
        dp[i] = min(dp[i-1]+abs(h[i-1]-h[i]), dp[i-2]+abs(h[i-2]-h[i]))
print(dp[-1])
a=int(input())
b=int(input())
c=int(input())

print((a+b)*h/2)

### FIXED CODE ###

a = int(input())
b = int(input())
h = int(input())
 
print(int(a+b)*h//2 )
x = input()
sum_of_digits = sum(map(int, x))
check = (int)x % sum_of_digits
print('No' if check else 'Yes')

### FIXED CODE ###

x = input()
sum_of_digits = sum(map(int, x))
check = int(x) % sum_of_digits
print('No' if check else 'Yes')
N, M = map(int, input().split())
ac_list = []
wa_dic = {}
for i in range(M):
    p, s = input().split()
    p = int(p)
    if p in ac_list: continue

    if s == 'WA':
        try:
            wa_dic[p] += 1
        except:
            wa_dic[p] = 1
        
    else:
        ac_list.append(p)
        

#print(ac_list, wa_dic)
print(len(ac_list), sum([wa_dic[x] for x in ac_list]))

### FIXED CODE ###

N, M = map(int, input().split())
dic = {}
ac = 0
wa = 0
for x in range(M):
    p, s = input().split()
    try:
        dic[p]
    except:
        dic[p] = [False, 0]
    
    if s == 'WA':
        if not dic[p][0]:
            dic[p][1] += 1
        
        
    else:
        if not dic[p][0]:
            dic[p][0] = True
            ac += 1
            wa += dic[p][1]

print(ac, wa)
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))

ans=0
count=0
i,j=0,0
while ans<k:
  if i > n-1:
    num=b[j]
  if j > m-1:
    num=a[i]
  else:
    num=min(a[i],b[j])
    if num==a[i]:
      i+=1
      count+=1
      ans+=num
    else:
      j+=1
      count+=1
      ans+=num
  
print(count)

### FIXED CODE ###

n,m,k=map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))

asum=[0]
bsum=[0]

for i in range(n):
  asum.append(asum[i]+A[i])
  
for j in range(m):
  bsum.append(bsum[j]+B[j])

ans=0
ko=m
for i in range(n+1):
  if asum[i]>k:
    break
  while asum[i]+bsum[ko]>k:
    ko-=1
  ans=max(ans,i+ko)
  
print(ans)
import copy
s = list(input())
def make1d(n):
    return [copy.deepcopy(1) for i in range(0,n)]
t = make1d(26)
for i in range(0, len(s)):
    t[i] = t[ord(s[i]) - 97] * (-1)
u = 1
for i in range(0, len(s)):
    u = u * t[i]
if u == 1:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

import copy
s = list(input())
def make1d(n):
    return [copy.deepcopy(1) for i in range(0,n)]
t = make1d(26)
for i in range(0, len(s)):
    t[ord(s[i]) - 97] = t[ord(s[i]) - 97] * (-1)
u = 0
for i in range(0, len(t)):
    u = u + t[i]
if u == 26:
    print('Yes')
else:
    print('No')
n = int(input())
s = input()
count = 0
for i in range(n):
    if s[i] == "A" and s[i + 1] == "B" and s[i + 2] == "C":count += 1
print(count)

### FIXED CODE ###

n = int(input())
s = input()
count = 0
for i in range(n - 2):
    if s[i] == "A" and s[i + 1] == "B" and s[i + 2] == "C":count += 1
print(count)
n = int(raw_input)
a = map(int, raw_input().split())
print (" ".join(map(str, a.reverse())))

### FIXED CODE ###

n = int(raw_input())
a = map(int, raw_input().split())
a.reverse()
print (" ".join(map(str, a)))
a, b = (int(i) for i input().split())
c = b - a
d = c*(c+1)//2
print(d - b)

### FIXED CODE ###

a, b = (int(i) for i in input().split())
print(sum(range(b-a))-a)
n = int(input())
a = input().split()
b = []
for i in range(n):
  if n%2 == 0:
  	if i%2== 1:
      b.insert(0,a[i])
    else:
      b.append(a[i])
  else:
    if i%2== 0:
      b.insert(0,a[i])
    else:
      b.append(a[i])
result= map(b)
print(result)

### FIXED CODE ###

n = int(input())
num = list(map(str,input().split()))
a,b = [],[]
result = ''
for i in range(n):
  if i%2 == 0:
    a.append(num[i])
  else:
    b.append(num[i])
if n%2 ==1:
  result = ' '.join(a[::-1])
  result += ' ' + ' '.join(b)
else:
  result = ' '.join(b[::-1])
  result += ' ' + ' '.join(a)
print(result)