Harryxun/stf_run huggingface dataset:
def judge(a, b, y, x, m):
	for i in range(0, m):
		for j in range(0, m):
			if a[y+i][x+j] != b[y][x]: return False
	return True

N, M = map(int, raw_input().split())
A = []
B = []
for i in range(0, N):
	A.append(raw_input())
for i in range(0, M):
	B.append(raw_input())

ans = 'No'
for i in range(0, N-M+1):
	for j in range(0, N-M+1):
		if judge(A, B, i, j, M):
			ans = 'Yes'
			break

print ans


### FIXED CODE ###

def judge(a, b, y, x, m):
	for i in range(0, m):
		for j in range(0, m):
			if a[y+i][x+j] != b[i][j]: return False
	return True

N, M = map(int, raw_input().split())
A = []
B = []
for i in range(0, N):
	A.append(raw_input())
for i in range(0, M):
	B.append(raw_input())

ans = 'No'
for i in range(0, N-M+1):
	for j in range(0, N-M+1):
		if judge(A, B, i, j, M):
			ans = 'Yes'
			break

print ans
N = int(input())
S = input()
a = [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]
ans = ''
for i in range(len(S)):
  ans += S[(i+N)%26]
print(ans)

### FIXED CODE ###

N = int(input())
S = input()
ans = ''
for i in range(len(S)):
  temp = ord(S[i]) - ord('A') + N
  ans += chr(ord("A") + temp%26 )
print(ans)
A = list(map(int, input().split()))
B = set(map(int, input().split()))
if len(B) == 2:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

A = list(map(int, input().split()))
B = set(A)
if len(B) == 2:
  print('Yes')
else:
  print('No')
import macpath

R = int(input())
print(R*2*math.pi)

### FIXED CODE ###

import math

R = int(input())
print(R*2*math.pi)
a,b,c=map(int,input().split())

if a==b:
    ans=c
elif b==c:
    ans=a:
else:
    ans=b
print(a+b+c-ans)

### FIXED CODE ###

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

if a==b:
    ans=c
elif b==c:
    ans=a
else:
    ans=b
print(ans)
#%%
import numpy as np
#%%

s,t,q = list(map(int, input().split()))
shrines = []
temples = []
questions = []
answers = []
dist = np.empty((s,t),dtype='int32')

for _ in range(s):
    shrines.append(int(input()))
shrines = np.array(shrines)

for _ in range(t):
    temples.append(int(input()))
temples = np.array(temples)

for _ in range(q):
    questions.append(int(input()))


for i, shrine in enumerate(shrines):
    dist[i]= [abs(shrine - temple) for temple in temples]

for start in questions:
    min_shrine_start = float('inf')
    min_temple_start = float('inf')

    for i, st_s in enumerate(shrines - start):
        abs_st_s = abs(st_s)

        if abs_st_s < min_shrine_start:
            abs_st_s += np.min(dist[i])

            if abs_st_s < min_shrine_start:
                min_shrine_start = abs_st_s

    for j, st_t in enumerate(temples - start):
        abs_st_t = abs(st_t)

        if abs_st_t < min_temple_start:
            abs_st_t += np.min(dist[:,j])

            if abs_st_t < min_temple_start:
                min_temple_start = abs_st_t
    
    answers.append(min(min_shrine_start,min_temple_start))


for ans in answers:
    print(ans)


### FIXED CODE ###

#%%
import bisect

#%%
a,b,q = map(int, input().split())
INF = 10**18
shrines = [-INF] + [int(input()) for _ in range(a)] + [INF]
temples = [-INF] + [int(input()) for _ in range(b)] + [INF]

for _ in range(q):

    start = int(input())

    # スタート位置より右にある神社のうち、もっともスタート位置に近いもの
    shrine_east = shrines[bisect.bisect_right(shrines, start)]
    # スタート位置より右にある寺のうち、もっともスタート位置に近いもの
    temple_east = temples[bisect.bisect_right(temples, start)]

    # スタート位置より左にある神社のうち、もっともスタート位置に近いもの
    shrine_west = shrines[bisect.bisect_right(shrines, start) - 1]
    # スタート位置より左にある寺のうち、もっともスタート位置に近いもの
    temple_west = temples[bisect.bisect_right(temples, start) - 1]

    ans = INF

    for shrine in [shrine_east, shrine_west]:
        for temple in [temple_east,temple_west]:
            cur = min(abs(shrine-start), abs(temple-start)) + abs(shrine-temple)
            ans = min(ans,cur)

    print(ans)
