Harryxun/stf_run huggingface dataset:
#input
H, W = map(int, input().split())
import numpy as np

S = np.full((H, W), ".")
for i in range(H):
    x = input()
    for j in range(W):
        if x[j] == "#":
            S[i, j] = "#"

#output
import queue
INF = 10**10
dp = np.full((H, W), INF)

dx = [1, 0, -1, 0]
dy = [0, 1, 0 ,-1]

def clear_maze(sx, sy, gx, gy, maze):
    def bfs():
        q = []
        q.insert(0, (sx, sy))
        dp[sx, sy] = 0

        while len(q):
            x, y = q.pop()

            if x == gx and y == gy:
                break

            for i in range(0, 4):
                nx, ny = x + dx[i], y + dy[i]

                if 0 <= nx < H and 0 <= ny < W and maze[nx][ny] != "#" and dp[nx, ny] == INF:
                    q.insert(0, (nx, ny))
                    dp[nx, ny] = dp[x, y] + 1
        return dp[gx, gy]
    return bfs()

L = []
for h1 in range(H):
    for h2 in range(H):
        for w1 in range(W):
            for w2 in range(W):
                dp = np.full((H, W), INF)
                p = clear_maze(h1, w1, h2, w2, S)
                if p != INF:
                    L.append(p)

print(max(L))

### FIXED CODE ###

#input
H, W = map(int, input().split())
import numpy as np
S = [input() for _ in range(H)]

#output
import numpy as np

INF = -1
dx = [1, 0, -1, 0]
dy = [0, 1, 0 ,-1]

answer = 0
for i in range(H):
    for j in range(W):
        if S[i][j] != "#":
            dp = np.full((H, W), INF)
            q = []
            q.insert(0, (i, j))
            dp[i, j] = 0
            while len(q):
                x, y = q.pop()

                for t in range(4):
                    nx, ny = x + dx[t], y + dy[t]

                    if (0 <= nx < H) and (0 <= ny < W) and (S[nx][ny] != "#") and (dp[nx, ny] == INF):
                        q.insert(0, (nx, ny))
                        dp[nx, ny] = dp[x, y] + 1
            for row in dp:
                answer = max(answer, max(row))
print(int(answer))
a=input()
b=int(a/2)

### FIXED CODE ###

a=int(input())
b=int(a/2)
if b*2==a:
  print(a)
else:
  print(a*2)
import numpy as np
import math
s = input()
if s == "ABC"
    print("ARC")
else:
    print("ABC")

### FIXED CODE ###

import numpy as np
import math
s = input()
if s == "ABC":
    print("ARC")
else:
    print("ABC")
n, m,k = list(map(int, input().split()))
a_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))
count = 0
for i in range(n + m):
    #print(k)
    if a_list[0] >= b_list[0] and len(a_list) >= 1:
        k -= a_list.pop(0)
    else:
        k -= b_list.pop(0)
        
    if k > 0:
        count += 1
    else:
        break
        
print(count+1)

### FIXED CODE ###

import numpy as np
n,m,k = list(map(int, input().split()))
a_list = np.array(input().split()).astype(int)
b_list = np.array(input().split()).astype(int)
a_sum =[0]
b_sum=[0]
for i in range(n):
    a_sum.append(a_sum[-1]+ a_list[i])
for i in range(m):
    b_sum.append(b_sum[-1] + b_list[i])
#print(a_sum, b_sum)
total = 0
num = m

for i in range(n+1):
    
    if a_sum[i] > k:
        break
    while (k - a_sum[i]) < b_sum[num]:
        num -=1
        #print(i, num)
        if num == -1:
            break
    total = max(i+num, total)
    
    
print(total)
import math
import heapq
n,m = map(int, raw_input().split(' '))

heap = [-e for  e in map(int, raw_input().split(' '))]
heapq.heapify(heap)
while(m):
	u = heapq.heappop(heap)
	u *= -1
	u /=2
	if u:
		heapq.heappush(heap, -u)
	m-=1
	"""

	q = int(math.ceil(math.log(u,2)))
	if 2 ** q <= u: q +=1
	if q <= m:
		m-= q
	else:
		u /= 2
		m -=1
		if u:
			heapq.heappush(heap, -u)

	"""
