Harryxun/stf_run huggingface dataset:
import sys

def f(x):
    p=0
    cnt=0
    for i in range(n-1,-1,-1):
        while p<n and a[i]+a[p]<x:
            p+=1
        cnt+=n-p
    return cnt

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

l,r=a[0]*2,a[n-1]*2

while r-l>0:
    if r-l<=1:
        if f(r)==m: md=r;break 
        else: md=l;break
    md=(r+l)//2
    k=f(md)
    if k==m: break
    elif k>m: l=md
    else: r=md

p=0
cnt=0
ans=0

for q in range(n-1,-1,-1):
    try:
        while p<n and a[q]+a[p]<=md:
            p+=1
    except:
        print(ans)
        sys.exit()

    if p==n: break
    cnt+=n-p
    ans+=a[q]*(n-p)*2


ans+=(m-cnt)*md
print(ans)

### FIXED CODE ###

def f(i):
    return i
s,t=map(f,input().split())
print(t+s)
N = int(readline())
H = list(map(int, readline().split()))

if N == 1:
    print(0)
    exit()

dp = [0] * N

for i in range(N-2, -1, -1):
    if H[i] >= H[i+1]:
        dp[i] = 1 + dp[i+1]

print(max(dp))

### FIXED CODE ###

import sys
readline = sys.stdin.buffer.readline

N = int(readline())
H = list(map(int, readline().split()))

if N == 1:
    print(0)
    exit()

dp = [0] * N

for i in range(N-2, -1, -1):
    if H[i] >= H[i+1]:
        dp[i] = 1 + dp[i+1]

print(max(dp))
import sys
import copy

def main():
    ABCD = list(map(str, input()))
    b_digit = len(ABCD)-1

    for i in range(2 ** b_digit):
        signs = ["+"] * b_digit
        for j in range(b_digit):
            if ((i >> j ) & 1):
                signs[b_digit - 1 - j] ="-"

        ABCD_tmp = copy.deepcopy(ABCD)
        for k in range(len(signs)):
            ABCD_tmp.insert(1+k*2,signs[k])
            if(eval("".join(ABCD_tmp))==7):
                    print("{}=7".format("".join(ABCD_tmp)))
                    sys.exit()

main()

### FIXED CODE ###

import sys
import copy

def main():
    ABCD = list(map(str, input()))
    b_digit = len(ABCD)-1

    for i in range(2 ** b_digit):
        signs = ["+"] * b_digit
        for j in range(b_digit):
            if ((i >> j ) & 1):
                signs[b_digit - 1 - j] = "-"

        ABCD_tmp = copy.deepcopy(ABCD)
        for k in range(len(signs)):
            ABCD_tmp.insert(1+k*2,signs[k])
        if(eval("".join(ABCD_tmp))==7):
            print("{}=7".format("".join(ABCD_tmp)))
            sys.exit()