s=list(input())

# s1 = (int)(s[0] + s[1])
s1=int(s[0])*10+int(s[1])
s2=int(s[2])*10+int(s[3])

if s1<=12 and s2<=12 and s1>0 and s2>0:
    ans='AMBIGUOUS'
elif s1<=12 and  (s2>12 or s2 == 0)and s1>0:
    ans ='MMYY'
elif (s1>12 s1==0) and s2<=12 and s2>0:
    ans ='YYMM'
else:
    ans='NA'
print(ans)


### FIXED CODE ###

s=list(input())

# s1 = (int)(s[0] + s[1])
s1=int(s[0])*10+int(s[1])
s2=int(s[2])*10+int(s[3])

if s1<=12 and s2<=12 and s1>0 and s2>0:
    ans='AMBIGUOUS'
elif s1<=12 and  (s2>12 or s2 == 0)and s1>0:
    ans ='MMYY'
elif (s1>12 or s1==0) and s2<=12 and s2>0:
    ans ='YYMM'
else:
    ans='NA'
print(ans)
H, W = map(int, input().split())
S = [["."] * (W + 2)]
for _ in range(H):
    S.append([".", *list(input()), "."])
S.append(["."] * (W + 2))

ans = [[-1] * W for _ in range(H)]

for i in range(1, H + 1):
    for j in range(1, W + 1):
        if S[i][j] == "#":
            continue
        cnt = 0
        if S[i - 1][j - 1] == "#":
            cnt += 1
        if S[i][j - 1] == "#":
            cnt += 1
        if S[i + 1][j - 1] == "#":
            cnt += 1
        if S[i - 1][j] == "#":
            cnt += 1
        if S[i + 1][j] == "#":
            cnt += 1
        if S[i - 1][j + 1] == "#":
            cnt += 1
        if S[i][j + 1] == "#":
            cnt += 1
        if S[i + 1][j + 1] == "#":
            cnt += 1
        ans[i - 1][j - 1] = cnt

for i in ans:
    p = ["#" if x == -1 else x for x in i]
    print(*p, sep="")


### FIXED CODE ###

H, W = map(int, input().split())
S = ["." * (W + 2)]
for _ in range(H):
    S += ["." + input() + "."]
S += ["." * (W + 2)]

ans = [[-1] * W for _ in range(H)]

for i in range(1, H + 1):
    for j in range(1, W + 1):
        if S[i][j] == "#":
            continue
        cnt = 0
        if S[i - 1][j - 1] == "#":
            cnt += 1
        if S[i][j - 1] == "#":
            cnt += 1
        if S[i + 1][j - 1] == "#":
            cnt += 1
        if S[i - 1][j] == "#":
            cnt += 1
        if S[i + 1][j] == "#":
            cnt += 1
        if S[i - 1][j + 1] == "#":
            cnt += 1
        if S[i][j + 1] == "#":
            cnt += 1
        if S[i + 1][j + 1] == "#":
            cnt += 1
        ans[i - 1][j - 1] = cnt

for i in ans:
    p = ["#" if x == -1 else x for x in i]
    print(*p, sep="")
n = int(input())
print(a+a**2+a**3)

### FIXED CODE ###

a = int(input())
print(a+a**2+a**3)
x, y, a, b, c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort()
q.sort()
r.sort()
red = []
green = []
less = []
for i in range(x):
    red.append(p[-i-1])
for i in range(y):
    green.append(q[-i-1])
# print(red, green)
for i in range(c):
    if len(red) > 0:
        if red[-1] <= green[-1]:
            if red[-1] <= r[-i-1]:
                del red[-1]
                less.append(r[-i-1])
                continue
    if len(green) > 0:
        if red[-1] > green[-1]:
            if green[-1] <= r[-i-1]:
                del green[-1]
                less.append(r[-i-1])
