Harryxun/stf_run huggingface dataset:
from collections import deque

S = deque(input())
Q = int(input())

flag = 1
for i in range(Q):
    qry = input().split()

    if qry[0] == '1':
        if flag:
            flag = 0
        else:
            flag = 1
    
    elif qry[0] == '2':
        if flag:
            if qry[1] == '1':
                S.append(qry[2])
            else:
                S.appendleft(qry[2])
        else:
            if qry[1] == '1':
                S.append(qry[2])
            else:
                S.appendleft(qry[2])

if flag:
    print(ans)
else:
    print(ans[::-1])

### FIXED CODE ###

from collections import deque

S = deque(input())
Q = int(input())

flag = 1
for i in range(Q):
    qry = input().split()

    if qry[0] == '1':
        if flag:
            flag = 0
        else:
            flag = 1
    
    elif qry[0] == '2':
        if flag:
            if qry[1] == '1':
                S.appendleft(qry[2])
            else:
                S.append(qry[2])
        else:
            if qry[1] == '1':
                S.append(qry[2])
            else:
                S.appendleft(qry[2])

S = ''.join(S)

if flag:
    print(S)
else:
    print(S[::-1])
x = map(int,raw_input().split())
print(max([x[0]+x[1],x[0]-x[1],x[0]*x[1]]))

### FIXED CODE ###

x = list(map(int,input().split()))
print(max([x[0]+x[1],x[0]-x[1],x[0]*x[1]]))
cnt=int(input()[0])
l=[]
for i in range(cnt):
  l.append(input())
l=sorted(l)
print(''.join(l))

### FIXED CODE ###

s=input()
if s.count('5')==2 and s.count('7')==1:
  print('YES')
else:
  print('NO')
from networkx import Graph,predecessor
import matplotlib.pyplot as plt
import networkx as nx

G = Graph() #無効グラフ生成
n,m = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(m)]
G.add_edges_from(ab) #辺リスト生成
preds = predecessor(G,source=1)  #sourceはstart node
print(preds)
print("Yes")
for i in range(2,n+1):
    print(preds[i][0])

#描画
#nx.draw_networkx(G)
#plt.show()

### FIXED CODE ###

from networkx import Graph,predecessor

G = Graph() #無効グラフ生成
n,m = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(m)]
G.add_edges_from(ab) #辺リスト生成
preds = predecessor(G,source=1)  #sourceはstart node
print("Yes")
for i in range(2,n+1):
    print(preds[i][0])

#描画
#import matplotlib.pyplot as plt
#import networkx as nx
#nx.draw_networkx(G)
#plt.show()
aa

### FIXED CODE ###