main()
A, B, C = map(int, input().split())
if sum(A, B, C) % 2 == max(A, B, C) * 3:
  print((max(A, B, C) * 3 - sum(A, B, C)) // 2)
else:
  print(((max(A, B, C) + 1) * 3 - sum(A, B, C)) // 2)

### FIXED CODE ###

A, B, C = map(int, input().split())
if sum((A, B, C)) % 2 == max(A, B, C) % 2:
  print((max(A, B, C) * 3 - sum((A, B, C))) // 2)
else:
  print(((max(A, B, C) + 1) * 3 - sum((A, B, C))) // 2)
n = int(input())
d = int(input())
i = (d * 2) + 1
if n % i == 0 :
  print(n / i)
else :
  print((n // i) + 1)


### FIXED CODE ###

n, d = map(int, input().split())
i = (d * 2) + 1
if n % i == 0 :
  print(n // i)
else :
  print((n // i) + 1)
import math
while True:
	a, b = map(int, input().split())
	if(a==0 and b==0):
		break
	print(int(math.log10(a + b)) + 1)


### FIXED CODE ###

while True:
	try:
		a, b = map(int, input().split())
		print(len(str(a+b)))
	except:
		break
num = raw_input()
val = raw_input()

if int(num) < 10:
	rate = int(val) + 100*(10 - int(num))
	print	rate
else:
	rate = int(val)
	print	rate


### FIXED CODE ###

def main():
	num,val = input().split(" ")
	num = int(num)
	val = int(val)

	if num < 10:
		print(val + 100*(10-num))
	else:
		print(val)

if __name__ == "__main__":
    main()
A,B,C,D = map(int, input().split())
X = B//C - (A-1)//C
Y = B//D - (A-1)//D
Z = B//lcm - (A-1)//int(C/math.gcd(C,D) *D)
print(B-A+1-X-Y+Z)

### FIXED CODE ###

from fractions import gcd
A,B,C,D = map(int, input().split())
X = B//C - (A-1)//C
Y = B//D - (A-1)//D
lcm = round(C*D//gcd(C,D))
Z = B//lcm - (A-1)//lcm
print(B-A+1-X-Y+Z)
k = int(input())
a, b = list(map(int, input().split()))

for i in range(1000):
    if k*i >= a and k*i=<b:
        print("OK")
        exit()
    if k*i > b:
        break

print("NG")

### FIXED CODE ###

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

for i in range(1001):
    if k*i >= a and k*i<=b:
        print("OK")
        exit()
    if k*i > b:
        break

print("NG")
import fractions.

[n, x] = list(map(int, input().split()))
xn = list(map(int, input().split()))

xn = sorted(xn + [x])
gcd = xn[1] - xn[0]
b = xn[1]
for a in xn[2:]:
    gcd = fractions..gcd(b - a, gcd)
    b = a
print(gcd)

### FIXED CODE ###

import fractions
from functools import reduce
import numpy as np

[n, x] = list(map(int, input().split()))
xn = list(map(int, input().split()))

xn += [x]
xn = np.abs(np.diff(xn))
print(reduce(fractions.gcd, xn))
h,w = map(int, input().split())
maze = [input() for i in range(h)]
route = [[0] * w for i in range(h)]
white = 0
for i in range(h):
    for j in range(w):
        if maze[i][j] == '.':
            white += 1
 
 
class MyStack:
    def __init__(self):
        self.stack = []
    def push(self, item_1, item_2):
        self.stack.append([item_1,item_2])
    def pop(self):
        result = self.stack.pop(0)
        return result[0],result[1]
 
 
def min_route():
    global h,w
    stack = MyStack()
    stack.push(1,1)
    route[0][0] = 0
 
    while n <= h*w:
        y,x = stack.pop()
        route_num = route[y-1][x-1] + 1
        if y != h:
            if maze[y][x-1] == '.' and route[y][x-1] == 0:
                stack.push(y+1,x)
                route[y][x-1] += route_num
        if y != 1:
            if maze[y-2][x-1] == '.' and route[y-2][x-1] == 0:
                stack.push(y-1,x)
                route[y-2][x-1] += route_num
        if x != w:
            if maze[y-1][x] == '.' and route[y-1][x] == 0:
                stack.push(y,x+1)
                route[y-1][x] += route_num
        if x != 1:
            if maze[y-1][x-2] == '.' and route[y-1][x-2] == 0:
                stack.push(y,x-1)
                route[y-1][x-2] += route_num
        if route[h-1][w-1]  != 0:
            return route[h-1][w-1]
 
ans = white - min_route() - 1
 
if ans < 0:
    print(-1)
else:
    print(ans)

### FIXED CODE ###

h,w = map(int, input().split())
maze = [input() for i in range(h)]
route = [[0] * w for i in range(h)]
white = 0
for i in range(h):
    for j in range(w):
        if maze[i][j] == '.':
            white += 1
 
 
class MyStack:
    def __init__(self):
        self.stack = []
    def push(self, item_1, item_2):
        self.stack.append([item_1,item_2])
    def pop(self):
        result = self.stack.pop(0)
        return result[0],result[1]
 
 
def min_route():
    global h,w
    stack = MyStack()
    stack.push(1,1)
    route[0][0] = 0
    n = 0
    while len(stack.stack) >= 1:
        y,x = stack.pop()
        route_num = route[y-1][x-1] + 1
        if y != h:
            if maze[y][x-1] == '.' and route[y][x-1] == 0:
                stack.push(y+1,x)
                route[y][x-1] += route_num
        if y != 1:
            if maze[y-2][x-1] == '.' and route[y-2][x-1] == 0:
                stack.push(y-1,x)
                route[y-2][x-1] += route_num
        if x != w:
            if maze[y-1][x] == '.' and route[y-1][x] == 0:
                stack.push(y,x+1)
                route[y-1][x] += route_num
        if x != 1:
            if maze[y-1][x-2] == '.' and route[y-1][x-2] == 0:
                stack.push(y,x-1)
                route[y-1][x-2] += route_num
        if route[h-1][w-1]  != 0:
            return route[h-1][w-1]
        n += 1
    print(-1)
    exit()
 
ans = white - min_route() - 1
 
if ans < 0:
    print(-1)
else:
    print(ans)
in = str(input())
s0 = int(in[0])
s1 = int(in[1])
s2 = int(in[2])

print(s0+s1+s2)

### FIXED CODE ###

in_s = str(input())
s0 = int(in_s[0])
s1 = int(in_s[1])
s2 = int(in_s[2])
 
print(s0+s1+s2)
Answer = []
flg = 1

def Taxed(p,q):
    T = int(p*(1+q/100))
    return T

while flg > 0:
    inp = input().split()
    x = int(inp[0])
    y = int(inp[1])
    s = int(inp[2])

    flg = x**2+y**2+s**2
    if flg == 0:
        break

    M = 0
    for i in range(1,s-1):
        for j in range(1,s-1):
            a = Taxed(i,x)
            b = Taxed(j,x)
            if (a+b) == s:
                M_temp = Taxed(i,y) + Taxed(j,y) 
                M = max(M,M_temp)
    Answer.append(M)

for k in range(0,len(Answer)):
    print(Answer[k])

### FIXED CODE ###

c = 1
Answer = []

while c > 0:
    inp = input().split()
    n = int(inp[0])
    x = int(inp[1])
    c = n**2+x**2
    if c == 0:
        break

    flg = 0
    for i in range(1,min(int(x/3),n-1)):
        for j in range(i+1,min(int(x/2),n)):
            for k in range(j+1,n+1):
                if i+j+k == x:
                    flg += 1
    Answer.append(flg)

for l in range(0,len(Answer)):
    print(Answer[l])
# import sys  sys.exit()を使う時に必要

def main():
  if 'get_ipython' not in globals():  
    # For Subsession
    # N = int(input())
    X, Y, Z, K = 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()] 
    # S = [input() for _ in range(N)]  縦持ち／行数N
    # t = [0] * N  　　ti xi yi 縦持ち/行数N
    # x = [0] * N
    # y = [0] * N
    # for i in range(N):
    #   t[i], x[i], y[i] = map(int, input().split())
  else:
    A = [1,10,100]
    B = [2,20,200]
    C = [1,10,100]
    X = len(A)
    Y = len(B)
    Z = len(C)
    K = 5

  ans = []
  # Processing
  A.sort(reverse=True)
  B.sort(reverse=True)
  C.sort(reverse=True)
      
  for i in A:
    if i >= A[min(K,X)-1]:
      for j in B:
        if j >= B[min(K,Y)-1] :
          for k in C:
            if k >= C[min(K,Z)-1]:
              ans.append(i+j+k)
            else:
              break
        else:
          break
    else:
      break
    
  ans.sort(reverse=True)
  if 'get_ipython' in globals(): 
    print(ans)

  for i in range(0,K):
    print(ans[i])      

main()

### FIXED CODE ###

def main():
  if 'get_ipython' not in globals():  
    # For Subsession
    X, Y, Z, K = (int(i) for i in 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()] 
  else:
    A = [1,10,100]
    B = [2,20,200]
    C = [1,10,100]
    #A = [4,6]
    #B = [1,5]
    #C = [3,8]
    X = len(A)
    Y = len(B)
    Z = len(C)
    K = 5
    #K = 8

  # Processing
  AB = []
  A.sort(reverse=True)
  B.sort(reverse=True)
  for i in A[0:K]:
    for j in B[0:K]:
      AB.append(i+j)
  
  AB.sort(reverse=True)
  
  ABC = []
  C.sort(reverse=True)
  
  for i in AB[0:K]:
    for j in C[0:K]:
      ABC.append(i+j)  
  
  ABC.sort(reverse=True)

  for i in ABC[0:K]:
    print(i)      

main()
k,n = map(int,input().split())
A = list(map(int,input().split()))
A.append(k)
A.sort()
m = max(y-x for x,y in zip(A,A[1:]))
ans = k-m
print(ans)

### FIXED CODE ###

s = input()
if s[2]==s[3] and s[4]==s[5]:
    print('Yes')
else:
    print('No')
x, a, b = map(int, input().split())
print((abs(x-a) > abs(x-b)) ? "A" : "B")

### FIXED CODE ###

x, a, b = map(int, input().split())
if abs(x-a) > abs(x-b):
  print("B")
else:
  print("A")
ans = 0
answer = []
S = input()
for s in S:
    if s == "R":
        ans += 1
    else:
        answer.append(ans)
        ans = 0
print(max(answer))

### FIXED CODE ###

ans = 0
answer = []
S = input()
for s in S:
    if s == "R":
        ans += 1
    else:
        answer.append(ans)
        ans = 0
answer.append(ans)
print(max(answer))
#全体に同じものを足すときは累積和を考えたい

N,Q = map(int,input().split())
AB = [list(map(int,input().split())) for _ in range(N-1)]
PX = [list(map(int,input().split())) for _ in range(Q)]

graph = [set([]) for _ in range(N+1)]
for a,b in AB:
    graph[a].add(b)
    graph[b].add(a)
#どちらが親か分からないがとりあえずつながっている
#どちらが親かは後で判断

counter = [0 for _ in range(N+1)]
#counter[i]:i番目の頂点のカウンター

for p,x in PX:
    counter[p] += x

def cal(graph,counter,edge,parent):
    for e in (graph[edge]):
        if e != parent:
            counter[e] += counter[edge]
            cal(graph,counter,e,edge)

cal(graph,counter,1,None)

ans = " ".join(map(str,counter[1:]))
print(ans)


### FIXED CODE ###

#全体に同じものを足すときは累積和を考えたい

N,Q = map(int,input().split())
AB = [list(map(int,input().split())) for _ in range(N-1)]
PX = [list(map(int,input().split())) for _ in range(Q)]

graph = [[] for _ in range(N+1)]

for a,b in AB:
    graph[a].append(b)
    graph[b].append(a)
#どちらが親か分からないがとりあえずつながっている
#どちらが親かは後で判断

counter = [0 for _ in range(N+1)]
#counter[i]:i番目の頂点のカウンター
parent = [None for _ in range(N+1)]

for p,x in PX:
    counter[p] += x

def dfs(graph,counter,edge):
    stk = []
    stk.append(edge)
    while len(stk) > 0:
        p = stk.pop()
        for e in graph[p]:
            if parent[p] == e:
                continue
            else:
                parent[e] = p
                counter[e] += counter[p]
                stk.append(e)

dfs(graph,counter,1)

ans = " ".join(map(str,counter[1:]))
print(ans)
from math import floor
A, B , N = map(int, input().split())

Answer = floor((A*N)/B) - (A*floor(N/B))

print(Answer)

### FIXED CODE ###

K = int(input())
A, B = map(int, input().split())
check = 0
for i in range(A, B+1):
    if i % K == 0:
        print("OK")
        check = 1
        break
if check == 0:
    print("NG")
a,b=map(int,input().split())
if a%3==0 or b%3==0 or c%3==0:
  print("Possible")
else:
  print("Impossible")

### FIXED CODE ###

a,b=map(int,input().split())
if a%3==0 or b%3==0 or (a+b)%3==0:
  print("Possible")
else:
  print("Impossible")
N = int(input())
L = []
for i in range(N):
  L.append(int(input())

 
maxL = max(L)
sumL = sum(L) - maxL
           
if maxL >= sumL :
           return 'No'
else:
           return 'Yes'

### FIXED CODE ###

n = int(input())
l = list(map(int,input().split()))
m = max(l)
s = sum(l) - m
if m < s:
  print("Yes")
else:
  print("No")
s = input()
x, y = map(int, input().split())

XY = [[], []]
b = 0
renzoku = 0
for i in range(len(s)) :
    if s[i] == "T" :
        b = (b+1) % 2
        renzoku = 0
    else :
        if renzoku == 0 :
            XY[b].append(1)
            renzoku = 1
        else :
            XY[b][-1] += 1


#print(XY)

g = 8002

X = [[0 for i in range(g*2)] for j in range(len(XY[0]))]
Y = [[0 for i in range(g*2)] for j in range(len(XY[1]))]



if len(XY[0]) > 0 :
    X[0][g+XY[0][0]] = 1
    if s[0] == "T" :
        X[0][g-XY[0][0]] = 1
        
    for i in range(1, len(XY[0])) :
        for j in range(g*2) :
            #print(X)
            if j - XY[0][i] >= 0 and X[i-1][j - XY[0][i]] == 1 :
                X[i][j] = 1
            if j + XY[0][i] <= g*2-1 and X[i-1][j + XY[0][i]] == 1 :
                X[i][j] = 1

if len(XY[1]) > 0 :

    Y[0][g+XY[1][0]] = 1
    Y[0][g-XY[1][0]] = 1
        
    for i in range(1, len(XY[1])) :
        for j in range(20000) :
            if j - XY[1][i] >= 0 and Y[i-1][j - XY[1][i]] == 1 :
                Y[i][j] = 1
            if j + XY[1][i] <= g*2-1 and Y[i-1][j + XY[1][i]] == 1 :
                Y[i][j] = 1

if X == [] :
    X = [[0 for i in range(g*2)]]
if Y == [] :
    Y = [[0 for i in range(g*2)]]

if ((len(XY[0]) == 0 and x == 0) or X[-1][g+x] == 1) and ((len(XY[1]) == 0 and y == 0) or Y[-1][g+y] == 1) :
    print("Yes")
else :
    print("No")


### FIXED CODE ###

s = input()
x, y = map(int, input().split())
n = len(s)

D = [[], []]
st_x = 0
st_y = 0
st = 0
while st <= len(s)-1 and s[st] == "F":
    x -= 1
    st += 1

di = 0
for i in range(st, n):
    if s[i] == "T":
        di = (di+1) % 2
        D[di].append(0)
    else:
        D[di][-1] += 1

# print(D)


ANS = [0, 0]
st_po = [0, 0]
go_po = [x, y]
for i in range(2):
    mid = sum(D[i]) + 5
    DP = [[0] * (mid*2) for i in range(len(D[i]) + 1)]
    DP[0][st_po[i] + mid] = 1
    for j in range(len(D[i])):
        dd = D[i][j]
        for k in range(len(DP[0])):
            aa = 0
            bb = 0
            if 0 <= k-dd <= len(DP[0])-1:
                aa = DP[j][k-dd]
            if 0 <= k+dd <= len(DP[0])-1:
                bb = DP[j][k+dd]

            DP[j+1][k] = int(aa or bb)

    if 0 <= go_po[i]+mid <= len(DP[0])-1:
        ANS[i] = DP[-1][go_po[i]+mid]
    # print("len",mid*2)
    #if i == 1:
        # print(DP[1][7999+mid])
# print(ANS)

print("Yes" if ANS[0] and ANS[1] else "No")
r = int(input())
PI = 3.141592653589793238462647950288419
S = r * r * PI
L = 2 * r * PI
print("%.6f %.6f" % (S, L))


### FIXED CODE ###

r = float(input())
import math
PI = math.pi
S = r * r * PI
L = 2 * r * PI
print("%f %f" % (S, L))
H, W, M = map(int, input().split())
bomb = [[0] * W for _ in range(H)]
Height = [0] * H
Width = [0] * W
for m in range(M):
  h, w = map(lambda x:int(x)-1, input().split())
  bomb[h][w] += 1
  Height[h] += 1
  Width[w] += 1
max_H, max_W = max(Height), max(Width)
cH, cW = [], []
for i in range(H):
  if Height[i] == max_H:
    cH.append(i)
for i in range(W):
  if Width[i] == max_W:
    cW.append(i)

dont_sub = 0
for idx_h in cH:
  for idx_w in cW:
    if bomb[idx_h][idx_w] == 0:
      dont_sub = 1
      break
  if dont_sub == 1:
    break
if dont_sub == 0:
  print(max_H + max_W - 1)
else:
  print(max_H + max_W)

### FIXED CODE ###

H, W, M = map(int, input().split())
target = []
Height = [0] * H
Width = [0] * W
for m in range(M):
  h, w = map(lambda x: int(x)-1, input().split())
  target.append((h, w))
  Height[h] += 1
  Width[w] += 1
max_H, max_W = max(Height), max(Width)

cH, cW = 0, 0
for i in range(H):
  if Height[i] == max_H:
    cH +=1
for i in range(W):
  if Width[i] == max_W:
    cW +=1
max_cross = cH * cW

double_count = 0
for h, w in target:
  if Height[h] == max_H and Width[w] == max_W:
    double_count += 1

if double_count == max_cross:
  print(max_H + max_W - 1)
else:
  print(max_H + max_W)
N = int(input())
K = int(input())

L = list(map(int, list(str(N))))
if L < K:
  x = 1 / 0
M = len(L)
DP = [[[0] * 2 for _ in range(K + 1)] for _ in range(M)]

DP[0][1] = [L[0] - 1, 1]
DP[0][0][0] = 1

for i in range(1, M):
  DP[i][0][0] = DP[i - 1][0][0]
  for j in range(1, K + 1):
    DP[i][j][0] = DP[i - 1][j][0]
    DP[i][j][0] += DP[i - 1][j - 1][0] * 9
    DP[i][j][0] += DP[i - 1][j - 1][1] * (L[i] - 1)
    DP[i][j][0] += DP[i - 1][j][1] 
    DP[i][j][1] = DP[i - 1][j - 1][1]

ans = DP[-1][-1][0] + DP[-1][-1][1]
ans = max(0, ans)
print(ans)


### FIXED CODE ###

N = int(input())
K = int(input())

L = list(map(int, list(str(N))))
M = len(L)
DP = [[[0] * 2 for _ in range(K + 1)] for _ in range(M)]

DP[0][1] = [L[0] - 1, 1]
DP[0][0][0] = 1

for i in range(1, M):
  DP[i][0][0] = DP[i - 1][0][0]
  for j in range(1, K + 1):
    if L[i] != 0:
      DP[i][j][0] = DP[i - 1][j][0]
      DP[i][j][0] += DP[i - 1][j][1]
      DP[i][j][0] += DP[i - 1][j - 1][0] * 9
      DP[i][j][0] += DP[i - 1][j - 1][1] * (L[i] - 1)
      DP[i][j][1] = DP[i - 1][j - 1][1]
    else:
      DP[i][j][0] = DP[i - 1][j][0]
      DP[i][j][0] += DP[i - 1][j - 1][0] * 9
      DP[i][j][1] = DP[i - 1][j][1]

ans = DP[-1][-1][0] + DP[-1][-1][1]
ans = max(0, ans)
print(ans)
n, m = map(int, input().split())

ends = []
starts = []
possible = False
for i in range(m):
    a, b = map(int, input().split())
    if a == 1:
        starts.append([a, b])
    elif b == n:
        ends.append([a, b])

starts.sort(key=lambda x: x[1])
ends.sort(key=lambda x: x[0])

i = 0
j = 0
to = starts[i][1]
fr = ends[j][0]
while i != len(starts) and j != len(ends):
    to = starts[i][1]
    fr = ends[j][0]

    if to == fr:
        possible = True
        break

    if to > fr:
        i += 1
    elif fr > to:
        j += 1

while j != len(ends):
    fr = ends[j][0]
    if to == fr:
        possible = True
        break

    j += 1

while i != len(starts):
    to = starts[i][1]

    if to == fr:
        possible = True
        break

    i += 1

print("POSSIBLE") if possible else print("IMPOSSIBLE")


### FIXED CODE ###

# 10 5
# 1 2
# 1 3
# 1 4
# 8 10
# 1 8

n, m = map(int, input().split())

ends = []
starts = []
possible = False
for i in range(m):
    a, b = map(int, input().split())
    if a == 1:
        starts.append([a, b])
    elif b == n:
        ends.append([a, b])

starts.sort(key=lambda x: x[1])
ends.sort(key=lambda x: x[0])

if not (starts and ends):
    print("IMPOSSIBLE")
    import sys

    sys.exit()

i = 0
j = 0
while i != len(starts) and j != len(ends):
    to = starts[i][1]
    fr = ends[j][0]

    if to == fr:
        possible = True
        break

    if to < fr:
        i += 1
    elif fr < to:
        j += 1

while j != len(ends):
    fr = ends[j][0]
    if to == fr:
        possible = True
        break
    j += 1

while i != len(starts):
    to = starts[i][1]
    if to == fr:
        possible = True
        break
    i += 1

print("POSSIBLE") if possible else print("IMPOSSIBLE")
def yakusu(m):
  cnt=0
  for i in range(m//2):
    if m%i==0:
      cnt+=1
  return cnt
ans=0
n=int(input())
for j in range(1,n+1):
  if yakusu(j)==8 and n%2!=0:
    ans+=1
print(ans)
               

    

### FIXED CODE ###

def yakusu(m):
  cnt=1
  for i in range(1,(m//2)+1):
    if m%i==0:
      cnt+=1
  return cnt
ans=0
n=int(input())
for j in range(1,n+1):
  if yakusu(j)==8 and j%2!=0:
    ans+=1
print(ans)
N=list(input())
s=set(N)
ans=''.join(sorted(s))
if len(ans)==1 and ans[0]=='a':
  print('b')
  exit()
all=[chr(i) for i in range(97,97+26)]
if ans==all:
  print('None')
  exit()
for i in range(len(ans)):
  if ans[i]!=all[i]:
    print(all[i])
    exit()
  else:
    print(all[len(ans)])
    exit()

### FIXED CODE ###

N=list(input())
s=set(N)
ans=''.join(sorted(s))
all=[chr(i) for i in range(97,97+26)]
if ans=='abcdefghijklmnopqrstuvwxyz':
  print('None')
  exit()
for i in range(len(ans)):
  if ans[i]!=all[i]:
    print(all[i])
    exit()
  elif i==len(ans)-1 :
    print(all[len(ans)])
    exit()
def main():
    line=stdin.readline()
    parts=line.split()
    a=int(parts[0])
    if a>=30:
        stdout.write("Yes")
    else:
        stdout.write("N")
main()

### FIXED CODE ###

n = int(input())
if n>= 30:print('Yes')
else:print('No')
def f(i, e, dp):
    if dp[i] is not None:
        return dp[i]
    val = 0
    for nxt in e[i]:
        val = max(val, f(nxt, e, dp) + 1)
    dp[i] = val
    return dp[i]


def edu_dp_g_longest_path():
    n, m = map(int, input().split())
    e = [[] for _ in range(n)]
    for _ in range(m):
        x, y = map(int, input().split())
        e[x - 1].append(y - 1)
    dp = [None] * n
    result = 0
    for i in range(n):
        result = max(result, f(i, e, dp))
    print(result)

edu_dp_g_longest_path()

### FIXED CODE ###

import sys
# 許容する再帰処理の回数を変更
sys.setrecursionlimit(10**5+10)
def f(i, e, dp):
    if dp[i] is not None:
        return dp[i]
    val = 0
    for nxt in e[i]:
        val = max(val, f(nxt, e, dp) + 1)
    dp[i] = val
    return dp[i]


def edu_dp_g_longest_path():
    n, m = map(int, input().split())
    e = [[] for _ in range(n)]
    for _ in range(m):
        x, y = map(int, input().split())
        e[x - 1].append(y - 1)
    dp = [None] * n
    result = 0
    for i in range(n):
        result = max(result, f(i, e, dp))
    print(result)

edu_dp_g_longest_path()
l, r = map(int, input().split( ))
ans = []
if r - l>=2019:
  print(0)
else:
  for i in range(l,r):
    for j in range(i+1,r+1):
      tmp = i*j%2019
      ans.append(tmp)
      
pritn(mimn(ans))

### FIXED CODE ###

l, r = map(int, input().split( ))
ans = []
if r - l>=2019:
    print(0)
else:
    for i in range(l,r):
        for j in range(i+1,r+1):
            tmp = i*j%2019
            ans.append(tmp)
    print(min(ans))
n = int(input())
if n == 1:
	print("Hello World")
elif n == 2:
	a = int(input())
    b = int(input())
    print(a+b)

### FIXED CODE ###

n = int(input())
if n == 1:
	print("Hello World")
elif n == 2:
	a = int(input())
	b = int(input())
	print(a+b)