ans = sum(red) + sum(green) + sum(less)
# print(red, green, less)
print(ans)

### FIXED CODE ###

x, y, a, b, c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))
p.sort()
q.sort()
r.sort()
red = []
green = []
less = []
for i in range(x):
    red.append(p[-i-1])
for i in range(y):
    green.append(q[-i-1])
# print(red, green)
for i in range(c):
    if len(red) > 0 and len(green) > 0:
        if red[-1] < green[-1]:
            if red[-1] < r[-i-1]:
                del red[-1]
                less.append(r[-i-1])
        else:
            if green[-1] <= r[-i-1]:
                del green[-1]
                less.append(r[-i-1])
    elif len(red) > 0:
        if red[-1] < r[-i-1]:
            del red[-1]
            less.append(r[-i-1])
    elif len(green) > 0:
        if green[-1] <= r[-i-1]:
            del green[-1]
            less.append(r[-i-1])
ans = sum(red) + sum(green) + sum(less)
# print(red, green, less)
print(ans)
import math
a,b = [int(i) for i in input().split(' ')]
xs = [int(i) for i in input().split(' ')]

temp = 0
result = 0
for i, x in enumerate(xs):
    if i == 0:
        result = abs(x - b)
    else:
        result = math.gcd(abs(x - temp), result)
    temp = x
print(result)


### FIXED CODE ###

import math
def gcd(a, b):
  while b > 0:
    a, b = b, a%b
  return a


a,b = [int(i) for i in input().split(' ')]
xs = [int(i) for i in input().split(' ')]
#a = pow(10, 5)

temp = 0
result = 0
for i, x in enumerate(xs):
    if i == 0:
        result = abs(x - b)
    else:
        result = gcd(abs(x - temp), result)
    temp = x
print(result)
a = int(input())
l = []
for i in range(a):
    ta,tb = map(int,input().split())
    l.append([ta,tb,i+1])
l.sort()
for i, j , k in l:
    print(k)



### FIXED CODE ###


a = int(input())
l = []
for i in range(a):
    ta,tb = map(str,input().split())
    l.append([ta,-int(tb),i+1])
l.sort()
for i, j , k in l:
    print(k)
M, K = map(int, input().split())

tmp = 0
X = list(range(K)) + list(range(K+1, 2**M))

if M == 1:
    if K == 0:
        print("1 1 0 0")
    else:
        print(-1)
elif 2**M > K:
    ans = " ".join(map(str, X + [K] + X[::-1] + [K]))
    print(ans)
else:
    print(-1)

### FIXED CODE ###

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

if M == 1:
    if K == 0:
        print("1 1 0 0")
    else:
        print(-1)
elif 2**M > K:
    X = list(range(K)) + list(range(K+1, 2**M))
    ans = " ".join(map(str, X + [K] + X[::-1] + [K]))
    print(ans)
else:
    print(-1)
while True:
    l = map(int,raw_input())
    if l==[0,0]:
        break
    l.sort()
    print " ".join(l)

### FIXED CODE ###

while True:
    l = map(int,raw_input().split())
    if l==[0,0]:
        break
    l.sort()
    s = [str(x) for x in l]
    print " ".join(s)
X = input()
if X>=30:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

X = int(input())
if X>=30:
  print('Yes')
else:
  print('No')
import logging
     
    logging.basicConfig(level=logging.INFO, format="%(message)s")
    logging.disable(logging.CRITICAL)
     
    N, X  = (int(x) for x in input().split())
    L = list(int(x) for x in input().split())
     
    logging.info(L)
     
    length = 0
    counter = 1
     
    if X < L[0]:
        print(1)
    else:
        for i in L:
            length += i
            if length >= X or counter == N:
                break
            counter += 1
        
        print(counter)

### FIXED CODE ###

import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")
logging.disable(logging.CRITICAL)

N, X  = (int(x) for x in input().split())
L = list(int(x) for x in input().split())

logging.info(L)

