Harryxun/stf_run huggingface dataset:
def resolve():
    s = input()
    t = input()

    dp = [[""] * (len(t)+1) for _ in range(len(s)+1)
    
    for i in range(len(s)):
        for j in range(len(t)):
            if s[i] == t[j]:
                dp[i+1][j+1] = dp[i][j] + s[i]
            else:
                if len(dp[i][j+1]) >= len(dp[i+1][j]):
                    dp[i+1][j+1] = dp[i][j+1]
                else:
                    dp[i+1][j+1] = dp[i+1][j]

    print(dp[len(s)][len(t)])

if __name__ == "__main__":
    resolve()

### FIXED CODE ###

# dpに文字列を格納 (TLE)
def resolve():
    s = input()
    t = input()

    dp = [[""] * (len(t)+1) for _ in range(len(s)+1)]
    
    for i in range(len(s)):
        for j in range(len(t)):
            if s[i] == t[j]:
                dp[i+1][j+1] = dp[i][j] + s[i]
            else:
                if len(dp[i][j+1]) >= len(dp[i+1][j]):
                    dp[i+1][j+1] = dp[i][j+1]
                else:
                    dp[i+1][j+1] = dp[i+1][j]

    print(dp[len(s)][len(t)])

def resolve():
    s = input()
    t = input()

    dp = [[0] * (len(t)+1) for _ in range(len(s)+1)]
    
    for i in range(len(s)):
        for j in range(len(t)):
            if s[i] == t[j]:
                dp[i+1][j+1] = dp[i][j] + 1
            else:
                dp[i+1][j+1] = max(dp[i][j+1], dp[i+1][j])

    # 後ろから探索
    # s[i-1]が、LCSに含まれるかどうか判定
    # dp[i][j]とdp[i-1][j]またはdp[i][j-1]が一致(変化なし)の場合、s[i-1]はLCSに含まれない
    res = ""
    i = len(dp) - 1
    j = len(dp[0]) - 1
    while i != 0 and j != 0:
        if dp[i][j] == dp[i - 1][j]: 
            i -= 1 
        elif dp[i][j] == dp[i][j - 1]:
            j -= 1
        else:
            res = s[i-1] + res
            i -= 1
            j -= 1

    print(res)

if __name__ == "__main__":
    resolve()
a=int(input("a=:"))
b=int(input("b=:"))
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")
else :
  print("Odd")
def f(s):
	cnt = 0
	st = set()
	cnt += 1
	st.add(s)
  
	while True:
		cnt += 1
    	if s % 2 == 0:
      		tmp = s / 2
    	else:
      		tmp = 3 * s + 1
    	if tmp in st:
      		break
    
    	st.add(tmp)
    	s = tmp
	return cnt
  
s = int(input())
ans = f(s)
print(ans)

### FIXED CODE ###

N = int(input())
s = set([N])
n = N
while 1:
    if n%2:
        n = 3*n + 1
    else:
        n //= 2
    if n in s:
        print(len(s) + 1)
        break
    else:
        s.add(n)
N,M = map(int,input().split())
order = {}
for i in range(M):
    s,c = map(int,input().split())
    if order.get(s,57)==57:
        order[s]=c
        continue
    elif order.get(s,57)!=57 and order[s]!=c:
        print(-1)
        break
else:
    moji = [0]*N
    for k in order.keys():
        moji[k-1]=str(order[k])
    if N!=1 and moji[0]==0:
      moji[0]='1'
      print(''.join(moji))
    elif N!=1 and moji[0]=='0':
      print(-1)
    else:
      ans = [str(a) for a in moji]
      print(''.join(ans))

### FIXED CODE ###

N,M = map(int,input().split())
order = {}
if N==1 and M==0:
  print(0)
else:
  for i in range(M):
    s,c = map(int,input().split())
    if order.get(s,57)==57:
        order[s]=c
    elif order.get(s,57)!=57 and order[s]!=c:
        print(-1)
        break
  else:
    moji = [1]+[0]*(N-1)
    for k in order.keys():
        moji[k-1]=str(order[k])
    if N!=1 and moji[0]=='0':
      print(-1)
    else:
      ans = [str(a) for a in moji]
      print(''.join(ans))
a,b=input().split()
c=ord(a)
d=ord(b)
if c<d:
  print("<")
elif c==d:
  print("=")
else c>d:
  print(">")

### FIXED CODE ###

a,b=input().split()
if (a<b):
  print("<")
elif (a==b):
  print("=")
else :
  print(">")
s=input()
def roopR(l,n):
  if list[k]==1:
    for p in range(a):
      if list[l]==-1:
        if n%2==0:
          return l
        else:
          return l-1
      else:
        l += 1
        n += 1
  else:
    for q in range(a):
      if list[m]==1:
        if o%2==0:
          return m
        else:
          return m+1
      else:
        m -= 1
        o += 1

a=len(s)
endlist=[]
list=[]
for i in range(a):
  if s[i]=='R':
    list.append(1)
  else:
    list.append(-1)
for j in range(a):
  endlist.append(0)
for k in range(a):
  b=roopR(k,0)
  endlist[b] += 1
print(*endlist)

### FIXED CODE ###

S=input()
dp=[0]*len(S)
a=0
for i in range(len(S)):
  if S[i]=='R':
    a+=1
  else:
    dp[i]+=a//2
    dp[i-1]+=a-a//2
    a=0
for i in range(len(S)-1,-1,-1):
  if S[i]=='L':
    a+=1
  else:
    dp[i]+=a//2
    dp[i+1]+=a-a//2
    a=0
print(*dp)
g=lambda a,b:abs(a[0]*b[1]-a[1]*b[0])

while True:
    t=input()
    if t=="":
        break
    l=[float(i) for i in t.split()]
    ba=[l[0]-l[2],l[1]-l[3]]
    ab=[-i for i in ba]
    cb=[l[2]-l[4],l[3]-l[5]]
    bc=[-i for i in cb]
    ca=[l[0]-l[4],l[1]-l[5]]
    ac=[-i for i in ca]
    ap=[l[6]-l[0],l[7]-l[1]]
    bp=[l[6]-l[2],l[7]-l[3]]
    cp=[l[6]-l[4],l[7]-l[5]]
    if g(ab,ac)<g(ab,ap) or g(ba,bc)<g(ba,bp) or g(ca,cb)<g(ca,cp):
        print("NO")
    else:
        print("YES")


### FIXED CODE ###

g=lambda a,b,c:(a[0]-b[0])*(b[1]-c[1])-(b[0]-c[0])*(a[1]-b[1])

while True:
    try:t=input()
    except:break
    l=[float(i) for i in t.split()]
    b=[g(l[0:2],l[2:4],l[6:8]),g(l[2:4],l[4:6],l[6:8]),g(l[4:6],l[0:2],l[6:8])]
    if len([i for i in b if i>0])==3 or len([i for i in b if i<0])==3:
        print("YES")
    else:
        print("NO")
import math
n = input()
a = list(map(int,[input() for i in range(5)]))
print(floor(n / min(a)) + 5) 


### FIXED CODE ###

import math
n=int(input())
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
miti=[a,b,c,d,e]
mini=min(miti)
retu=math.ceil(n/mini)
print(4+retu)
n,l = map(int,input().split())
print("".join(sorted([ input() for i in range(a)])))


### FIXED CODE ###

abc =input()
five = abc.count("5")
seven = abc.count("7")
 
if five==2 and seven==1:
  print("YES")
else:
  print("NO")
from collections import defaultdict
n=int(input())
p=[list(map(int,input().split())) for i in range(n)]
dic=defaultdict(int)
for i, (x,y)in enumerate(p):
  for j, (u,v) in enumerate(p):
    if i==j:
      continue
    dic[(x-u,y-v)]+=1
print(n-max(dic,key=lambda z:z[1]))

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10000000)
from collections import defaultdict
mod = 10**9+7