K,A,B=map(int,input().split())
if B-A>=2:
  if K+1>=A:
    K=K-A+1
    print(A+(B-A)*(K//2)+K%2)
  else:
    print(1+K)
else:
  print(1+K)
import math
n, m = map(int, input().split())
ns = input()
ms = input()

# n, m = 10**5, 31111
# print(math.gcd(n, m))

gcd = math.gcd(n, m)
lcm = n * m // gcd
# print(lcm, lcm // n, lcm // m)
lcmN = lcm // n
lcmM = lcm // m

# for i in range(lcm):
#     if (i % (lcmN)) == 0:
#         print(ns[i // lcmN], end="")
#     else:
#         print(".", end="")
# print()
# for i in range(lcm):
#     if (i % (lcmM)) == 0:
#         print(ms[i // lcmM], end="")
#     else:
#         print(".", end="")

s = []
for i in range(0, n, lcmM):
    s.append(ns[i])
for i in range(0, m, lcmN):
    if ms[i] != s[i // lcmN]:
        print(-1)
        exit()
print(lcm)


### FIXED CODE ###

import fractions
n, m = map(int, input().split())
ns = input()
ms = input()

# n, m = 10**5, 31111
# print(math.gcd(n, m))

gcd = fractions.gcd(n, m)
lcm = n * m // gcd
# print(lcm, lcm // n, lcm // m)
lcmN = lcm // n
lcmM = lcm // m

# for i in range(lcm):
#     if (i % (lcmN)) == 0:
#         print(ns[i // lcmN], end="")
#     else:
#         print(".", end="")
# print()
# for i in range(lcm):
#     if (i % (lcmM)) == 0:
#         print(ms[i // lcmM], end="")
#     else:
#         print(".", end="")

s = []
for i in range(0, n, lcmM):
    s.append(ns[i])
for i in range(0, m, lcmN):
    if ms[i] != s[i // lcmN]:
        print(-1)
        exit()
print(lcm)
a = list(map(int, input().split()))
b = [list(map(int, input().split())) for i in range(a[0])]

result = []

max_weight = a[1]

def calc(i, queue):
    if len(b) <= i:
        return

    current = b[i]
    # print(queue)
    # print(i - 1)
    prev = queue[-1] if 0 < len(queue) else [0, 0] 
    
    if current[0] + prev[0] <= max_weight:
        result.append(prev[1] + current[1])
    
    next_queue = queue[:]
    next_queue.append([prev[0] + current[0], prev[1] + current[1]])
    # print(next_queue)
    # print(queue)
    calc(i + 1, next_queue)
    calc(i + 1, queue)

calc(0, [])

print(max(result))

### FIXED CODE ###

number = int(input())
scaffolds = list(map(int, input().split()))
costs = [ 0 for i in range(number)]

for i in range(len(costs)):
    hight = scaffolds[i]

    i_1 = -1
    if 0 <= i - 1:
        min_v = costs[i - 1]
        hight_1 = scaffolds[i - 1]
        i_1 = min_v + abs(hight_1 - hight)

    i_2 = -1
    if 0 <= i - 2:
        min_v = costs[i - 2]
        hight_2 = scaffolds[i - 2]
        i_2 = min_v + abs(hight_2 - hight)
    if i_1 < 0 and i_2 < 0:
        costs[i] = 0
    elif i_1 < 0:   
        costs[i] = i_2
    elif i_2 < 0:
        costs[i] = i_1
    else:
        costs[i] = min(i_1, i_2)  
    
    
print(costs[number - 1])
s = list(input())
k = int(input())
n = len(s)
for i in range(n):
    d = ord('z')-ord(s[i])+1
    if d<=k:
        s[i] = 'a'
        k -= d

s[-1] = chr(ord(s[-1])+k)

print(''.join(s))

### FIXED CODE ###

s = list(input())
k = int(input())
n = len(s)
for i in range(n-1):
    d = (ord('z')-ord(s[i])+1)%26
    if d<=k:
        s[i] = 'a'
        k -= d

x = ord(s[-1])+k%26
if x>ord('z'):x-=26
s[-1] = chr(x)


print(''.join(s))
n = int(input())
if(n%2==0):
  print(1/2)
else:
  print(((n+1)/2n)

### FIXED CODE ###

n = int(input())
if(n%2==0):
  print(1/2)
else:
  print((n+1)/2/n)
if __name__ =="__main__":
    n = int(input())
    ls = [[int(x) for x in input().split()] for _ in range(n)]

    now_t,now_a = ls[0]

    for i in range(1,n):
        x = max([~-now_t/ls[i][0] +1 ,~-now_a/ls[i][1] +1])
        now_t,now_a = x*ls[i][0],x*ls[i][1]
    print(now_t+now_a)

### FIXED CODE ###

if __name__ =="__main__":
    n = int(input())
    ls = [[int(x) for x in input().split()] for _ in range(n)]

    now_t,now_a = ls[0]

    for i in range(1,n):
        x = max([~-now_t//ls[i][0] +1 ,~-now_a//ls[i][1] +1])
        now_t,now_a = x*ls[i][0],x*ls[i][1]
    print(now_t+now_a)
input = input()
if input[-1]=='s':
  return input.append('es')
else:
  return input.append('s')

### FIXED CODE ###

s=str(input())
if(s[-1]=="s"):
  	print(s+"es")
else:
	print(s+"s")
import sys
readline = sys.stdin.readline
write = sys.stdout.write
flush = sys.stdout.flush

# クエリ: "? x1 x2" を出力
def query(x1):
    write("? %d\n" % (x1))
    flush()
    # ジャッジから返される値を取得
    return readline().split()

n = int(input())
l = 0
r = n-1
mid = r // 2
re = [None] * n
re[0] = query(0)
if re[0] == "Vacant":
  exit()
re[mid] = query(mid)
while re[mid] != "Vacant":
  if re[l] == re[mid]:
    if (mid - l) % 2:
      r = mid
    else:
      l = mid
  else:
    if (mid - l) % 2:
      l = mid
    else:
      r = mid
  mid = (l + r) // 2
  re[mid] = query(mid)
exit()


### FIXED CODE ###

import sys

n = int(input())
l = 0
r = n-1
mid = r // 2
re = [None] * n
print(0, flush=True)
re[0] = input()
if re[0] == "Vacant":
  sys.exit()
print(n-1, flush=True)
re[n-1] = input()
if re[n-1] == "Vacant":
  sys.exit()
print(mid, flush=True)
re[mid] = input()
while re[mid] != "Vacant":
  if re[l] == re[mid]:
    if (mid - l) % 2:
      r = mid
    else:
      l = mid
  else:
    if (mid - l) % 2:
      l = mid
    else:
      r = mid
  mid = (l + r) // 2
  print(mid, flush=True)
  re[mid] = input()
else:
  sys.exit()
a = int(input())
if a = 22:
  print('Christmas Eve Eve Eve')
elif a = 23:
  print('Christmas Eve Eve')
elif a = 24:
  print('Christmas Eve')
else:
  print('Christmas')

### FIXED CODE ###

a = int(input())
if a == 22:
  print('Christmas Eve Eve Eve')
elif a == 23:
  print('Christmas Eve Eve')
elif a == 24:
  print('Christmas Eve')
else:
  print('Christmas')
cnt = 1
tmp_min = p[0]
for i in range(n-1):
    tmp_min = min(tmp_min, p[i+1]) 
    if tmp_min == p[i+1]:
        cnt += 1
print(cnt)

### FIXED CODE ###

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

cnt = 1
tmp_min = p[0]
for i in range(1, n):
    tmp_min = min(tmp_min, p[i]) 
    if tmp_min == p[i]:
        cnt += 1
print(cnt)
N,Q = map(int,input().split())
K = [[] for _ in range(N+1)]
nums = [0 for _ in range(N+1)]

for _ in range(N-1):
    a,b = map(int,input().split())
    K[a].append(b)
    K[b].append(a)

for _ in range(Q):
    p, x = map(int, input().split())
    nums[p] += x

def dfs(now,parent):
    for i in K[now]:
        if i != parent:
            nums[i] += nums[now]
            dfs(i,now)

dfs(1,0)
print(*nums[1:])

### FIXED CODE ###

import sys
 
sys.setrecursionlimit(10 ** 6)

def input():
    return sys.stdin.readline().strip()
def main():
    N,Q = map(int,input().split())
    K = [[] for _ in range(N+1)]
    nums = [0 for _ in range(N+1)]

    for _ in range(N-1):
        a,b = map(int,input().split())
        K[a].append(b)
        K[b].append(a)

    for _ in range(Q):
        p, x = map(int, input().split())
        nums[p] += x

    def dfs(now,parent):
        for i in K[now]:
            if i != parent:
                nums[i] += nums[now]
                dfs(i,now)

    dfs(1,0)
    print(*nums[1:])

if __name__ == '__main__':
    main()
n = int(input())
b = []
for i in range(n) :
    b = int(input())
    for j in range(3) :
        for k in range(3) :
            if a[j][k] == b :
                m[j][k] = 1

if a[0].count(1) == 3 :
    print('Yes')
elif a[1].count(1) == 3 :
    print('Yes')
elif a[2].count(1) == 3 :
    print('Yes')
else :
    print('No')

### FIXED CODE ###

import math

a1 = list(map(int, input().rstrip().split()))
a2 = list(map(int, input().rstrip().split()))
a3 = list(map(int, input().rstrip().split()))
a = [a1,a2,a3]

m = [[0,0,0],[0,0,0],[0,0,0]]

n = int(input())
b = []
for i in range(n) :
    b = int(input())
    for j in range(3) :
        for k in range(3) :
            if a[j][k] == b :
                m[j][k] = 1

if m[0].count(1) == 3 :
    print('Yes')
elif m[1].count(1) == 3 :
    print('Yes')
elif m[2].count(1) == 3 :
    print('Yes')
elif m[0][0] == 1 and m[1][0] == 1 and m[2][0] ==1 :
    print('Yes')
elif m[0][1] == 1 and m[1][1] == 1 and m[2][1] ==1 :
    print('Yes')
elif m[0][2] == 1 and m[1][2] == 1 and m[2][2] ==1 :
    print('Yes')
elif m[0][0] == 1 and m[1][1] == 1 and m[2][2] ==1 :
    print('Yes')
elif m[0][2] == 1 and m[1][1] == 1 and m[2][0] ==1 :
    print('Yes')
else :
    print('No')
n=int(input())
for i in range(pow(n*2,0.5)//1+1,0,-1):
  if i*(i-1)<2*n:
    continue
  else:
    print(i+1)
    break

### FIXED CODE ###

x=int(input())
ans=0
i=1
cnt=0
while x>ans:
  ans+=i
  i+=1
  cnt+=1
print(cnt)
n, m = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for _ in range(m)]

A.sort()
BC.sort(key=lambda x:x[1], reverse=True)
pos = 0
for b, c in BC:
    for i in range(pos, pos + b):
        if A[i] <= c:
            A[i] = c
        else:
            break
    pos = i + 1

print(sum(A))

### FIXED CODE ###

n, m = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for _ in range(m)]

A.sort()
BC.sort(key=lambda x:x[1], reverse=True)

pos = 0
for b, c in BC:
    end = (pos + b) if pos + b <= n else n
    for i in range(pos, end):
        if A[i] < c:
            A[i] = c
        else:
            break
    pos = i + 1
    if pos >= n:
        break

print(sum(A))
n = int(input())
nums = [3, 5, 7]

d = deque([0])

count = 0
while True:
    if len(d) == 0:
        break
    x = d.popleft()
    if x > n:
        continue
    else:
        if '3' in str(x) and '5' in str(x) and '7' in str(x):
            count += 1
        for num in nums:
            d.append(x * 10 + num)
print(count)



### FIXED CODE ###

from collections import deque

n = int(input())
nums = [3, 5, 7]

d = deque([0])

count = 0
while True:
    if len(d) == 0:
        break
    x = d.popleft()
    if x > n:
        continue
    else:
        if '3' in str(x) and '5' in str(x) and '7' in str(x):
            count += 1
        for num in nums:
            d.append(x * 10 + num)
print(count)
N, M = map(int, input().split())
city = [0] * 10
for i in range(M):
  a, b = map(int, input().split())
  city[a - 1] += 1
  city[b - 1] += 1
for i in range (N):
  print(city[i])

### FIXED CODE ###

N, M = map(int, input().split())
city = [0] * N
for i in range(M):
  a, b = map(int, input().split())
  city[a - 1] += 1
  city[b - 1] += 1
for i in range (N):
  print(city[i])
n,a,b = [int(x) for x in input().split()]

INF = (10**9 + 7)

def f(n):
    if n == 1:
        return 1
    return (f(n-1) * 2) + 1

if n == 2:
    print(0)
else:
    ans = f(n) - f(a) - f(b)
    print(ans % INF)

### FIXED CODE ###

n,a,b = [int(x) for x in input().split()]

INF = (10**9 + 7)

def c(n,r,p):
    r = min(r,n-r)
    numer = 1
    denom = 1
    for i in range(1,r+1):
        numer = numer * (n+1-i) % p
        denom = denom * i % p
    return numer * pow(denom,p-2,p) % p

ans = pow(2,n,INF) - 1 - c(n,a,INF) - c(n,b,INF)

while ans < 0:
    ans += INF
print(ans)
s=[1,2,3]
a,b=raw_input().split()
s.remove(x)
s.remove(y)
print s[0]

### FIXED CODE ###

a=input()
b=input()
if a==1 and b==2:
  print "3"
elif a==2 and b==3:
  print "1"
elif a==3 and b==1:
  print "2" 
elif a==3 and b==2:
  print "1"
elif a==2 and b==1:
  print "3"
else:
  print "2"
def bitadd(a,w,bit): #aにwを加える(1-origin)

    x = a
    while x <= (len(bit)-1):
        bit[x] += w
        x += x & (-1 * x)

def bitsum(a,bit): #ind 0～aまでの和を求める

    ret = 0
    x = a
    while x > 0:
        ret += bit[x]
        x -= x & (-1 * x)
    return ret


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

a = []

for i in range(N):

    A = int(input())
    a.append(A-K)


B = [0]

for i in range(N):

    B.append(B[-1] + a[i])

#print (B)
C = B.copy()
C.sort()

dic = {}

num = 1
for i in range(N+1):

    if i == 0:
        dic[C[i]] = num
        num += 1
    elif C[i] != C[i-1]:
        dic[C[i]] = num
        num += 1

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

BIT = [0] * (len(B) + 1)

ans = 0

for i in range(N+1):

    ans += bitsum(B[i],BIT)
    bitadd(B[i],1,BIT)

print (ans)
    


### FIXED CODE ###


def bitadd(a,w,bit): #aにwを加える(1-origin)

    x = a
    while x <= (len(bit)-1):
        bit[x] += w
        x += x & (-1 * x)

def bitsum(a,bit): #ind 0～aまでの和を求める

    ret = 0
    x = a
    while x > 0:
        ret += bit[x]
        x -= x & (-1 * x)
    return ret


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

a = []

for i in range(N):

    A = int(input())
    a.append(A-K)


B = [0]

for i in range(N):

    B.append(B[-1] + a[i])

#print (B)
C = B.copy()
C.sort()

dic = {}

num = 1
for i in range(N+1):

    if i == 0:
        dic[C[i]] = num
        num += 1
    elif C[i] != C[i-1]:
        dic[C[i]] = num
        num += 1

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

BIT = [0] * (len(B) + 1)

ans = 0

for i in range(N+1):

    ans += bitsum(B[i],BIT)
    bitadd(B[i],1,BIT)

print (ans)
s = input()
a = b = c = 0
for c in s:
  if c == 'a': a += 1
  if c == 'b': b += 1
  if c == 'c': c += 1

if a == b == c:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

s = input()
na = 0
nb = 0
nc = 0

for c in s:
  if c == 'a': na += 1
  if c == 'b': nb += 1
  if c == 'c': nc += 1

if na == nb == nc:
  print('Yes')
else:
  print('No')
while True:
        (m, f, r) = map(int, raw_input().split())
        if m == f == r == -1:
            break
        elif (m == -1 or f == -1) or (m + f < 30):
            print "F"
        elif m + f >= 80:
            print "A"
        elif 65 <= m + f < 80:
            print "B"
        elif 50 <= m + f < 65:
            print "C"
        elif 30 <= m + f < 50:
            if r >= 50:
                print "C"
            else:
print "D"

### FIXED CODE ###

while True:
    m, f, r = [int(i) for i in input().split()]

    if m == f == r == -1:
        break

    total = m + f
    if m == -1 or f == -1 or total < 30:
        print('F')
        
    elif total < 50 and r < 50:
        print('D')
        
    elif total < 65:
        print('C')
        
    elif total < 80:
        print('B')
        
    else:
        print('A')
N,W = map(int,input().split())
wv = [list(map(int,input().split())) for _ in range(N)]
import numpy as np
dp = np.zeros(W+1,dtype=np.int64)
for w,v in wv:
    np.maximum(dp[w:],dp[:-w]+v,out=dp[w:])
print(dp.max())

### FIXED CODE ###

N,W = map(int,input().split())
import numpy as np
dp = np.full(N*1000 +1,W+1,dtype=np.int64)
dp[0]=0
for _ in range(N):
    w,v = map(int,input().split())
    dp[v:] = np.minimum(dp[:-v] + w, dp[v:])
print(np.max(np.where(dp <= W)))
import itertools as iter

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

beauty_list = []
for i in range(len(a) + 1):
    for element in iter.combinations(a, i):
        beauty = sum(element)
        beauty_list.append(beauty)

max_and = 0
for combi in iter.combinations(set(beauty_list), k):
    ans = combi[0]
    for element in combi:
        ans &= element
    if ans > max_and:
        max_and = ans

print(max_and)


### FIXED CODE ###

n = int(input())

num = list(map(int, input().split()))
ave = sum(num) / n

diff = None
for i, l in enumerate(num):
    if diff is None or abs(l - ave) < diff:
        diff = abs(l - ave)
        ans = i

print(ans)
while True:
    H,W = map(int,input().split())
    if H ==0 and W==0: break
    for i in range(H)
        print(('#'*W + '¥n'))


### FIXED CODE ###

while True:
    H,W = map(int,input().split())
    if H ==0 and W==0: break
    for i in range(0,H) :
        print('#'*W)
    print()
S = input()
count=0
if len(S)%2==0:
  for i,s in inumerate(S):
    if S[len(S)-i-1]!=s:
      count+=1
    if i>=len(S)//2:
      break
else:
  for i,s in inumerate(S):
    if S[len(S)-i-1]!=s:
      count+=1
    if i==len(S)//2:
      break
print(count)

### FIXED CODE ###

S = input()
count=0
if len(S)%2==0:
  for i,s in enumerate(S):
    if S[len(S)-i-1]!=s:
      count+=1
    if i>=len(S)//2-1:
      break
else:
  for i,s in enumerate(S):
    if S[len(S)-i-1]!=s:
      count+=1
    if i==len(S)//2:
      break
print(count)
s = input()
times = 0
is01 = s.find("01")
is10 = s.find("10")
while is01 != -1 or is10 != -1:
    times += 1
    if is01 != -1:
        s = s[:is01] + s[is01+2:]
    else :
        s = s[:is10] + s[is10+2:]
    is01 = s.find("01")
    is10 = s.find("10")
    print(s)
print(times*2)

### FIXED CODE ###

s = input()
one = s.count("0")
zero = s.count("1")
print(min(one,zero) * 2)
n=input()
a=list(map(int, input().split()))
ans=0 
for i in range(n):
  for j in range(i+1, n):
    ans=max(ans, abs(a[i]-a[j]))
print(ans)

### FIXED CODE ###

n=int(input())
a=[int(x) for x in input().split()]
ans=0 
for i in range(n):
  for j in range(i+1, n):
    ans=max(ans, abs(a[i]-a[j]))
print(ans)
s = "zabcdefghijklmnopqrstuvwxy"
n = int(input())
ans = ""
while(n>0):
    r = n%26
    if r==0:
        r = 26
    ans = s[r] + ans
    n -= r
    n //=26
print(ans)

### FIXED CODE ###

s = "zabcdefghijklmnopqrstuvwxyz"
n = int(input())
ans = ""
while(n>0):
    r = n%26
    if r==0:
        r = 26
    ans = s[r] + ans
    n -= r
    n //=26
print(ans)
print(input(),count('1'))

### FIXED CODE ###

print(input().count('1'))
N, T = map(int, raw_input().split())
ans = float("inf")

for i in range(0,N):
    c,t = map(int,input(),split())
    if t <= T:
        ans = min(num,c)

if ans == float("inf"):
    print("TLE")
else:
    print(ans)


### FIXED CODE ###

N, T = map(int,input().split())
ans = float("inf")

for i in range(N):
    c,t = map(int,input().split())
    if t <= T:
        ans = min(ans,c)

if ans == float("inf"):
    print("TLE")
else:
    print(ans)
from collections import defaultdict,deque
#from itertools import permutations
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:list(input())
ips=lambda:input().split()
sys.setrecursionlimit(10**6)
"""========main code==============="""

t=ii()
if t>=30:
    print("Yes")
else:
    print("No")

### FIXED CODE ###


from collections import defaultdict,deque
#from itertools import permutations
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:list(input())
ips=lambda:input().split()

"""========main code==============="""

t=ii()
if t>=30:
    print("Yes")
else:
    print("No")
n=int(input())
data=[int(aa) for aa in input().split()]
d=[0 for aa in range(100000+1)]
for aa in data:
    d[aa]+=1
#print(d)
mydata=0
mylist=[0,0]
for aa in range(100000+1):
    if d[aa] >3:
        mydata=aa
    if d[aa] >1 :
        if aa not in mylist:
            mylist.pop(0)
            mylist.append(aa)
#            print(mylist)
 
print(max(mydata*mydata,mylist[0]*mylist[1]))
n=int(input())
data=[int(aa) for aa in input().split()]
d=[0 for aa in range(100000+1)]
for aa in data:
    d[aa]+=1
#print(d)
mydata=0
mylist=[0,0]
for aa in range(100000+1):
    if d[aa] >3:
        mydata=aa
    if d[aa] >1 :
        if aa not in mylist:
            mylist.pop(0)
            mylist.append(aa)
#            print(mylist)

print(max(mydata*mydata,mylist[0]*mylist[1]))


### FIXED CODE ###

from collections import Counter
n=int(input())
data=[int(aa) for aa in input().split()]

dct=Counter(data)
dct=dct.items()

dct2=[item for item in dct if item[1] > 1]
dct2.sort(reverse=True)

dct4=[item for item in dct if item[1] > 3]
dct4.sort(reverse=True)

ans=0
if len(dct2) > 1:
  ans=dct2[0][0]*dct2[1][0]
if len(dct4) > 0: 
  ans=max(ans,dct4[0][0]*dct4[0][0])

print(ans)
a,b=[int(i) for i in input(split())]
print((a-1)*(b-1))

### FIXED CODE ###

a,b=[int(i) for i in input().split()]
print((a-1)*(b-1))
#d=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
#import numpy as np
import math
#n=int(input())
#li=input().split()
#S=input()
#lis=list(map(int,input().split()))

l=[]
n=int(input())
for i in range(n):
    l.append(int(input()))
ans=l[0]
for i in range(n-1):
    ans=int((ans*l[i+1])/math.gcd(ans,l[i+1]))

print(ans)


### FIXED CODE ###

n=int(input())
t=[]
for i in range(n):
    t.append(int(input()))

from fractions import gcd
lcm=1
for i in range(n):
    lcm=(lcm*t[i])//gcd(lcm,t[i])
print(lcm)
N = int(input())
H = list(map(int, input().split()))

for i in range(N-1):
    minh = min(H[i+1:]) # i+1以降のリストをスライス
    if H[i] - minh >= 2:
        print('No')
        break
    else:
        continue
else:
    print('Yes')

"""
# よく考えたら最大だけじゃダメだった
m = H.index(max(H)) # 複数の候補がある場合は最初のインデックスを返す
print(m)
for i in range(m+1, N):
    if H[m] - H[i] >= 2:
        print('No')
        break
    else:
        continue
else:
    print('Yes')
"""

### FIXED CODE ###

A, B, C = map(int, input().split())

ans = max(0, C-(A-B))

print(ans)
n, a, b = [int(x) for x in input().split()]
count = 0
for i in range(a, n+1):
	  if sum(list(str(i))) > b:
      	continue
      i += 1
print(i)

### FIXED CODE ###

n, a, b = [int(x) for x in input().split()]
count = 0
for i in range(a, n+1):
    if a <= sum([int(x) for x in list(str(i))]) <= b:
        count += i
print(count)