length = 0
counter = 1

for i in L:
    length += i
    if length <= X:
        counter += 1
    
print(counter)
n = int(input())
s = str(input())
if s.count(“R”)>s.count(“B”):
  print(“Yes”)
else:
  print(“No”)


### FIXED CODE ###

n = int(input())
s = str(input())
if s.count("R")>s.count("B"):
  print("Yes")
else:
  print("No")
a,b = map(input().split(), int)
print(a*b)

### FIXED CODE ###

a,b = map(int, input().split())
print(a*b)
def calculate_median(lst):
    lst.sort()
    median_right = lst[int(len(lst)/2)]
    median_left = lst[int(len(lst)/2)-1]
    return median_right, median_left


N = int(input())
X = list(map(int, input().split()))
X_copy = X.copy()
median_right, median_left = calculate_median(X)
for i in range(N):
    if X_copy[i] >= median_right:
        print(median_left)
    elif X_copy[i] < median_right:
        print(median_right)

### FIXED CODE ###

from math import ceil
n, k = map(int, input().split())
a = list(map(int, input().split()))
print(ceil((n-1)/(k-1)))
S=map(int, input().split())
if S[2]==S[3] and S[4]==S[5]:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

S=input()
if(S[2]==S[3] and S[5]==S[4]):
  print('Yes')
else:
  print('No')
a1 = input()
a2 = input()

x = [1, 2, 3]

x = x.remove(a1)
x = x.remove(a2)

print(x)

### FIXED CODE ###

a1=int(input())
a2=int(input())
print(6-a1-a2)
inputs = open(0).readlines()
n, m = map(int, inputs[0].split())
PY = [map(int, x.split()) for x in inputs[1:]]
A = [[] for _ in range(m)]
B = []
for i, (p, y) in enumerate(PY):
    A[p-1].append([y, i])
    B.append('{:06}'.format(p))
for a in A:
    a.sort()
    for i in range(len(a)):
        B[a[i][1]] += '{:06}'.format(i+1)
print(*B, sep='\n')

### FIXED CODE ###

inputs = open(0).readlines()
n, m = map(int, inputs[0].split())
PY = [map(int, x.split()) for x in inputs[1:]]
A = [[] for _ in range(n)]
B = [''] * m
for i, (p, y) in enumerate(PY):
    A[p-1].append([y, i])
    B[i] += '{:06}'.format(p)
for a in A:
    a.sort()
    for i in range(len(a)):
        B[a[i][1]] += '{:06}'.format(i+1)
print(*B, sep='\n')
n=input()
while n>0:
  n-=1000
print(abs(n))

### FIXED CODE ###

n=int(input())
while n>0:
  n-=1000
print(abs(n))
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
B=[]
C=[]

for _ in range(q):
    bi, ci = list(map(int, input().split()))
    B.append(bi)
    C.append(ci)

dic = {}
for i in A:
    dic[i] = dic.get(i,0) + 1

sum = sum(A)

for i in range(Q):
    sum += dic[B[i]] * (C[i] -B[i])
    dic[C[i]] += dic[B[i]]
    dic[B[i]] = 0
    print(sum)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
Q = int(input())
B=[]
C=[]

for _ in range(Q):
    bi, ci = list(map(int, input().split()))
    B.append(bi)
    C.append(ci)

dic = {}
for i in A:
    dic[i] = dic.get(i,0) + 1

sum = sum(A)

for i in range(Q):
    sum += dic.get(B[i], 0) * (C[i] -B[i])
    dic[C[i]] = dic.get(C[i], 0) + dic.get(B[i], 0)
    dic[B[i]] = dic.get(B[i], 0)
    dic[B[i]] = 0
    print(sum)
def gcd(a,b):
  if b == 0:return a
  return gcd(b,a%b)

N=int(input())
T=[]
for i in range(N):
  t = int(input())
  T.append(t)
  if i == 0:continue
  elif i == 1:
    lcm = T[-2]*T[-1]//gcd(T[-2],T[-1])
  else:
    lcm = lcm * T[-1]//gcd(lcm,T[-1])

print(lcm)