N = int(input())
xy = [list(map(int, input().split())) for i in range(N)]
xy.sort()
Ans = N
for i in range(N):
    for j in range(i+1, N):
        a, b = xy[j][0]-xy[i][0], xy[j][1]-xy[i][1]
        ans = N
        for k in range(N):
            for l in range(k+1, N):
                if xy[k][0]+a == xy[l][0] and xy[k][1]+b == xy[l][1]:
                    ans -= 1
        Ans = min(Ans, ans)
print(Ans)
# -*- coding:utf-8 -*-
import math
N = int(input())
print(sorted(list(set([max(int(math.log10(N//B))+1,int(math.log10(B))+1) for B in range(1,int(math.sqrt(N+1))) if N%B == 0 ]))).pop(0))

### FIXED CODE ###

# -*- coding:utf-8 -*-
import math
N = int(input())
print(min(sorted(list(set([max(int(math.log10(N//B))+1,int(math.log10(B))+1) for B in range(1,int(math.sqrt(N+1))+1) if N%B == 0])))))
K=int(input())
i=1
if K%2==0 or K%5==0:
  print(-1)
elif K%7==0:
  L=9*K/7
  b=10
  while True:
    b=a%L
    if b==1:
      print(i)
      break
    b=b*10
    i+=1
else:
  L=9*K
  b=10
  while True:
    b=b%L
    if b==1:
      print(i)
      break
    b=b*10
    i+=1
    

### FIXED CODE ###

K=int(input())
i=1
if K%2==0 or K%5==0:
  print(-1)
elif K%7==0:
  L=9*K/7
  b=10
  while True:
    b=b%L
    if b==1:
      print(i)
      break
    b=b*10
    i+=1
else:
  L=9*K
  b=10
  while True:
    b=b%L
    if b==1:
      print(i)
      break
    b=b*10
    i+=1
s = input()
if s.count("a")*s.count("b")*s.count("c") == 1:
  print("Yes)
else:
        print("No")

### FIXED CODE ###

s = input()
if s.count("a")*s.count("b")*s.count("c") == 1:
    print("Yes")
else:
    print("No")
N, M = map(int, input().split())
A = [input() for _ in range(N)]
B = [input() for _ in range(M)]
for i in range(0, M - N):
  for j in range(0, M - N):
    if A == B[i:i+N+1][j:j+N+1]:
      flag = True
    if flag:
      break
  if flag:
    break
if flag:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

N, M = map(int, input().split())
A = [input() for _ in range(N)]
B = [input() for _ in range(M)]
flag = False
for i in range(0, N - M + 1):
  for j in range(0, N - M + 1):
    if B == [x[j:j+M] for x in A[i:i+M]]:
      flag = True
    if flag:
      break
  if flag:
    break
if flag:
  print("Yes")
else:
  print("No")
n = int(input())
for i in range(n):
    t, x, y = map(int, input().split())
    if x + y < t or (x+y-t)%2 /= 0
        print("No")
        exit()
print("Yes")

### FIXED CODE ###

n = int(input())
ti=0
xi=0
yi=0
for i in range(n):
    t, x, y = map(int, input().split())
    if abs(x-xi) + abs(y-yi) > abs(t-ti) or (abs(x-xi) + abs(y-yi) + abs(t-ti)) % 2 != 0:
        print("No")
        exit()
    ti=t
    xi=x
    yi=y
print("Yes")
sys.setrecursionlimit(100000000)

N, M = map(int, input().split())
BtoA = [[] for i in range(N + 1)]


for i in range(N - 1 + M):
    A, B = map(int, input().split())
    BtoA[B].append(A)

memo = {}
def depth(b):
    if b in memo:
        return memo[b]
    
    res = 0
    for a in BtoA[b]:
        res = max(res, depth(a) + 1)

    memo[b] = res
    return res

for i in range(1, N + 1):
    ans = 0
    for a in BtoA[i]:
        if depth(a) + 1 == depth(i):
            ans = a
            break
    print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000000)

N, M = map(int, input().split())
BtoA = [[] for i in range(N + 1)]


for i in range(N - 1 + M):
    A, B = map(int, input().split())
    BtoA[B].append(A)

memo = {}
def depth(b):
    if b in memo:
        return memo[b]
    
    res = 0
    for a in BtoA[b]:
        res = max(res, depth(a) + 1)

    memo[b] = res
    return res

for i in range(1, N + 1):
    ans = 0
    for a in BtoA[i]:
        if depth(a) + 1 == depth(i):
            ans = a
            break
    print(ans)
import numpy as np

N = int(input())
D = int(input())
count = 0

for i in range(N): 
    x = int(input())
    y = int(input())
    d = np.sqrt(x**2+y**2)

    if d <= D:
        count += 1 

print(count)  



### FIXED CODE ###

import numpy as np

N,D = input().split()
N = int(N)
D = int(D)
count = 0

for i in range(N): 
    x,y = input().split()
    x = int(x)
    y = int(y)
    d = np.sqrt(x**2+y**2)

    if d <= D:
        count += 1 

print(count)
n,k=map(int,input().split())
l=list(map(int,input().split()))
d={}
for i in range(0,len(l)):
    d[i+1]=l[i]
ans=1
s=set()
seq=[]
for i in range(0,k):
    ans=d[ans]
    if ans in s:
        seq.append(ans)
        break
    else:
        s.add(ans)
    seq.append(ans)
else:
    print(ans)
b=seq.index(seq[-1])
rep=seq[b:-1]
sl=len(seq)-seq.index(seq[-1])-1
k=k-b-1
ans=seq[b]
x=k%sl
#print(x,sl)
print(rep[x])










### FIXED CODE ###

n,k=map(int,input().split())
l=list(map(int,input().split()))
d={}
for i in range(0,len(l)):
    d[i+1]=l[i]
ans=1
s=set()
seq=[]
e=0
for i in range(0,k):
    ans=d[ans]
    if ans in s:
        seq.append(ans)
        break
    else:
        s.add(ans)
    seq.append(ans)
else:
    print(ans)
    e=1
if e==0:
    b = seq.index(seq[-1])
    rep = seq[b:-1]
    sl = len(seq) - seq.index(seq[-1]) - 1
    k = k - b - 1
    ans = seq[b]
    x = k % sl
    # print(x,sl)
    print(rep[x])
import numpy as np


n,m = map(int,input().split())
a = np.array(list(map(int,input().split())))
for i in range(m):
    a[a.argmax()] = a[a.argmax()]//2 
print(np.sum(a))


### FIXED CODE ###

s = input()

if s == 'Sunny':
    print('Cloudy')
elif s == 'Cloudy':
    print('Rainy')
else:
    print('Sunny')
s=input().split("/")
if ((s[0] == 2019 and s[1] > 4) or s[0] > 2019):
    print("TBD")
else:
    print("Heisei")

### FIXED CODE ###

s = input()
 
if s <= '2019/04/30':
    print('Heisei')
else:
    print('TBD')
from sys import stdin


def dfs(g, seen, n):
    all_seen = True

    for si in seen:
        if si == False:
            all_seen = False

    if all_seen:
        return 1

    count = 0

    for m in g[n]:
        if seen[m]:
            continue

        seen[m] = True
        count += dfs(g, seen, m)
        seen[m] = False

    return count


def main():
    n, m = map(int, stdin.readline().split())
    ab = [map(int, stdin.readline().split()) for _ in range(n)]
    g = [[] for _ in range(n)]
    for abi in ab:
        a, b = abi
        g[a - 1].append(b - 1)
        g[b - 1].append(a - 1)
    seen = [False for _ in range(n)]
    seen[0] = True

    ans = dfs(g, seen, 0)

    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

from sys import stdin


def dfs(g, seen, n):
    all_seen = True

    for si in seen:
        if si == False:
            all_seen = False

    if all_seen:
        return 1

    ans = 0

    for m in g[n]:
        if seen[m]:
            continue

        seen[m] = True
        ans += dfs(g, seen, m)
        seen[m] = False

    return ans


def main():
    n, m = map(int, stdin.readline().split())
    ab = [map(int, stdin.readline().split()) for _ in range(m)]
    g = [[] for _ in range(n)]
    for abi in ab:
        a, b = abi
        g[a - 1].append(b - 1)
        g[b - 1].append(a - 1)
    seen = [False for _ in range(n)]
    seen[0] = True

    ans = dfs(g, seen, 0)

    print(ans)


if __name__ == "__main__":
    main()
N = int(input())
A = list(map(int, input().split()))

count = 0
if len([i for i in A if i%2 == 0 ]) ==0:
    print("APPROVED")
else:
    a = [i for i in A if i%2 == 0 ]
    for j in a:
        if j%3 == 0 or j%5 == 0:
            count += 1
    
if count == len(a):
    print("APPROVED")

else:
    print("DENIED")

### FIXED CODE ###

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

count = 0
for i in A:
    if i%2 == 0 and i%3 != 0 and i%5 != 0:
        print("DENIED")
        break
    count += 1

if count == len(A):
    print("APPROVED")
a, b = map(int, input().split())
c = [0]
for i in range(1, 999):
    c.append(c[i-1]+i)
    if c[i-1]-a > 0:
        ans = c[i-1]-a
        break
print(ans)


### FIXED CODE ###

a, b = map(int, input().split())
c = [0]
for i in range(1, 1000):
    c.append(c[i-1]+i)
    if c[i-1]-a > 0:
        ans = c[i-1]-a
        if a+ans == c[i-1] and b+ans == c[i]:
            break
        else:
            ans = 0
print(ans)
temp = input().split()
n = int(temp[0])
a = int(temp[1])
b = int(temp[2])

def findDigit(int num,int digit):
    while digit > 0 or num <= 0:
      num %= 10
      num /= 10
      digit -= 1
	return num
  
print(findDigit(198,1))

### FIXED CODE ###

import math

temp = input().split()
n = int(temp[0])
a = int(temp[1])
b = int(temp[2])

def digitsSum(num):
    sum = 0
    while num > 0:
        sum += num % 10
        num = math.floor(num/10)
    return sum

answer = 0
for i in range(1,n+1):
    s = digitsSum(i)
    if a <= s <= b:
        answer += i

print(answer)
import sys


def euc(n,m):
    if n == m:
        return m
    elif m == 1 | n == 1:
        return 1
    else:
        return euc(min(n,m), max(n,m)-min(n,m))


for line in sys.stdin:
    a,b = [int(i) for i in line.split()]
    print(euc(a,b),int(a*b/euc(a,b)))



### FIXED CODE ###

import sys


def euc(n,m):
    if max(n,m)%min(n,m) == 0:
        return min(n,m)
    else:
        return euc(min(n,m), max(n,m)%min(n,m))


for line in sys.stdin:
    a,b = [int(i) for i in line.split()]
    print(euc(a,b),int(a*b/euc(a,b)))
# -*- coding: utf-8 -*-
import sys
import math
import numpy as np


def main():
    # 入力処理
    # M = int(input())
    N, M = map(int, input().split())
    sA = ''.join([input() for i in range(N)])
    sB = ''.join([input() for i in range(M)])
    A = np.array([s for s in sA]).reshape(N,N)
    B = np.array([s for s in sB]).reshape(M,M)

    # アルゴリズム本体
    result = np.zeros((N-M,N-M), dtype=bool)
    for i in range(N-M+1):
        for j in range(N-M+1):
            result[i,j] = (A[i:i+M, j:j+M] == B).all()

    # 出力
    if result.any():
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()


### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
import math
import numpy as np


def main():
    # 入力処理
    # M = int(input())
    N, M = map(int, input().split())
    sA = ''.join([input() for i in range(N)])
    sB = ''.join([input() for i in range(M)])
    A = np.array([s for s in sA]).reshape(N,N)
    B = np.array([s for s in sB]).reshape(M,M)

    # アルゴリズム本体
    result = np.zeros((N-M+1,N-M+1), dtype=bool)
    for i in range(N-M+1):
        for j in range(N-M+1):
            result[i,j] = (A[i:i+M, j:j+M] == B).all()

    # 出力
    if result.any():
        print('Yes')
    else:
        print('No')


if __name__ == '__main__':
    main()
N = int(input())
D = {i: [] for i in range(N)}
A = list(map(int, input().split()))
for i in range(N):
  D[i].append(A[i]-1)
for i in range(N):
  print(len(D[i]))

### FIXED CODE ###

N = int(input())
D = {i: [] for i in range(N)}
A = list(map(int, input().split()))
for i in range(N-1):
  D[A[i]-1].append(i)
for i in range(N):
  print(len(D[i]))
#!/usr/bin/env python3
import sys
def input():
    return sys.stdin.readline()[:-1]

def main():
    S = input()
    K = int(input())

    c = 0
    for i in range(len(S)):
        if S[i] == '1':
            c += 1
        else:
            break
    if c >= 1 and K <= c:
        print(1)

    T = S.replace('1', '')
    print(T[0])


if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
def input():
    return sys.stdin.readline()[:-1]

def main():
    S = input()
    K = int(input())

    if K >= 1e3:
        K = 105

    T = ''
    for i in range(len(S)):
        if S[i] == '1':
            T += '1'
        else:
            T += S[i] * K

        if S[i] != '1':
            break

    print(T[K - 1])


if __name__ == '__main__':
    main()
n,p=map(int,input().split())

def yakusuSub(p,d,arr):
    if p==1:return arr
    if p/d==int(p/d):
        arr.append(d)
        return yakusuSub(p/d,d,arr)
    else:
        return yakusuSub(p,d+1,arr)

def yakusu(p):
    return yakusuSub(p,2,[])

if n==1:
    print(p)
    exit()

y=yakusu(p)
ans=1
cnt=1
before=0
for i in y:
    if i==before:
        cnt+=1
    else:
        cnt=1       
    if cnt>=n:
        ans*=i
        cnt=1
    before=i
print(ans)

### FIXED CODE ###

n, p = map(int, input().split())
if n == 1:
    print(p)
else:
    for i in range(1, round(p**(1/n))+1):
        if p % i**n ==0:
            res = i
    print(res)
N = int(input())
A = list(map(int, input().split()))

mod = (10**9) + 7
abc = [0] * 3
ans = 1
for i in range(N):
	pos = abc.count(A[i])
	ind = abc.index(A[i])
	ans *= pos
	ans %= mod
	abc[ind] += 1

print(ans)

### FIXED CODE ###

import sys

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

mod = (10**9) + 7
abc = [0] * 3
ans = 1
for i in range(N):
	pos = abc.count(A[i])
	if pos == 0:
		print(0)
		sys.exit()
	ind = abc.index(A[i])
	ans *= pos
	ans %= mod
	abc[ind] += 1

print(ans)
N= input()

flg= False#7が見つかっていない初期状態
for i in N:#Nの１文字目から判定
    if i == '7':
        flg=True#7が見つかった時点で終了
        break
if flg:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

N=input()

if N[0]=='7' or  N[1]=='7' or N[2]=='7':
    print('Yes')
else:
    print('No')
N = int(input())

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

i=0

max = 0
min = 0
for i in range(n):
  if a[i] >= max:
    max = a[i]
  elif a[i] <= min:
    min = a[i]
  else
    continue
    
print (max - min)
  


### FIXED CODE ###

n = int(input())


if n % 2:
  print(n*2)
else:
  print(n)
n,T=map(int,input().split())
clist,tlist=[],[]
for i in range(n):
  c,t=map(int,input().split())
  clist.append(c)
  tlist.append(t)

ans=10100
flag=False
for d,e in zip(c,t):
  if e<=T:
    ans=min(ans,d)
    flag=True
if flag == False:
  print("TLE")
else:
  print(ans)

### FIXED CODE ###

n,T=map(int,input().split())
clist,tlist=[],[]
for i in range(n):
  c,t=map(int,input().split())
  clist.append(c)
  tlist.append(t)

ans=10100
flag=False
for d,e in zip(clist,tlist):
  if e<=T:
    ans=min(ans,d)
    flag=True
if flag == False:
  print("TLE")
else:
  print(ans)
a, b, c ,d = map(int, input().split())

flag = 0

if((a-b)**2<d**2):
    flag += 1

if((b-c)**2<d**2):
    flag += 1

if((c-a)**2<d**2):
    flag += 1

if(flag=>2):
    print("Yes")
else:
    print("No")


### FIXED CODE ###

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

flag = 0

if((a-b)**2<=d**2):
    flag += 1

if((b-c)**2<=d**2):
    flag += 1

if((c-a)**2<=d**2):
    flag += 2

if(flag>=2):
    print("Yes")
else:
    print("No")
a,v = map(int, input().split())
b,w = map(int, input().split())
t = int(input())
d = abs(a-b)
s = v - w
if s > 0 and not d%s and d/ss <= t:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

a,v = map(int, input().split())
b,w = map(int, input().split())
t = int(input())
d = abs(a-b)
s = v - w
if s > 0 and d/s <= t:
  print("YES")
else:
  print("NO")
k=[]
k=list(map(int,input().split())
if k[0]<k[1]:
       print("0")
else:
       print("10")

### FIXED CODE ###

if __name__=="__main__":
    X,A=input().split()
    X=int(X)
    A=int(A)
    if X<A:
        print("0")
    elif X>=A:
        print("10")
H, K = map(int, input().split())
hp = list(map(input().split()))
hp_sorted = sorted(hp, reverse=True)
hp_new = list(hp_sorted[K:])
print(sum(hp_new))


### FIXED CODE ###

H, K = map(int, input().split())
hp = list(map(int, input().split()))
hp.sort(reverse=True)
print(sum(hp[K:]))
n,l = map(int,input().split())
words = [input() for i in range(n)]
words = words.sort()
print("".join(words))

### FIXED CODE ###

n,l = map(int,input().split())
words = [input() for i in range(n)]
word = sorted(words)
print("".join(word))
A, B = map(int,input().split())

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

lst = make_divisors(A, B)
m = max(lst)

hurui = [1] * (m+1)
hurui[0] = 0
for j in range(2, m//2+1):
    for k in range(j, m+1, j):
        if k == j:
            continue
        hurui[k] += 1

cand = []
for i, v in enumerate(hurui):
    if v == 1:
        cand.append(i)
print(len(set(cand) & set(lst)))

### FIXED CODE ###

from math import gcd
A, B = map(int,input().split())
max_cmn_div = gcd(A, B)

# 約数列挙関数
def make_divisor(n):
    divisor = []
    for i in range(1, int(n**(1/2))+1):
        if n % i == 0:
            divisor.append(i)
            if i != n//i:
                divisor.append(n//i)
    return divisor

def check_prime(n):
    for i in range(2, int(n**(1/2))+1):
        if n % i == 0:
            return 0
    return 1

cmn_div = make_divisor(max_cmn_div)
ans = 0
for i in cmn_div:
    if check_prime(i):
        ans += 1
print(ans)