Harryxun/stf_run huggingface dataset:
N = int(input())
AB = [[int(x) for x in input().split(" ")] for _ in range(N)]
AB = sorted(AB, key=lambda e: e[1])

time = 0

for i, a, b in AB:
    time += a
    if time > b:
        print("No")
        break
else:
    print("Yes")


### FIXED CODE ###

N = int(input())
AB = [[int(x) for x in input().split(" ")] for _ in range(N)]

AB = sorted(AB, key=lambda e: e[1])

time = 0


for a, b in AB:
    time += a
    if time > b:
        print("No")
        break
else:
    print("Yes")
import collections
a = int(input())
line = [input() for k in range(a)]
c = collections.Counter(line)
max_number = max(c.values())
common = c.most_common()
max_common = []
for k in range(a):
  if common[k][1] == max_number:
    max_common.append(common[k][0])
  else:
    break
for k in sorted(max_common):
  print(k)

### FIXED CODE ###

import collections
a = int(input())
line = [input() for k in range(a)]
c = collections.Counter(line)
common = c.most_common()
max_number = common[0][1]
a = len(common)
max_common = []
for k in range(a):
  if common[k][1] == max_number:
    max_common.append(common[k][0])
  else:
    break
for k in sorted(max_common):
  print(k)
from fractions import gcd
def resolve():
    n=int(input())
    A=set(map(int,input().split()))
    ans=0
    if n==2:
        print(max(A))
        return
    for a in A:
        ans=max(ans,gcd(*(A^{a})))
    print(ans)
resolve()

### FIXED CODE ###

class Segtree(object):
    def __init__(self,A,f,u):
        n=2**(len(A).bit_length())
        N=2*n-1
        self.__num=n
        self.__len=N
        self.__seg=[u]*N
        self.__f=f
        self.__u=u
        # init
        for i in range(len(A)): # set
            self.__seg[n+i-1]=A[i]
        for i in range(n-2,-1,-1): # built, iの子のnodeは2i+1,2i+2
            self.__seg[i]=f(self.__seg[2*i+1],self.__seg[2*i+2])

    def __repr__(self):
        return str(self.__seg)

    def get_tree(self):
        return self.__seg

    def update(k,v):
        "A[k]=v"
        k+=self.__num-1
        self.__seg[k]=v
        while k+1: # k=0の処理が終わったら-1になってる
            k=(k-1)//2 # kの親のnodeは(k-1)//2
            self.__seg[k]=self.__f(self.__seg[k*2+1],self.__seg[k*2+2])

    def query(self,p,q): # reduce(f,A[p:q])
        if q<=p: return self.__u
        p+=self.__num-1
        q+=self.__num-2
        res=self.__u
        while q-p>1:
            if p&1==0:
                res=self.__f(res,self.__seg[p])
            if q&1==1:
                res=self.__f(res,self.__seg[q])
                q-=1
            p=p//2
            q=(q-1)//2
        if p==q: res=self.__f(res,self.__seg[p])
        else: res=self.__f(self.__f(res,self.__seg[p]),self.__seg[q])
        return res


def resolve():
    from fractions import gcd
    n=int(input())
    A=list(map(int,input().split()))
    if n==2:
        print(max(A))
        return
    seg=Segtree(A,gcd,0)
    ans=0
    for i in range(n):
        ans=max(ans,gcd(seg.query(0,i),seg.query(i+1,n)))
    print(ans)

resolve()
import math


def get_num(i):
    return int(b / i) - int((a-1) / i)


a, b, c, d = [int(i) for i in input().split()]

all_num = b - a + 1
c_num = get_num(c)
d_num = get_num(d)
lcm = int(c * d / math.gcd(c, d))
lcm_num = get_num(lcm) 

print(all_num - c_num - d_num + lcm_num)


### FIXED CODE ###

a, b, c, d = [int(i) for i in input().split()]


def get_num(i):
    return b // i - (a-1) // i


def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a


def lcm(a, b):
    return a * b // gcd(a, b)


all_num = b - a + 1
c_num = get_num(c)
d_num = get_num(d)
lcm = lcm(c, d)
lcm_num = get_num(lcm)