print -sum(heap or [0])


### FIXED CODE ###

import math
import heapq
n,m = map(int, raw_input().split(' '))

heap = [-e for  e in map(int, raw_input().split(' '))]
heapq.heapify(heap)
while(m and heap):
	u = heapq.heappop(heap)
	u *= -1
	u /=2
	if u:
		heapq.heappush(heap, -u)
	m-=1
	"""

	q = int(math.ceil(math.log(u,2)))
	if 2 ** q <= u: q +=1
	if q <= m:
		m-= q
	else:
		u /= 2
		m -=1
		if u:
			heapq.heappush(heap, -u)

	"""
print -sum(heap or [0])
import collections
from math import factorial
from scipy.special import comb
# a = comb(n, r)
a = comb(n, r, exact=True)

def comb(n,r):
	#_a = factorial(n) / factorial(r) / factorial(n - r)
	a = comb(n, r, exact=True)
	return int(_a)


N = int(input())
A = list(map(int, input().split()))
c = collections.Counter(A)
#
for a in A:
	c[a]-=1
	#print(c)
	sum=0
	for b in set(c):
		if c[b]>=2:
			sum+=comb(c[b],2)
	c[a]+=1
	print(sum)


### FIXED CODE ###

L=int(input())

print(pow(L/3,3.0))
N, K = map(int, input().split())
*A, = map(int, input().split())
A = sorted(A)
diff = min([A[i+1] - A[i] for i in range(N-1) if A[i+1] - A[i] > 0])
for a in [a for a in A if a >= K]:
    if (a - K) % diff == 0:
        print('POSSIBLE')
        break
else:
    print('IMPOSSIBLE')

### FIXED CODE ###

N, K = map(int, input().split())
*A, = map(int, input().split())
A = sorted(A)
if K in A:
    print('POSSIBLE')
else:
    temp = [A[i+1] - A[i] for i in range(N-1) if A[i+1] - A[i] > 0]
    diff = min(temp) if temp else -1
    if diff == -1:
        print('IMPOSSIBLE')
    else:
        for a in [a for a in A if a >= K]:
            if (a - K) % diff == 0:
                print('POSSIBLE')
                break
        else:
            print('IMPOSSIBLE')
N = int(input())
A = [None]*N
B = [None]*N