### FIXED CODE ###

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

N=int(input())
T=[]
if N==1:
  print(input())
  exit()
for i in range(N):
  t = int(input())
  T.append(t)
  if i == 0:continue
  elif i == 1:
    lcm = T[-2]*T[-1]//gcd(T[-2],T[-1])
  else:
    lcm = lcm * T[-1]//gcd(lcm,T[-1])

print(lcm)
n,m=map(int,input().split())
a=[]
for i in range(m):
	p,s=input().split()
	if p in a:
		continue
	if s=="AC":
		a.append(p)
print(len(a))

### FIXED CODE ###

c=input()
print(chr(ord(c)+1))
H, W = map(int,input().split())
grid = [list(input().split()) for _ in H]
res = 0
def bfs(tup,visited):
  def helper(tup, total):
    if tup in visited():
      res = max(res, total)
    elif tup[0]>=H or tup[0] < 0 or tup[1]>=W or tup[1]<0 or grid[tup[0]][tup[1]]:
      res = max(res, total)
    else:
      visited.add(tup)
      h, w = tup
      helper((h+1, w),total+1)
      helper((h-1, w),total+1)
      helper((h, w-1),total+1)
      helper((h, w+1),total+1)
  helper(tup,0)
  return res
      
ans = 0
for h in H:
  for w in W:
    if grid[h][w] == '#':
      continue
    ans = max(ans,bfs((h,w),set()))
print(ans)

### FIXED CODE ###

from collections import deque
import numpy as np

H,W = map(int,input().split())
maze = [input() for _ in range(H)]

ans = 0
for x in range(H):
    for y in range(W):
        #壁からはスタートできない
        if maze[x][y] == "#":
            continue

        distance = [[-1]*W for _ in range(H)]
        distance[x][y] = 0
        #start位置
        stack = deque([[x,y]])

        while stack:
            h,w = stack.popleft()
            for i,j in [[1,0],[-1,0],[0,1],[0,-1]]:
                new_h, new_w = h+i, w+j
                if new_h < 0 or new_w < 0 or new_h >= H or new_w >= W:
                    continue
                elif maze[new_h][new_w] != "#" and distance[new_h][new_w] == -1:
                    distance[new_h][new_w] = distance[h][w]+1
                    stack.append([new_h, new_w])

        ans = max(ans, np.max(distance))

print(ans)
a

### FIXED CODE ###

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

ans = 0;
s = [0]*(n+1);
m = {};
for i in range(0,n):
  s[i+1] = s[i]+a[i];
for i in range(0,n+1):
  m.setdefault(s[i],0);
  m[s[i]]+=1;
for v in m.values():
  ans += v*(v-1)//2
print(ans);
n,k,s=map(int,input().split())
if s<10**9:
  ans=[s]*k+[s+1]*(n-k)
else:
  ans=[s]*k+[1]*(n-k)
print(" ".join(map(str,arr)))

### FIXED CODE ###

n,k,s=map(int,input().split())
if s<10**9:
  ans=[s]*k+[s+1]*(n-k)
else:
  ans=[s]*k+[1]*(n-k)
print(" ".join(map(str,ans)))
#!/usr/bin/env python3
# 整数の入力
k = int(input())

if k % 2 == 0:
    print(-1)
    #print("a")
    exit(0)

d1 = k % 10
print(d1)
if d1 != 1 and d1 != 7 and d1 != 3 and d1 != 9:
    print(-1)
    #print("b")
    exit(0)

def PrimeJudge(n):
    ret = True
    for i in range(2, int(n ** 0.5)+1):
        if n % i == 0:
            ret = False
            break
    return ret

if PrimeJudge(k) == False:
    print(-1)
    #print("c")
    exit(0)

s = 7
while(1):
    i = int(s)
    if i < k:
        s = str(s)+'7'
    else:
        if i % k == 0:
            print(len(s))
            exit(0)
        else:
            s = str(s)+'7'





### FIXED CODE ###

#!/usr/bin/env python3
# 整数の入力
k = int(input())

x = 7%k
for i in range(1, k+1):
    if x == 0:
        print(i)
        exit(0)
    x=(10*x+7)%k