print(all_num - c_num - d_num + lcm_num)
a,b,c = map(int, raw(input().split)
print len[x for x in range(a,b+1) if c % x == 0]


### FIXED CODE ###

(a,b,c) = map(int, raw_input().split())
print len([x for x in range(a,b+1) if c % x == 0])
N=int(input())
a=[int(x) for x in input().split()]
b=a
t=-1
s=0
while s==0:
  for i in range(N):
    if b[i]%2!=0:
      s=1
    b[i]=b[i]/2
  t=t+1
print(t)


### FIXED CODE ###

x=input()
X=list('{}'.format(x))
a=[]
for i in range(len(X)):
    a.append(int(X[i]))
A=sum(a)
print(A)
a,b,c = map(int,imput().split())
print(a*b//2)

### FIXED CODE ###

a,b,c = map(int,input().split())
print(a*b//2)
N = int(input())
A = list(map(int,input().split()))


Sum = 0
mod_n = 10.0E8 +7

for i in range(N-1):
    for j in range(i+1,N):
        if j == len(A):
            break
        else:
            Sum +=  A[i]*A[j]
        


# for i in A:
#     Sum -= i**2

# Sum = int(Sum/2)
print(Sum)


print(int(Sum % mod_n))

### FIXED CODE ###

D, T, S = map(int, input().split())

time = D/S

if time > T:
    print("No")
else: print("Yes")
import numpy as np
from numpy.linalg import solve
N = int(input())
A = np.array(list(map(int,input().split())))


x = np.roll(np.eye(N),1)
x[0,0]=0
x[N-1,0]=1
x += np.eye(N)
x /= 2


print(" ".join( list(map(str,list(map(int,solve(x,A).tolist()))))))

### FIXED CODE ###

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

# A[0]は0と1の間に振ったものなので、
a = 0
for i in range(N//2):
  a +=  A[2*i] - A[2*i+1]

a0 = (a + A[-1]) //2

for i in A:
  print(a0*2,end=" ")
  a0 = i - a0
a, b = map(int, raw_input().split())

if a>b:
????print 'a > b'
if a<b:
????print 'a < b'
if a==b:????
  print 'a == b'

### FIXED CODE ###

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

if a>b:
  print "a > b"
if a<b:
  print "a < b"
if a==b:
  print "a == b"
N, K = map(int, input().split())
S = input()
for i in range(N):
  if i + 1 == K:
    S[i] = S[i].lower()
  else:
    S[i] = S[i]
print(S)

### FIXED CODE ###

N, K = map(int, input().split())
S = input()
ans = ''
for i in range(N):
  if i + 1 == K:
    ans += S[i].lower()
  else:
    ans += S[i]
print(ans)
a = input()
b = 0
for i in len(a):
  if a.count(a[i])%2!=0:
    print("No")
    b = 1
    break
if b==0:
  print("Yes")
  
    

### FIXED CODE ###

a = input()
b = 0
for i in range(len(a)):
  if a.count(a[i])%2!=0:
    print("No")
    b = 1
    break
if b==0:
  print("Yes")
*x,=range(int(input())+1);x[::3]=x[::5]=0;print(sum(x))

### FIXED CODE ###

print(sum(i%3>0<i%5and i for i in range(int(input())+1)))
def f():
 n,c=map(int,input().split())
 for h in'9731':
  if n>1:
   for m in range(int(10**(n-1)),0,-1):
    if((int(h)+m-1)*2+(c>=0)*c)%3:
     t=h+str(m-1).zfill(n-1)
     a=int(t+str(c)*(c>=0)+t[::-1])
     for i in range(3,int(x**.5+1),2):
      if x%i==0:break
     else:return a
  else:
   a=int(h+str(c)*(c>=0)+h)
   for i in range(3,int(x**.5+1),2):
    if x%i==0:break
   else:return a
 return'9'*n+str(c)*(c>=0)+'9'*n
print(f())


### FIXED CODE ###

def p(x):
 for i in range(3,int(x**.5+1),2):
  if x%i==0:return 0
 return 1
def f():
 n,c=map(int,input().split())
 s='9'*n
 if c<0:return(11,s+s)[n>1]
 for h in'9731':
  if n-1:
   for m in range(int(10**~-n),0,-1):
    t=h+str(m-1).zfill(n-1)
    a=int(t+str(c)+t[::-1])
    if p(a):return a
  else:
   a=int(h+str(c)+h)
   if p(a):return a
 return s+str(c)+s
print(f())
a = list(input())
i = 0
while True:
    odd = a[i]
    if odd == 'L':
        print('NO')
        break
    i += 1
    if i+1 == len(a):
        print('YES')
        break
    even = a[i]
    if even == 'R':
        print('NO')
        break
    i += 1
    if i+1 == len(a):
        print('YES')
        break


### FIXED CODE ###

a = list(input())
i = 0
while True:
    odd = a[i]
    if odd == 'L':
        print('No')
        break
    i += 1
    if i == len(a):
        print('Yes')
        break
    even = a[i]
    if even == 'R':
        print('No')
        break
    i += 1
    if i == len(a):
        print('Yes')
        break
n = int(input())
s = [str(i) for i in input().split()]
 
print("Three" if len(list(set(s))) == 3 else "Four" if len(list(set(s))) == 4)

### FIXED CODE ###

def abc089_b():
    n = int(input())
    s = [str(i) for i in input().split()]

    return "Three" if len(set(s)) == 3 else "Four"


if __name__ == '__main__':
    print(abc089_b())
from functools import reduce

k = int(input())

wa = 0

for a in range(1,k+1):
    for b in range(a+1,k+1):
        for c in range(b+1,k+1):
            li = [a,b,c]
            wa += reduce(math.gcd,li)*6

for a in range(1,k+1):
    for b in range(a+1,k+1):
        wa += math.gcd(a,b)*6

for a in range(1,k+1):
    wa += a
    
print(wa)

### FIXED CODE ###

import math
from functools import reduce
import sys
sys.setrecursionlimit(2000000)

k = int(input())

wa = 0

for a in range(1,k+1):
    for b in range(a+1,k+1):
        for c in range(b+1,k+1):
            li = [a,b,c]
            wa += reduce(math.gcd,li)*6

for a in range(1,k+1):
    for b in range(a+1,k+1):
        wa += math.gcd(a,b)*6

for a in range(1,k+1):
    wa += a
    

print(wa)
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if b-a<=k and c-b<=k and d-c<=k and e-d<=K:
  print(":(")
else:
  print("Yay!")

### FIXED CODE ###

a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
k=int(input())
if e-a<=k:
  print("Yay!")
else:
  print(":(")
N,Wmax=map(int,input().split(' '))
W=[]
V=[]
for _ in range(N):
	w,v = map(int,input().split(' '))
	W.append(w)
	V.append(v)

#dp[i][j]=i番目の品物までだけを選び重量制限をjとしたときの価値の最大値
dp_last = []
dp_last.append([0]*min(W[0],Wmax+1)+ [V[0]]*max(0, Wmax+1-W[0]))


for i in range(1,N):
	#今回の重量制限をwとする
	#今回は荷物を積む場合: dp[i][w] = dp[i-1][w-w[i]]+v[i] 
	#今回は荷物を積まない場合: dp[i][w] = dp[i-1][w]
	#よってこの2つのうち大きいほうをdp[i][w]に採用する
	dp = []
	for j in range(Wmax+1):
		if j<W[i]:
			dp.append(dp_last[j])
		else:
			dp.append(max(dp_last[j], dp_last[j-W[i]]+V[i]))
	dp_last = dp
print(dp[Wmax])

### FIXED CODE ###

N,Wmax=map(int,input().split(' '))
W=[]
V=[]
for _ in range(N):
	w,v = map(int,input().split(' '))
	W.append(w)
	V.append(v)

Vmax=sum(V)

# dp[i][v]=i番目の品物までだけを選び価値の合計をvとしたときの必要な重量の最小値
# ただしそのような価値の合計が実現不可能なときはNoneを格納

dp = []
for _ in range(N):
	dp.append([None]*(Vmax+1))

dp[0][0] = 0
dp[0][V[0]] = W[0]

for i in range(1,N):
	# 新しく積めるようになる荷物の価値をV[i]とする
	# このとき価値の合計をvにするのに必要な重量の最小値は
	#	  dp[i-1][v-V[i]]+W[i] と
	#   dp[i-1][v] のうち小さいほう
	for v in range(Vmax+1):
		if v-V[i]<0:
			dp[i][v] = dp[i-1][v]
		else:
			if dp[i-1][v] is not None:
				if dp[i-1][v-V[i]] is not None:
					dp[i][v] = min(dp[i-1][v],dp[i-1][v-V[i]]+W[i])
				else:
					dp[i][v] = dp[i-1][v]
			else:
				if dp[i-1][v-V[i]] is not None:
					dp[i][v] = dp[i-1][v-V[i]]+W[i]

ans = 0
for v in range(Vmax+1):
	try:
		ans = v if dp[-1][v]<=Wmax else ans
	except TypeError:
		pass

print(ans)
import numpy as np
from scipy.sparse.csgraph import connected_components
from scipy.sparse import csr_matrix
import collections

N,M = map(int,input().split())
N = 2*(10**5)
edge = np.array([input().split() for _ in range(M)], dtype = np.int64).T
tmp = np.ones(M, dtype = np.int64).T
graph = csr_matrix((tmp, (edge[:] -1)), (N, N))

n, labels = connected_components(graph)

c = collections.Counter(labels)

print(max(c.values()))


### FIXED CODE ###

import numpy as np
from scipy.sparse.csgraph import connected_components
from scipy.sparse import csr_matrix
import collections

N, M = map(int, input().split())
edge = np.array([input().split() for _ in range(M)], dtype=np.int64).T

if M == 0:
    print(1)
else:
    tmp = np.ones(M, dtype=np.int64).T
    graph = csr_matrix((tmp, (edge[:] - 1)), (N, N))

    n, labels = connected_components(graph)

    c = collections.Counter(labels)

    print(max(c.values()))
s = input()

N = len(s)

i = 0
result = 0
count_a = 0
count_bc = 0

while i < N-2:
    if s[i] == 'A':
        while s[i] == 'A':
            count_a += 1
            i += 1
        
        if i >= N-1:
            break
        
        if s[i] == 'B' and s[i+1] == 'C':
            result += count_a - 1
        
        count_a = 0
        
        while s[i] == 'B' and s[i+1] == 'C':
            count_bc += 1
            i += 2
            if i >= N-1:
                break
            if s[i] == 'A':
                count_a = 1
        
        result += count_bc
        count_bc = 0
                    
    else:
        i += 1
        
print(result)    

### FIXED CODE ###

s = input()

N = len(s)

i = 0
result = 0
count_a = 0
count_bc = 0

while i < N-2:
    if s[i] == 'A':
        while s[i] == 'A' and i < N-2:
            count_a += 1
            i += 1
        
        if i >= N-1:
            break
                        
        while s[i] == 'B' and s[i+1] == 'C':
            count_bc += 1
            i += 2
            if i >= N-1:
                break
        
        result += count_a * count_bc

        if i >= N-1:
            break
        
        if count_bc > 0 and s[i] == 'A':
            count_a = count_a
        else:
            count_a = 0
        
        count_bc = 0
                    
    else:
        i += 1
        
print(result)
import math
n_num,m_num=map(int,input().split())
n_comb=math.factorial(n_num)/(math.factorial(n_num-2)*math.factorial(2))
m_comb=math.factorial(m_num)/(math.factorial(m_num-2)*math.factorial(2))
print(int(n_comb+m_comb))


### FIXED CODE ###

def c(i):
    return i*(i-1)//2

n,m=map(int,input().split())
print(c(n)+c(m))
import copy

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

ans = []
for i in range(2**N):
    s = a.copy()
    cnt = 0
    tmp = 0
    henkou = [False for _ in range(N)]
    for j in range(N):
        if((i >> j)&1):
            henkou[j] = True
    bill = s[0]
    for k in range(1, N):
        if(henkou[k]):
            if(bill >= s[k]):
                cnt += bill-s[k]+1
                s[k] = bill+1
                bill = s[k]
        else:
            if(bill >= s[k]):
                tmp += 1
            else:
                bill = s[k]
    if(N-tmp >= K):
        ans.append(cnt)
print(min(ans))

### FIXED CODE ###

import copy

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

ans = []
for i in range(2**N):
    s = a.copy()
    cnt = 0
    tmp = 1
    henkou = [False for _ in range(N)]
    for j in range(N):
        if((i >> j)&1):
            henkou[j] = True
    bill = s[0]
    for k in range(1, N):
        if(henkou[k]):
            if(bill >= s[k]):
                cnt += bill-s[k]+1
                s[k] = bill+1
                bill = s[k]
                tmp += 1
            else:
                bill = s[k]
                tmp += 1
        else:
            if(bill < s[k]):
                bill = s[k]
                tmp += 1
    if(tmp >= K):
        ans.append(cnt)
print(min(ans), end='\n')
import sys
input = lambda: sys.stdin.readline().rstrip()
from math import gcd
a,b,c,d=map(int,input().split())
ans=(b-a+1)
lcm=(c*d)//gcd(c,d)
dba=(a//c-int(a%c==0))+(a//d-int(a%d==0))-(a//lcm-int(a%lcm==0))
dbb=(b//c)+(b//d)-(b//lcm)
dbb-=dba
ans-=dbb
print(ans)
        
        

### FIXED CODE ###

from fractions import gcd
a,b,c,d=map(int,input().split())
ans=(b-a+1)
lcm=(c*d)//gcd(c,d)
dba=(a//c-int(a%c==0))+(a//d-int(a%d==0))-(a//lcm-int(a%lcm==0))
dbb=(b//c)+(b//d)-(b//lcm)
dbb-=dba
ans-=dbb
print(ans)
import numpy as np

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

l = n - k + 1
lis = [0]*l
#0, 1, 2
for i in range(l):
  z = np.prod(a[i:i+k])
  lis[i] = z
print(lis)
for i in range(n - k):
  if lis[i] < lis[i + 1]:
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

a = int(input())

if 400 <= a < 600:
  print(8)
elif 600 <= a < 800:
  print(7)
elif 800 <= a < 1000:
  print(6)
elif 1000 <= a < 1200:
  print(5)
elif 1200 <= a < 1400:
  print(4)
elif 1400<= a < 1600:
  print(3)
elif 1600 <= a < 1800:
  print(2)
elif 1800 <= a < 2000:
  print(1)
from fractions import gcd
from functools import reduce

def lcm(a,b):
    return int(a * b / gcd(a, b))

N, M = map(int,input().split())
A = sorted(list(map(int,input().split())))
if len(A) == 1:
    lcmA = A[0]
else:
    lcmA = reduce(lcm, A)

n = lcmA
while n % 2 == 0:
    n //= 2
if n == 1:
    print(0)
else:
  print( 1 + (M - n)//lcmA)

### FIXED CODE ###

import fractions
import functools

def lcm(n1, n2):
    return n1 * n2 // fractions.gcd(n1, n2)

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

lcmA = functools.reduce(lcm, A)
gcdA = functools.reduce(fractions.gcd, A)
if (lcmA // gcdA) % 2 == 0:
    print(0)
else:
    print((M // lcmA + 1) // 2)
N = int(input())
l = [1,2,4,8,16,32,64]{[::-1]
for i in l:
  if N >= i:
    print(i)
    break



### FIXED CODE ###

N = int(input())
l = [1,2,4,8,16,32,64][::-1]
for i in l:
  if N >= i:
    print(i)
    break
a, b, c, d = input()
print("Yes" if a = b = c or b = c = d else "No")

### FIXED CODE ###

a,b,c,d = input()
if a == b == c or b == c == d:
    print("Yes")
else:
    print("No")
n = int(input())
x = input()

# 元のpopcount
original_pop_count = x.count('1')
# 反転して-1count
one_pop_count = original_pop_count - 1
# 反転して+1count
zero_pop_count = original_pop_count + 1
 
# ±1それぞれにおける余り
one_mod = int(x, 2) % one_pop_count
zero_mod = int(x, 2) % zero_pop_count
 
#f の前計算
f = [0] * 220000
pop_count = [0] * 220000
for i in range(1, 220000):
    pop_count[i] = pop_count[i//2] + i % 2
    f[i] = f[i % pop_count[i]] + 1
 
# pow2 の前計算
one_pow2 = [1] * 220000
zero_pow2 = [1] * 220000
for i in range(1, 220000):
    if one_pop_count != 0:
        one_pow2[i] = one_pow2[i-1] * 2 % one_pop_count
    zero_pow2[i] = zero_pow2[i-1] * 2 % zero_pop_count
    
# n-1, n-2, ,, 0
for i in range(n-1, -1, -1):
    if x[n-1-i] == '1':
        if one_pop_count != 0:
            nxt = one_mod
            nxt -= one_pow2[i] #2^n-i-iを引く
            nxt %= one_pop_count
            print(f[nxt] + 1)
        else:
            print(0)
    if x[n-1-i] == '0':
        nxt = zero_mod
        nxt += zero_pow2[i]　#2^n-i-iを引く
        nxt %= zero_pop_count
        print(f[nxt] + 1)

### FIXED CODE ###

n = int(input())
x = input()
 
# 元のpopcount
original_pop_count = x.count('1')
# 反転して-1count
one_pop_count = original_pop_count - 1
# 反転して+1count
zero_pop_count = original_pop_count + 1
 
# ±1それぞれにおける余り
if one_pop_count == 0:
  one_mod = 0
else:
  one_mod = int(x, 2) % one_pop_count
zero_mod = int(x, 2) % zero_pop_count
 
# f の前計算 
f = [0] * 220000
pop_count = [0] * 220000
for i in range(1, 220000):
    pop_count[i] = pop_count[i//2] + i % 2
    f[i] = f[i % pop_count[i]] + 1
 
# pow2 の前計算
one_pow2 = [1] * 220000
zero_pow2 = [1] * 220000
for i in range(1, 220000):
    if one_pop_count != 0:
        one_pow2[i] = one_pow2[i-1] * 2 % one_pop_count
    zero_pow2[i] = zero_pow2[i-1] * 2 % zero_pop_count
    
# n-1, n-2, ,, 0
for i in range(n-1, -1, -1):
    if x[n-1-i] == '1':
        if one_pop_count != 0:
            nxt = one_mod
            # - 2^i % 2
            nxt -= one_pow2[i]
            nxt %= one_pop_count
            print(f[nxt] + 1)
        else:
            print(0)
    if x[n-1-i] == '0':
        nxt = zero_mod
        nxt += zero_pow2[i]
        # + 2^i % 2
        nxt %= zero_pop_count
        print(f[nxt] + 1)
a, b, c, = map(int, input().split())
pront("Yes") if a <= c =< b else print("No")

### FIXED CODE ###

A, B, C = map(int, input().split())
if A <= C and C <= B:
  print("Yes")
else:
  print("No")
s = input()
alps = 'abcdefghijklmnopqrstuvwxyz'
for i in alps:
    if i not in s:
        print(alp)
        break
else:
    print('None')


### FIXED CODE ###

s = input()
alps = 'abcdefghijklmnopqrstuvwxyz'
for alp in alps:
    if alp not in s:
        print(alp)
        break
else:
    print('None')
X, Y, Z, K = map(int, input().split())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

if X * Y * Z > 3000:
    X = 3000
    Y = 3000
    Z = 3000

ans_list = []
for i in range(X):
    for j in range(Y):
        for k in range(Z):
            sum = A[i]+B[j]+C[k]
            ans_list.append(sum)        
ans_list.sort(reverse=True)
for i in range(K):
    print(ans_list[i])


### FIXED CODE ###

from itertools import product

X, Y, Z, K = map(int, input().split())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

a = []
count = 0
for i in range(X):
    for j in range(Y):
        if (i+1)*(j+1) > K:
            break
        for k in range(Z):
            if (i+1)*(j+1)*(k+1) > K:
                break
            a.append(A[i] + B[j] + C[k])

a.sort(reverse=True)

for i in range(K):
    print(a[i])
#include<bits/stdc++.h>
using namespace std;
strint s1, s2;
int leng;
int main()
{
    cin >> s1;
    for(int i = s1.size() - 1; i >= 0; i--)
        s2[leng++] = s1[i];
    for(int i = 0; i < leng; i++)
    {
        if(s1[i]=='b') s2[i] = 'd';
        else if (s1[i] == 'd') s2[i] = 'b';
        else if (s1[i] == 'p') s2[i] = 'q';
        else if (s1[i] == 'q') s2[i] = 'p';
    }
    if(!strcmp(s1,s2)) puts("Yes");
    else puts("No");
    return 0;
}

### FIXED CODE ###

mp={'b':'d','d':'b','p':'q','q':'p'};a=list(input());print("Yes"if a==[mp[x]for x in a[::-1]]else"No");
import numpy as np
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)

H, W = map(int, input().split())
A = np.array([input().split() for _ in range(H)], dtype=int)
B = np.array([input().split() for _ in range(H)], dtype=int)
dif = np.abs(A - B).tolist()

U = (H + W) * 80
Um = U // 2

dp = [[[] for _ in range(W)] for _ in range(H)]
X = np.zeros(U + 1, dtype=bool)
X[Um + dif[0][0]] = True
X[Um - dif[0][0]] = True
dp[0][0] = X


for i in range(H):
    for j in range(W):
        if i == j == 0:
            continue
        X = np.zeros(U + 1, dtype=bool)
        d = dif[i][j]
        if i > 0:
            X[d:] |= dp[i - 1][j][:-d]
            X[:-d] |= dp[i - 1][j][d:]
        if j > 0:
            X[d:] |= dp[i][j - 1][:-d]
            X[:-d] |= dp[i][j - 1][d:]
        dp[i][j] = X

tmp = np.arange(U+1)[dp[H-1][W-1]]
ans = np.abs(tmp - Um).min()
print(ans)

### FIXED CODE ###

import numpy as np
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)

H, W = map(int, input().split())
A = np.array([input().split() for _ in range(H)], dtype=int)
B = np.array([input().split() for _ in range(H)], dtype=int)
dif = np.abs(A - B).tolist()

U = (H + W) * 80
Um = U // 2

dp = [[[] for _ in range(W)] for _ in range(H)]
X = np.zeros(U + 1, dtype=bool)
X[Um + dif[0][0]] = True
X[Um - dif[0][0]] = True
dp[0][0] = X


for i in range(H):
    for j in range(W):
        if i == j == 0:
            continue
        d = dif[i][j]
        X = np.zeros(U + 1, dtype=bool)
        if d:
            if i > 0:
                X[d:] |= dp[i - 1][j][:-d]
                X[:-d] |= dp[i - 1][j][d:]
            if j > 0:
                X[d:] |= dp[i][j - 1][:-d]
                X[:-d] |= dp[i][j - 1][d:]
        else:
            if i > 0:
                X |= dp[i - 1][j]
            if j > 0:
                X |= dp[i][j - 1]
        dp[i][j] = X

tmp = np.arange(U+1)[dp[H-1][W-1]]
ans = np.abs(tmp - Um).min()
print(ans)
k = input()
s = input()

if s > len(str(k)):
  print(s)
else:
  print(s[k:] + '...')

### FIXED CODE ###

k = int(input())
s = input()
 
if len(str(s)) <= k:
  print(s)
else:
  print(s[:k] + '...')
n, p = map(int, input().split())
if n==1:
  print(p)
  exit()
for i in range(round(p**(1/n)))[::-1]:
  if p%(i**n)==0:
    print(i)
    exit()


### FIXED CODE ###

n, p = map(int, input().split())
if n==1:
  print(p)
  exit()
elif p==1 or n>=60:
  print(1)
  exit()
for i in range(int(p**(1/n))+1, 0, -1):
  if p%(i**n)==0:
    print(i)
    exit()
x = input()
x = int(x)

answer = []
for p in range(2, x):

    for i in range(2, x):
        test = i**p
        if test > 1000:
            break
        if test > x:
            answer.append((i-1)**p)
            break
        elif test == x:
            answer.append(i**p)
            break

print(max(answer))

### FIXED CODE ###

X = int(input())

beki = 0
for p in range(2, 9):
    tmp = 0
    b = 1
    while tmp <= X:
        tmp = b**p
        if tmp > X:
            break
        beki = max(tmp, beki)
        b += 1

print(beki)