for i in range(N):
  a,b = map(int, input().split())
  A[i]=a
  B[i]=b
  A.sort()
  B.sort()

  if N%2==0:
    x=A[N//2-1]
    y=B[N//2]
    else:
      x=A[N//2]
      y=B[N//2]
      print(y-x+1)


### FIXED CODE ###

#!/usr/bin python3
# -*- coding: utf-8 -*-

def main():
    N = int(input())
    A = [None]*N
    B = [None]*N

    for i in range(N):
        a,b = map(int, input().split())
        A[i]=a
        B[i]=b
    A.sort()
    B.sort()

    if N%2==0:
        x=A[N//2-1]+A[N//2]
        y=B[N//2-1]+B[N//2]
        print(y-x+1)
    else:
        x=A[N//2]
        y=B[N//2]
        print(y-x+1)

if __name__ == '__main__':
    main()
import math
print(int(input())+2*pi)

### FIXED CODE ###

ennshuuritsu = 3.1415
nyuuryoku = int(input())

print(nyuuryoku*2*ennshuuritsu)
R=int(input())
pai=float(3.14)
    print(float(R*2*pai))

### FIXED CODE ###

R=int(input())
pai=3.14
print(R*2*pai)
n = input()
for i in range(len(n)):
  if n[i] == '1':
    n[i] = '9'
   elif n[i] == '9':
    n[i] = '1'
print(n)


### FIXED CODE ###

n = list(input())
for i in range(len(n)):
  if n[i] == '1':
    n[i] = '9'
  elif n[i] == '9':
    n[i] = '1'
print("".join(n))
a,b,c = int(input().split())
aa = b
bb = a
cc = aa
aaa = c
print(aaa, bb, cc)

### FIXED CODE ###

a,b,c = map(int, input().split())
a,b,c = c,a,b
print(a,b,c)
N = int(input())
Alist = list(map(float, input().split()))
memo = [{} for i in range(N)]

def ddp(cur_N, ai):
    if ai in memo[cur_N]:
        return memo[cur_N][ai]
    if cur_N >=N-1:
        return ai
    aj = Alist[cur_N+1]
    ret = max([ai + ddp(cur_N+1, aj), -1*ai + ddp(cur_N+1, -1*aj)])
    memo[cur_N][ai] = ret
    return ret
print(int(ddp(0, Alist[0])))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6)
N = int(input())
Alist = list(map(int, input().split()))
memo = [{} for i in range(N)]

def ddp(cur_N, ai):
    if ai in memo[cur_N]:
        return memo[cur_N][ai]
    if cur_N >=N-1:
        return ai
    aj = Alist[cur_N+1]
    ret = max(ai + ddp(cur_N+1, aj), -1*ai + ddp(cur_N+1, -1*aj))
    memo[cur_N][ai] = ret
    return ret
print(ddp(0, Alist[0]))
A, B, C, K = map(int,input().split())

if k <= A:
    print(K)
if A < K <= A + B:
    print(A)
if A + B < K <= A + B + C:
    print(2*A + B - K)
    

### FIXED CODE ###

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

if K <= A:
    print(K)
if A < K <= A + B:
    print(A)
if A + B < K <= A + B + C:
    print(2*A + B - K)
a = list(map(float,input().split()))
 
for i in range(0, 1251):
  if a[0]/0.08 >= i and (a[0]-1.0)/0.08 < i and a[1]/0.1 >= i and (a[1]-1.0)/0.1 < i:
    print(i)
    return
print(-1)

### FIXED CODE ###

def f():
  a = list(map(float,input().split()))

  for i in range(0, 1251):
    if i >= a[0]/0.08 and i < (a[0]+1)/0.08 and i >= a[1]/0.1 and i < (a[1]+1)/0.1:
      print(i)
      return

  print(-1)

f()
import sys
input = sys.stdin.readline
 
def main():
    S = input()
    if S = 'Sunny':
        print('Cloudy')
    elif S = 'Cloudy':
        print('Rainy')
    elif S = 'Rainy':
        print('Sunny')

if __name__ == '__main__':
    main()

### FIXED CODE ###

S = input()
if S == 'Sunny':
    print('Cloudy')
elif S == 'Cloudy':
    print('Rainy')
elif S == 'Rainy':
    print('Sunny')
import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    n = int(input())
    counter = [[0] * 16 for _ in range(24)]
    ans = 0
    for _ in range(n):
        S = input()
        if '.' in S:
            a, b = S.split('.')
            a = int(a + b + '0' * (9 - len(b)))
        else:
            a = int(S + '0' * 9)
        two = five = 0
        while a % 2 == 0:
            two += 1
            a //= 2
        while a % 5 == 0:
            five += 1
            a //= 5
        for i in range(24):
            for j in range(16):
                if i + two >= 18 and j + five >= 18:
                    ans += counter[i][j]
        counter[two][five] += 1
    print(ans)
resolve()

### FIXED CODE ###

import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
from collections import Counter
def resolve():
    n = int(input())
    C = Counter()
    for _ in range(n):
        S = input()
        if '.' in S:
            a, b = S.split('.')
            a = int(a + b + '0' * (9 - len(b)))
        else:
            a = int(S + '0' * 9)
        two = five = 0
        while a % 2 == 0:
            two += 1
            a //= 2
        while a % 5 == 0:
            five += 1
            a //= 5
        C[two, five] += 1

    ans = 0
    for key0, val0 in C.items():
        i0, j0 = key0
        for key1, val1 in C.items():
            i1, j1 = key1
            if i0 + i1 >= 18 and j0 + j1 >= 18:
                if key0 == key1:
                    ans += val0 * (val0 - 1) // 2
                elif key0 < key1:
                    ans += val0 * val1
    print(ans)
resolve()
while 1:
    n = input()
    if n==0: break
    pm = -1; m = 0;
    for i in xrange(n):
        p,d1,d2 = map(int, raw_input().split())
        if m<d1+d2:
            pm = p; m = d1+d2;
    print pm,m

### FIXED CODE ###

while 1:
    try:
        n = input()
        if n==0: break
        l = []
        for i in range(n):
            p,d1,d2 = map(int, raw_input().split())
            l.append([p,d1+d2])
        l.sort(reverse=True, key=lambda x:x[1])
        print l[0][0],l[0][1]
    except SyntaxError:
        pass
A = [-1] * (10 ** 9)
print(A)

### FIXED CODE ###

##https://atcoder.jp/contests/dp/tasks/dp_a 
N = int(input())
Place_Height_List = list(map(int,input().split()))  
Min_List = [0,abs(Place_Height_List[1]-Place_Height_List[0])]

for i in range(2,len(Place_Height_List)):
    One_Step = abs(Place_Height_List[i] - Place_Height_List[i - 1]) 
    Two_Step = abs(Place_Height_List[i] - Place_Height_List[i - 2])
    Min_List.append(min(Min_List[i - 1] + One_Step,Min_List[i - 2] + Two_Step))
    
print(Min_List[-1])
if input() < input():
  print(0)
else :
  print(1)

### FIXED CODE ###

a,b = map(int,input().split())
if a < b:
  print(0)
else :
  print(10)
n = input()
a = []
for i in range(n):
    city,core = input().split()
    a.append((city,score,i+1))
a.sort(key=lambda k: (k[1],-k[0]))

for i in range(n):
    print(a[i][2])

### FIXED CODE ###

n = int(input())
a= []
for i in range(n):
	city, score = input().split()
	score = int(score)
	a.append((city, score, i+1))
a.sort(key=lambda k : (k[0], -k[1]))
for i in range(n):
	print(a[i][2])
s=str(input())
if s[1]==B:
	print('ARC')
else:
	print('ABC')

### FIXED CODE ###

s=str(input())
if s[1]=='B':
	print('ARC')
else:
	print('ABC')
a,b,c = map(int, input().split())
if c-a-b<0:
    print('No')
else:
    4*a*b<(c-a-b)**2:
    print('Yes')

### FIXED CODE ###


a,b,c = map(int, input().split())
if c-a-b<0:
    print('No')
else:
    if 4*a*b<(c-a-b)**2:
        print('Yes')
    else:
        print('No')
n,q=map(int,input().split())

tree = [[] for _ in range(n)]
ret=[0]*n

for i in range(n-1):
    a,b=map(int,input().split())
    tree[a-1].append(b-1)

def counter(target,num):
    global ret
    ret[target]+=num
    if not tree[target]:
        return
    for i in tree[target]:
        counter(i,num)
for _ in range(q):
    p,x=map(int,input().split())
    counter(p-1,x)

print(*ret)

### FIXED CODE ###

n,q = map(int,input().split())
rl = [0] * n
al = [0] * n
for i in range(n-1):
    a,b = map(int,input().split())
    rl[b-1] = a -1
for j in range(q):
    p,x = map(int,input().split())
    al[p-1] += x
for k in range(1,n):
    al[k] += al[rl[k]]
print(*al)
import numpy as np
import math
A, B, C, D = list(map(int, input().split()))

def lcm(x, y):
    return (x * y) / math.gcd(x, y)
E = lcm(C, D)

u = np.arange(A,B+1)
count_U = len(u)
u_c = [i for i in u if i % C == 0]
count_C = len(u_c)
u_d = [i for i in u if i % D == 0]
count_D = len(u_d)
u_e = [i for i in u if i % E == 0]
count_E = len(u_e)

answer = count_U - (count_C + count_D -count_E)
print(answer)


### FIXED CODE ###

S = input()
result = 'Good'
for i in range(3):
    if S[i] == S[i + 1]:
        result = 'Bad'
        break
    else:
        result = 'Good'
print(result)
N = int(input())
S = input()

total = []

def yugo(st,x):
	if len(st) <= x + 1:
		return st[x]
		
	if st[x] == st[x + 1]:
		return yugo(st,x+1)
	else:
		return st[x] +  yugo(st,x+1)
	

print(int(len(yugo(S,0))))


### FIXED CODE ###

N = int(input())
S = input()

total = []
Y = 0

for i in range(N):
	if i == N-1:
		Y = Y + 1
		break
	if S[i] == S[i+1]:
		continue
	else:
		Y = Y + 1
		
print(Y)
def main():
    n = int(input())
    result = []
    for i in range(n):
        a = input()
        b = input()
        array = [[1 for i in range(len(a))] for j in range(len(b))]
        for i in range(1, len(a)):
            for j in range(1, len(b)):
                c = 0
                if a[j] == b[i]:
                    c = 1
                array[i][j] = max(
                                    array[i-1][j],
                                    array[i][j-1],
                                    array[i-1][j-1]+c)
        result.append(array[len(a)-1][len(b)-1])
    for i in result:
        print(i)
if __name__ == "__main__":
    main()



### FIXED CODE ###

#dj 16D8101012J ito jun
import sys
def search(a,b):
    na=len(a)
    nb=len(b)
    array = [[0]*(nb+1) for _ in range(na+1)]
    for i,x in enumerate(a,1):
        prerow=array[i-1]
        row=array[i]
        for j,y in enumerate(b,1):
            if x == y:
                row[j]=prerow[j-1]+1
            elif prerow[j] < row[j-1]:
                row[j] = row[j-1]
            else:
                row[j] = prerow[j]
    return array[-1][-1]

n = int(input())
strs = [list(i) for i in sys.stdin.read().splitlines()]
result = [search(strs[i*2], strs[i*2+1]) for i in range(n)]
print(*result, sep="\n")
S = input()
K = int(input())
if S[0] != '1':
  print(S[0])
else:
  for i in range(len(S)[1:]):
    if i >= K:
      print(1)
      break
    if S[i] != 1:
      print(S[i])
      break

### FIXED CODE ###

S = input()
K = int(input())
if S[0] != '1':
  print(S[0])
else:
  ans = '1'
  for i in range(K)[1:]:
    if S[i] != '1':
      ans = S[i]
      break
  print(ans)
y = list(input())
# y = [0,1,0]のようなリストになっているはず
x = 0
for i in range(0,2):
	if y[i] == 1:
      x += 1
print(x)

### FIXED CODE ###

s = input()
print(s.count('1'))
n = int(input())
    l = list(map(int, input().split()))
    ans = 0

    for i in range(n - 2):
        for j in range(i + 1, n - 1):
            for k in range(j + 1, n):
                if len(set([l[i], l[j], l[k]])) == 3 and max(l[i], l[j], l[k]) < sum([l[i], l[j], l[k]]) - max(l[i], l[j], l[k]):
                    ans += 1
    print(ans)

### FIXED CODE ###

n = int(input())
l = list(map(int, input().split()))
ans = 0
for i in range(n - 2):
    for j in range(i + 1, n - 1):
        for k in range(j + 1, n):
            if len(set([l[i], l[j], l[k]])) == 3 and max(l[i], l[j], l[k]) < sum([l[i], l[j], l[k]]) - max(l[i], l[j], l[k]):
                ans += 1
print(ans)
a, b = map(int, input.split())
if a <10 and b<10:
  	return a*b
else:
  return -1

### FIXED CODE ###

a, b = map(int, input().split())
if a <10 and b<10:
  print(a*b)
else:
  print(-1)
N = input()
if N == '1':
    print('Hello World')
A,B = [int(input()) for _ in range(2)]
print(A+B)

### FIXED CODE ###

N = input()
if N == '1':
    print('Hello World')
else:
    A,B = [int(input()) for _ in range(2)]
    print(A+B)
S = int(input())

W = int(input())

if W >= S:
    print("unsafe")
else:
    print("safe")

### FIXED CODE ###

s, w = map(int, input().split())

if w >= s:
  print("unsafe")
  
else:
  print("safe")
from sys import setrecursionlimit

# 再帰上限の変更(デフォルトは1000)
setrecursionlimit(10 ** 100)

N, M = map(int, input().split())
XYZ = [list(map(int, input().split())) for i in range(M)]

# XがわかればYがわかるので、あるAiがわかったときどこまでわかるか?をグラフにしてDFSで探索

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

seen = [0] * (N + 1)

for X, Y, Z in XYZ:
    graph[X].append(Y)
    graph[Y].append(X)


def dfs(a):
    if seen[a] == 1:
        return
    else:
        seen[a] = 1
        for i in graph[a]:
            dfs(i)


ans = 0

for i in range(1, N + 1):
    if seen[i] == 1:
        continue
    else:
        dfs(i)
        ans += 1

print(ans)


### FIXED CODE ###

import sys

# 再帰上限の変更(デフォルトは1000)
# 大きくしすぎるとREするらしい
sys.setrecursionlimit(10 ** 9)

N, M = map(int, input().split())
XYZ = [list(map(int, input().split())) for i in range(M)]

# XがわかればYがわかるので、あるAiがわかったときどこまでわかるか?をグラフにしてDFSで探索

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

seen = [0] * (N + 1)

for X, Y, Z in XYZ:
    graph[X].append(Y)
    graph[Y].append(X)


def dfs(a):
    if seen[a] == 1:
        return
    else:
        seen[a] = 1
        for i in graph[a]:
            dfs(i)


ans = 0

for i in range(1, N + 1):
    if seen[i] == 1:
        continue
    else:
        dfs(i)
        ans += 1

print(ans)
def SsSl(): return list(map(lambda x: x, input()))

n = int(input())
#List = [s for s in input().split()]
List = SsSl()

if n%2==1:
    print('No')
else:
    if List[0:(n/2)]==List[(n/2):]:
        print('Yes')
    else:
        #print(List[0:(n/2)])
        #print(List[(n/2):])
        print('No')

### FIXED CODE ###

def SsSl(): return list(map(lambda x: x, input()))

n = int(input())
#List = [s for s in input().split()]
List = SsSl()

if n%2==1:
    print("No")
else:
    if List[0:(n//2)]==List[(n//2):]:
        print("Yes")
    else:
        #print(List[0:(n/2)])
        #print(List[(n/2):])
        print("No")
import sys
MX = 10**5
def main():
    data = map(int, sys.stdin.buffer.read().split())
    N = next(data)
    IV, IW = [], []

    H = min(N + 1, 1 << 10)
    Hb = (H - 1).bit_length()
    dp = [[0] * (MX + 1) for _ in range(H)]
    i = 1
    for v, w in zip(data, data):
        if i < H:
            IV.append(v)
            IW.append(w)
            dpi = dp[i]
            dpip = dp[i >> 1]
            for j in range(w):
                dpi[j] = dpip[j]
            for j in range(w, MX + 1):
                dpi[j] = max(dpip[j], dpip[j - w] + v)
        i += 1
        if i > N:
            break

    Q = next(data)
    for v, L in zip(data, data):
        if v < H:
            print(dp[v][L])
            continue
        ans = []
        for i in range(1 << (v.bit_length() - Hb)):
            node = v
            value = weight = 0
            while node >= H:
                if i & 1:
                    value += IV[node - 1]
                    weight += IW[node - 1]
                    if weight > L:
                        break
                node >>= 1
                i >>= 1
            else:
                ans.append(value + dp[node][L - weight])
        print(max(ans))

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
MX = 10**5
def main():
    data = map(int, sys.stdin.buffer.read().split())
    N = next(data)

    H = min(N + 1, 1 << 10)
    dp = [None] * H
    dp[0] = [0] * (MX + 1)
    IV, IW = [], []
    i = 1
    for v, w in zip(data, data):
        if i < H:
            dpi = dp[i >> 1][:]
            dp[i] = dpi
            for j in range(MX, w - 1, -1):
                dpi[j] = max(dpi[j], dpi[j - w] + v)
        else:
            IV.append(v)
            IW.append(w)
        i += 1
        if i > N:
            break

    Q = next(data)
    for v, L in zip(data, data):
        if v < H:
            print(dp[v][L])
            continue

        item_values = []
        item_weights = []
        while v >= H:
            item_values.append(IV[v - H])
            item_weights.append(IW[v - H])
            v >>= 1

        l = len(item_values)
        V = [0] * (1 << l)
        W = [0] * (1 << l)
        ans = dp[v][L]
        for i in range(1, 1 << l):
            msb = i & (-i)
            msbb = msb.bit_length() - 1
            wi = W[i - msb] + item_weights[msbb]
            W[i] = wi
            if wi <= L:
                vi = V[i - msb] + item_values[msbb]
                ans = max(ans, vi + dp[v][L - wi])
                V[i] = vi
        print(ans)

if __name__ == '__main__':
    main()
n,k,q=map(int, input().split())
a=[int(input()) for i in range(q)]

c = collections.Counter(a)

for i in range(1,n+1):
    if k-q+c[i]>=1:
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

import collections

n,k,q=map(int, input().split())
a=[int(input()) for i in range(q)]

c = collections.Counter(a)

for i in range(1,n+1):
    if k-q+c[i]>=1:
        print('Yes')
    else:
        print('No')
n = int(input())
a = [int(input()) for i in range(n)]

for i in (reversed(a)):
    print(i)


### FIXED CODE ###

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

print(' '.join(map(str, reversed(a))))
import sys
a,b,t = list(map(int, input().split()))
print(b*(c//a))

### FIXED CODE ###

import sys
a,b,t = list(map(int, input().split()))
print(b*(t//a))
sum_all=[]
for i in range(N-1):
    for j in range(i+1,N):
        A[i]=A[i]%mod
        A[j]=A[j]%mod
        sum_all.append((A[i])*(A[j]))

sum=0
for n in sum_all:
    sum+=n
print(sum%mod)

### FIXED CODE ###

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

mod=10**9+7

B=[0]
for i in range(1,N+1):
    B.append(A[i-1]+B[i-1])

ans=0
for i in range(N-1):
    ans+=A[i]*(B[N]-B[i+1])
    ans%=mod

print(int(ans))
n,X,m=map(int,input().split())
x=[0]*m
y=[0]*m
y[0]=X
z=[0]*(m+1)
z[X]+=1
for i in range(1,m):
    x[i]=(i**2)%m
for i in range(1,m):
    y[i]=x[y[i-1]]
    z[y[i]]+=1
    if z[y[i]]==2:
        e=i
        q=y[i]
        break
for i in range(len(y)):
    if y[i]==q:
        b=i
        break
l=y[b:e]
L=len(l)
s=sum(l)
#print(x)
#print(y)
#print(z)
#print(b,e)
#print(l)
#print(sum(y[:b]))
#print(((n-b)//L)*s)
#print(sum(l[:(n-b)%L]))
if n>=b:
    ans=sum(y[:b])+((n-b)//L)*s+sum(l[:(n-b)%L])
else:
    ans=sum(y[:n])
if m!=1:
    print(ans)
else:
    print(0)

### FIXED CODE ###

n,X,m=map(int,input().split())
if m==1:
    print(0)
else:
    x=[0]*m
    y=[0]*m
    y[0]=X
    z=[0]*(m+1)
    z[X]+=1
    for i in range(1,m):
        x[i]=(i**2)%m
    for i in range(1,m):
        y[i]=x[y[i-1]]
        z[y[i]]+=1
        if z[y[i]]==2:
            e=i
            q=y[i]
            break
    for i in range(len(y)):
        if y[i]==q:
            b=i
            break
    l=y[b:e]
    L=len(l)
    s=sum(l)
    #print(x)
    #print(y)
    #print(z)
    #print(b,e)
    #print(l)
    #print(sum(y[:b]))
    #print(((n-b)//L)*s)
    #print(sum(l[:(n-b)%L]))
    if n>=b:
        ans=sum(y[:b])+((n-b)//L)*s+sum(l[:(n-b)%L])
    else:
        ans=sum(y[:n])
    print(ans)
a, b = int (input())
A = a + b
B = a - b
C = a * b
print (max (A, B, C))

### FIXED CODE ###

a, b = map(int,input().split())
A = a + b
B = a - b
C = a * b
print (max (A, B, C))