print(-1)
s=input()
w=["dream","dreamer","erase","eraser",""]
while True:
    

    if s[0:5]==w[0]:
        if s[5:7]=="er": #dremaerかeraserかerase
            if s[7]=="a": #erはeraseかeraserのer
                s=s[5:]
            else:
                s=s[7:]
        else:
            s=s[5:]

    elif s[0:5]==w[2]:
        if s[5]=="r": 
            s=s[6:]
        else:
            s=s[5:]
    else:
        print("NO")
        exit()

    if len(s)<=6:
        if s in w:
            print("YES")
            exit()
        else:
            print("NO")
            exit()

    #print(s)

### FIXED CODE ###

s=input()
w=["dream","dreamer","erase","eraser",""]
while True:
    

    if s[0:5]==w[0]:
        if s[5:7]=="er": #dremaerかeraserかerase
            if s[7]=="a": #erはeraseかeraserのer
                s=s[5:]
            else:
                s=s[7:]
        else:
            s=s[5:]

    elif s[0:5]==w[2]:
        if s[5]=="r": 
            s=s[6:]
        else:
            s=s[5:]
    else:
        print("NO")
        exit()

    if len(s)<=7:
        if s in w:
            print("YES")
            exit()
        else:
            print("NO")
            exit()
    
    #print(s)
m = list(map(int, input().split()))
A = m[0]
B = m[1]
K = m[2]

g = list(range(A, B+1))

if len(g) <= 2*K:
    for v in g:
        print(v)
else:
    for i in range(K):
        print(g[i])
    for i in range(len(g)-K, len(g)):
        print(g[i])


### FIXED CODE ###

m = list(map(int, input().split()))
A = m[0]
B = m[1]
K = m[2]

ans = []

for v in range(A, min(A+K, B)):
    ans.append(v)
for v in range(max(B-K+1, A), B+1):
    ans.append(v)

ans = sorted(list(set(ans)))
for v in ans:
    print(v)
import math
import sys

X = int(input())
 
for i in range(1000):
  for j in range(-100, 1000):
    if math.pow(i, 5) - math.pow(j, 5) == X:
      print("%d %d" % (i, j))
      sys.exit()


### FIXED CODE ###

S = input()
 
if S == 'ABC':
  print('ARC')
else:
  print('ABC')
def Fib(n):
    s, t = 0, 1
    if n == 1:
        return s
    elif n == 2:
        return t
    else:
        for i in range(n-2):
            s, t = t, s + t
        return t
def FIB(q):
    return Fib(q+1)

n,m = map(int,input().split())
A =[]
add = 1
ex = 0
y = 0
for _ in range(m):
    a = int(input())
    A.append(a)
for i in range(1,n+1):
    if A.count(i) == 1 and A.count(i+1) == 1 :
        ex += 1
    else:
        ex += 0
if ex >= 1:
    print(0)
else:
    if A[0] == 1:
        if m ==1:
            add *= FIB(n - 1)
        else:
            for j in range(0,m-1):
                y = A[j+1]-A[j] -1
                add *= FIB(y)
            add *= FIB(n-A[m-1])
    else:
        if m == 1:
            z =0
            for l in range(1,A[0]):
                z += FIB(l)
            add *= z*(FIB(n - A[0]))
        else:
            c = 0
            for u in range(1,A[0]):
                c += FIB(u)
                add *=c
            for k in range(0,m-1):
                y = A[k+1]-A[k] -1
                add *= FIB(y)
            add *= FIB(n - A[m-1])

    print(add % 1000000007)


### FIXED CODE ###

x,y,z = (int(x) for x in input().split())

a = x + y
b = y + z
c = z + x

print(min([a, b, c]))
a,b=input("").split("")

wa = int(a) + int(b)
sa = int(a) - int(b)
seki = int(a) * int(b)

if wa >= sa and wa >= seki:
    print(str(wa))
elif sa >= wa and sa >= seki:
    print(str(sa))
else:
    print(str(seki))

### FIXED CODE ###

a,b=input().split()

wa = int(a) + int(b)
sa = int(a) - int(b)
seki = int(a) * int(b)

if wa >= sa and wa >= seki:
    print(str(wa))
elif sa >= wa and sa >= seki:
    print(str(sa))
else:
    print(str(seki))
L, R = map(int, input().split())
MOD = 2019
l = L % MOD
r = R % MOD
ans = 2019

if l >= r or l == 0 or r == 0　or (R - L) >= 2019:
    ans = 0
else:
    for i in range(l, r):
        for j in range(l + 1, r + 1):
            if j <= i:
                continue
            else:
                ans = min(ans, i * j % MOD)

print(ans)


### FIXED CODE ###

L, R = map(int, input().split())
MOD = 2019
l = L % MOD
r = R % MOD
ans = 2019

if l >= r or l == 0 or r == 0 or (R - L) >= 2019:
    ans = 0
else:
    for i in range(l, r):
        for j in range(l + 1, r + 1):
            if j <= i:
                continue
            else:
                ans = min(ans, i * j % MOD)

print(ans)
S = list(input())
T = list(input())
for n in range(len(S)):
    if S[n] == T[0]:
        noOfnext = 0
        for m in range(n+1, len(S)):
            if S[m] == "?":
                noOfnext += 1
            else:
                break
        if noOfnext < len(T)-1:
            continue
        else:
            for m in range(noOfnext):
                S[n+1+m] = T[m+1]
            for k in range(len(S)):
                if S[k] == "?":
                    S[k] = "a"
if "?" in S:
    print("UNRESTORABLE")
else:
    print("".join(S))



### FIXED CODE ###

S = input()
T = input()
ss = list()
for n in range(len(S)-len(T)+1):
    for m in range(len(T)):
        if S[n+m] not in ["?", T[m]]:
            break
    else:
        ss.append((S[:n]+T+S[n+len(T):]).replace("?","a"))
if len(ss) == 0:
    print("UNRESTORABLE")
else:
    print(min(ss))
#include <iostream>
using namespace std;

int main() {
    int a, b, c, q;
    cin >> a >> b >> c;
    q = b/a;
    if(q < c){
        cout << q << endl;
    }else{
        cout << c << endl;
    };
    return 0;
}

### FIXED CODE ###

a = list(map(int, input().split()))
b = a[1]//a[0]
print(b if b < a[2] else a[2])
n=int(input())
a=int(input())
print("Yes" if n%500<=a)

### FIXED CODE ###

n=int(input())
a=int(input())
print("Yes" if n%500<=a else "No")
import re
a = input()
b = re.compile('^([^L][^R])*[^L]?$')
if b.match(a):
print('Yes')
else:
print('No')


### FIXED CODE ###

import re #与えられた条件にマッチする文字列か判定
a = input()
b = re.compile(r'^([^L][^R])*[^L]?$')
if b.match(a):
    print('Yes')
else:
    print('No')
def com(n,m):
    if(n-m < m):
        m=n-m
    result=1
    mylist=[i for i in range(1,m+1)]
    j=1
    for i in range(1,m+1):
        result*=(n+1-i)
        if(j<m):
            while(result%mylist[j]==0):
                result//=mylist[j]
                j+=1
                if(j>=m):
                    break
    return result

def yakusuu(i,m):
    _i=i
    while(i**2<=m):
        if(m%i==0):
            return i
        else:
            i+=1
    for j in range(_i-1,0,-1):
        if(m%j==0):
            break
    return m//j
    

N,M=map(int,input().split())
soinsuubunkai={}
tmp=2
i=2
_M=M
while(tmp <=M):
    tmp=yakusuu(tmp,M)

    if(tmp in soinsuubunkai):
        soinsuubunkai[tmp]+=1
    else:
        soinsuubunkai[tmp]=1
    M//=tmp
    if(M==1):
        break


tmp=1
for k in list(soinsuubunkai.values()):
    tmp*=com(k+N-1,k)
    tmp%=10**9+7
print(tmp)

### FIXED CODE ###

a,b,c=map(int,input().split())
print(max([a,b,c])*10+a+b+c-max([a,b,c]))