Harryxun/stf_run huggingface dataset:
#coding:utf-8



def main():
    
    def dbg(*something):
        if DEBUG:
            print(*something)


    #正の宝石を戻すことはない
    #負の宝石を戻すのは後半
    from sys import stdin
    from math import ceil,floor
    DEBUG = False
    N,K = list(map(int,stdin.readline().split()))
    V = list(map(int,stdin.readline().split()))


    #残りk回のとき深さk以下の場所に正の宝石がない→終了
    #i回の操作で取れる石>それまでにとるi-1個の石の和
    #深さiにある石vの価値：v - (それまでにとるi-1個の石の和　except (k-i)個の負の石)
    '''
    '''




    def tansaku(left,right,rK,N,score):
        dbg(V[left:right+1],rK,N,score)

        N.sort()
        max_v = score + sum(N[rK:])
        


        # n = []
        for i in range(left,min(rK+left, ceil((right - left +1)/2)+left)):
            
            if V[i] <= 0:
                continue


            next_rK = rK - 1 - (i - left)
            next_tmp_v = tansaku(i+1,right,  next_rK, N+V[left:i], score+V[i])
            #max_v = max(next_tmp_v , max_v)
            if max_v < next_tmp_v:
                max_v = next_tmp_v


            break

        # n = []
        for i in range(right ,max(right - ceil((right-left+1)/2)  ,right-rK)  ,-1 ):
            
            if V[i] <= 0:
                continue

            next_rK = rK - 1 - (right - i)
            next_tmp_v = tansaku(   left,   i-1  ,next_rK,N+V[i+1:right+1],score+V[i])
            m#max_v = max(next_tmp_v , max_v)
            if max_v < next_tmp_v:
                max_v = next_tmp_v
            break


        return max_v

    print(tansaku(0,len(V)-1,K,[],0))





if __name__ == '__main__':
    main()


### FIXED CODE ###

#coding:utf-8



def main():
    
    def dbg(*something):
        if DEBUG:
            print(*something)


    #正の宝石を戻すことはない
    #負の宝石を戻すのは後半
    from sys import stdin
    from math import ceil,floor
    DEBUG = False
    N,K = list(map(int,stdin.readline().split()))
    V = list(map(int,stdin.readline().split()))
    
    max_value = 0
    dbg([i for i in range(3,-1,-1)])
    for getnum in range(1,min(N+1,K+1)):  #取る宝石の総数
        for a in range(getnum + 1):  #左から石を取る回数
            J = [0] * getnum #石
            b = getnum - a #右から石を取る回数
            for i in range(a):
                J[i] = V[i]
            for i in range(b):
                J[a+i] = V[-i-1]
            J.sort()
            #dbg(J,a,b)
            t = min(K-getnum,getnum) #捨てる石
           
            for i in range(t): 
                if J[i] >= 0:
                    t = i
                    break
            #dbg(J,i,t,a,b,J[t:])
            tmp_max = sum(J[t:])

            max_value = max(max_value,tmp_max)
    print(max_value)



if __name__ == '__main__':
    main()
N, K = map(int, input().split())
S = input()
S[K] = S[K].lower():
print(S)

### FIXED CODE ###

N, K = map(int, input().split())
S = list(input())
S[K -1] = S[K - 1].lower()
print(''.join(S))
S=input()
N=len(S)
Letter=[]
list=[0]*N
for i in range(N):
  Letter.append(S[i])

R_sum=0
L_sum=0
Leftl=0

for i in range(Leftl,N-2):

  R_sum=0
  while S[i]=="R":
    R_sum=R_sum+1
    i=i+1
  else:
    L_sum=0
    if R_sum>=1:
      while S[i]=="L":
        L_sum=L_sum+1
        if i!=N-1:
          i=i+1
        else:
          break
      else:
        print(Leftl,R_sum,L_sum)

        if R_sum%2==1:
          list[Leftl+R_sum-1]=(R_sum+L_sum+1)//2
          list[Leftl+R_sum]=(R_sum+L_sum)//2          
        else:
          list[Leftl+R_sum-1]=(R_sum+L_sum)//2
          #print(Leftl,R_sum)
          list[Leftl+R_sum]=(R_sum+L_sum+1)//2          
        Leftl=i          
        
        
        
print(list)


  
#  if S[i]=="R" and S[i+1]=="L":
#    list.append(i)

#print(Letter)
#print(list)
#for j in list:
#  print(j)

### FIXED CODE ###

S=input()
N=len(S)
ans=[]

def calc(R_count,L_count,ans):
  ans += [0]*(R_count-1)
  ans.append( (R_count+1)//2 + (L_count//2) )  
  ans.append( (L_count+1)//2 + (R_count//2) )
  ans += [0]*(L_count-1)
  return

R_count=0
L_count=0
i=0

while i<N:
  #print(i,S[i])
  if S[i]=="R":
    R_count += 1
    i += 1
  else:
    while i<N and S[i]=="L":
      #print(i,S[i])
      L_count +=1
      i += 1
    calc(R_count,L_count,ans)
    R_count=0
    L_count=0

#print(ans)
print(*ans)
import sys
# 再帰上限を引き上げる
sys.setrecursionlimit(10**6)

####
# DFS(深さ優先探索

count = 0
def dfs(graph, v, seen):
    #print(seen)
    # Falseがない、つまり頂点が1個しかない場合は、1を返す
    if not False in seen:
        global count
        count +=1
        return
    
    # 頂点Vから行ける頂点を全探索
    for i in graph[v]:
        # 行ける場所はTrueである。
        if seen[i]:
            continue
        
        # いったんTrueにして
        seen[i] = True
        # 探索したら
        dfs(graph, i, seen)
        # 戻す
        seen[i] = False
        
    return
        
        

####

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

# グラフを作る
graph = [[] for i in range(N)]
#print(graph)

for i in range(M):
    a, b = map(int, input().split())
    # index番号にあわせたいので、1引く
    a -= 1
    b -= 1
    graph[a].append(b)
    graph[b].append(a)
    
seen = [False for i in range(N)]
seen[0] = True
#print(seen)

dfs(graph, 0, seen)

# 全探索できた数を表示
print(count)

### FIXED CODE ###

import sys

# 再帰上限を引き上げる
sys.setrecursionlimit(10**6)

count = 0
def dfs(graph, v, seen):

    if not False in seen:
        global count
        count += 1
        return

    # 頂点vから行ける頂点を全探索
    for i in graph[v]:
        if seen[i]:
            continue
        seen[i] = True
        dfs(graph, i, seen)
        seen[i] = False
    
    return

# ここから本文
N, M = map(int, input().split())

# グラフ構造を作る
graph = [[] for i in range(N)]
for i in range(M):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    graph[a].append(b)
    graph[b].append(a)

seen = [False for i in range(N)]
seen[0] = True
dfs(graph, 0, seen)

print(count)
x,y = map(int,input().split())
d = y
a = (d*7)%9
b = (d-a*4)
c = n-a-b
if c>=0 and b>=0:
    print(b,a,c)
else:
    print(-1,-1,-1)

### FIXED CODE ###

N, Y = map(int, input().split())
Y //= 1000
k = min((Y - N) // 4, Y // 5)
if 9 * k >= 2 * (Y - N):
    x = (Y - N) - 4 * k
    y = -2 * (Y - N) + 9 * k
    z = Y - 5 * k
    print(x, y, z)
else:
    print(-1, -1, -1)
N, K = map(int, input().split())
c = []
for i in range(N):
	c.append(input().split())
	
c.sort(key=lambda x: x[0])

f = 0
for i in range(N):
	f += int(c[i][1])
	if f >= K:
		print(c[i][0])
		break

### FIXED CODE ###

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

if C >= A and C <= B:
	print('Yes')
else:
	print('No')
import numpy as np
import sys
 
N = input()
a = list(int(i) for i in input().split())
an = np.array(a)
a_sort = np.argsort(an)
for i in a_sort:
  sys.stdout.write(str(i+1)+" ")

### FIXED CODE ###

Ns = input()
N = int(Ns)
if(N % 2 == 1):
  if(N == 1):
    print('{:.7f}'.format(N))
  else:
    print('{:.7f}'.format(((N+1)/2)/N))
else:
  print('{:.7f}'.format(1/2))
#じゅっぴーフロイド
from collections import*
from itertools import*
def warshall_floyd(d):
    #d[i][j]: iからjへの最短距離
    for k in range(1,n+1):
        for i in range(1,n+1):
            for j in range(1,n+1):
                d[(i,j)] = min(d[(i,j)],d[(i,k)] + d[(k,j)])
    return d

##############################
n,w,r = map(int,input().split()) #n:頂点数　w:辺の数
d = defaultdict(lambda:float("inf"))
*r,=map(int,input().split())
#d[u][v] : 辺uvのコスト(存在しないときはinf)

for i in range(w):
    x,y,z = map(int,input().split())
    d[(x,y)] = z
    d[(y,x)] = z
#print(d)
for i in range(n):
    d[(i,i)] = 0 #自身のところに行くコストは０
d=warshall_floyd(d)
#print(d)
#print([d[i] for i in permutations(r)])
print(min(sum(d[(s,t)]for s,t in zip(i,i[1:]))for i in permutations(r)))

### FIXED CODE ###

print("Yes" if "9" in list(input()) else "No")
n , k , q = map(int,input().split())

scores = []
def decrease(n):
  return n-1

for i in range(q):
  scores.append(k)

for i in range(n):
  a = int(input()) # Ai
  scores = map(decrease, scores) # -1 to all 
  scores[a-1] += 1

for i in range(n):
  if scores[i] > 0:
    print("Yes")
  else:
    print("No")

### FIXED CODE ###

n,k,q = map(int, input().split())
 
scores = []
 
for i in range(n):
  scores.append(k-q)
 
for i in range(q):
  a = int(input()) #Ai
  scores[a-1] = scores[a-1]+1
  
for i in range(n):
  if(scores[i] > 0):
    print("Yes")
  else:
    print("No")
n = int(input())
h = list(map(int,input().split()))

ans = []
c = 0
for i in range(n-1):
    if h[i+1] <= h[i]:
        c += 1
        if i == n-2:
            ans.append(c)
    elif h[i+1] > h[i]:
        ans.append(c)
        c = 0

print(max(ans))


### FIXED CODE ###

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

ans = []
c = 0
for i in range(n-1):
    if h[i+1] <= h[i]:
        c += 1
        if i == n-2:
            ans.append(c)
    elif h[i+1] > h[i]:
        ans.append(c)
        c = 0

if not ans:
    print(0)
    exit()
print(max(ans))
hands_a, hands_b, hands_c = (list(input()) for i in range(3))

hands = {'a': hands_a, 'b': hands_b, 'c': hands_c}

turn = 'a'
while len(hands[turn]) > 0:
    turn = hands[turn].popleft
print(turn.upper())


### FIXED CODE ###

hands_a, hands_b, hands_c = (input() for i in range(3))

hands = {'a': hands_a, 'b': hands_b, 'c': hands_c}

turn = 'a'
while True:
    if len(hands[turn]) == 0:
        print(turn.upper())
        exit()
    next_turn = hands[turn][0]
    hands[turn] = hands[turn][1:]
    turn = next_turn
a, b, c, d = map(int, input())

dist1 = abs(a - b)
dist2 = abs(b - c)

if dist1 <= d and dist2 <= d:
    print('Yes')
else:
    print('No')
    

### FIXED CODE ###

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

dist1 = abs(a - b)
dist2 = abs(b - c)

if dist1 <= d and dist2 <= d or abs(a - c) <= d:
    print('Yes')
else:
    print('No')
N = int(input())
s = [input() for i in range(N)]
t = [0]*(N-1)

for n in range(N-1):
  t[n] = s[n] - s[n+1]
  if t[n] <= 0: 
    continue
  else:
    s[n+1] += t[n]

print(min(t))

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split())) 
ans = 0
 
for n in range(N-1):
  t = A[n] - A[n+1]
  if t <= 0: continue
  else:
    A[n+1] += t
    ans += t

print(ans)
import sys
import heapq as hq
input = sys.stdin.readline

n,m = map(int,input().split())
a = list(map(int,input().split()))
b = [0] * m

for i in range(m):
    b[i] = list(map(int,input().split()))

ans = 0
for i in range(n):
  a[i] = -a[i]

for i in b:
  a += i[1] * i[0]

hq.heapify(a)

for i in range(n):
  ans -= hq.heappop(a)
print(ans)

### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

from operator import itemgetter

N,M = map(int,readline().split())
A = list(map(int,readline().split()))
m = map(int,read().split())
BC = list(zip(m,m))

BC.sort(key = itemgetter(1),reverse=True)

BC.append((N,-1))

change = []
for b,c in BC:
    change += [c] * b
    if len(change) > N:
        break

A += change
A.sort()
answer = sum(A[-N:])
print(answer)
import heapdict

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

ct = [0] * (2*10**5+1)
ans = [0] * (n+1)
ld = [0] * (n+1)

for i in range(len(la)):
    ct[la[i]] += 1

sa = set(la)

for j in sa:
    ans[j] = ct[j] * (ct[j]-1) // 2
    ld[j] = ans[j] - ((ct[j]-2) * (ct[j]-1) // 2)

total = sum(ans)

# print(ct[0:10])
# print(ans)

for k in range(n):
    knum = la[k]
    print(total - ld[knum])


### FIXED CODE ###

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

ct = [0] * (2*10**5+1)
ans = [0] * (n+1)
ld = [0] * (n+1)

for i in range(len(la)):
    ct[la[i]] += 1

sa = set(la)

for j in sa:
    ans[j] = ct[j] * (ct[j]-1) // 2
    ld[j] = ans[j] - ((ct[j]-2) * (ct[j]-1) // 2)

total = sum(ans)

# print(ct[0:10])
# print(ans)

for k in range(n):
    knum = la[k]
    print(total - ld[knum])
N = int(input())
S = list(input())

a = [chr(i) for i in range(65, 65+26)]
b = [chr(i) for i in range(65+N, 65+26)]
for i in range(N):
    b.append(a[i])

a_dict = {}
for i in range(len(a)) :
    a_dict[a[i]] = b[i]
for i in range(len(S)) :
    S[i] = a_dict[S[i]]

print(''.join(S))

### FIXED CODE ###

s = input()
week = {'FRI': 2,'THU': 3,'WED': 4,'TUE':5,'MON':6,'SAT':1,'SUN':7}
print(week[s])
n = int(input())
s = input()
cou = 0
for i in range(1000):
  i = "{0:03d}".format(i)
  a,b,c = i[0],i[1],i[2]
  for j in range(n):
    if s[j]==a and bit==0:
      for k in range(j+1,n):
        if s[k]==b :
          for m in range(k+1,n):
            if s[m]==c :
              cou += 1
            
print(cou)

### FIXED CODE ###

a,b = map(int,input().split())
c,d = map(int,input().split())
if ((a+1)==c or (a==12 and c==1)):
  if d ==1:
    print(1)
else:
  print(0)
N = int(input())
B = list(map(int,input().split()))
A = ['a']*N

if N ==  2:
  print(B[0]*2)

else:
  for i,v in enumerate(B):
    if i != N-2:
      if B[i] <= B[i+1]:
        if A[i] == 'a':
          A[i] = B[i]
        if A[i+1] == 'a':
          A[i+1] = B[i]
      else:
        if A[i] == 'a':
          A[i] = B[i]
    else:
      if A[i+1] == 'a':
        A[i+1] = B[i]
  print(sum(A))


### FIXED CODE ###

N = int(input())
B = list(map(int,input().split()))
A = ['a']*N

if N ==  2:
  print(B[0]*2)

else:
  for i,v in enumerate(B):
    if i != N-2:
      if B[i] <= B[i+1]:
        if A[i] == 'a':
          A[i] = B[i]
        if A[i+1] == 'a':
          A[i+1] = B[i]
      else:
        if A[i] == 'a':
          A[i] = B[i]
    else:
      if A[i] == 'a':
        A[i] = B[i]
      if A[i+1] == 'a':
        A[i+1] = B[i]
  print(sum(A))
import sys
input = sys.stdin.readline
import random
import copy
import math
def main():
     A,B,N = map(int,input().split())
     x = min(B,N)-0.000000000000001
     ma = math.floor(A*x/B)-A*math.floor(x/B)
     print(ma)
                    
main()


### FIXED CODE ###

import sys
input = sys.stdin.readline
import random
import copy


def main():
     k=int(input())
     a,b = map(int,input().split())
     for x in range(a,b+1):
          if x%k==0:
               print("OK")
               return
     print("NG")
                    
main()
a, b = int(input()).split
sum = a + b
sumto = sum % 2
if sumto = 1:
  response = 'Odd'
else:
  response = 'Even'
  return response

### FIXED CODE ###

a, b = map(int, input().split())
seki = a * b
sekito = seki % 2
if sekito == 1:
  response = 'Odd'
else :
  response = 'Even'
print(response)
import re
while True:
    try:
        s_origin=input()
        for X in range(10):
            s=s_origin.replace("X",str(X))
            s=s.split("=")
            s[0]=re.sub("^0+","",s[0])
            s[1]=re.sub("^0+","",s[1])
            if eval(s[0])==int(s[1]):
                print(X)
                break
        else:
            print("NA")
    except EOFError:
        break



### FIXED CODE ###

import sys

while True:
    try:
        s=input()
        ans=s.split("=")[1]
        a,b=s.split("=")[0].split("+")
        for X in range(10):
            _a=a.replace("X",str(X))
            if str(int(_a))!=_a:
                continue
            _b=b.replace("X",str(X))
            if str(int(_b))!=_b:
                continue
            _ans=ans.replace("X",str(X))
            if str(int(_ans))!=_ans:
                continue
            if int(_a)+int(_b)==int(_ans):
                print(X)
                break
        else:
            print("NA")

    except EOFError:
        sys.exit(0)
#どっちで出すか注意, rstrip注意
#提出前に見返すこと！
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate
    #from itertools import product
    from bisect import bisect_left,bisect_right
    import heapq
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    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()))
    i,j,k = 0,0,0
    p.sort(reverse=1)
    q.sort(reverse=1)
    r.sort(reverse=1)
    res = 0
    while k<c and i<X and j<Y:
        s = p[i]
        t = q[j]
        u = r[k]
        if s<t and s<u:
            res += t+u
            j += 1
            k += 1
        elif t<s and t<u:
            res += s+u
            i += 1
            k += 1
        else:
            res += s+t
            i += 1
            j += 1
    if i==X:
        l = q[j:] + r[k:]
        l.sort(reverse=1)
        res += sum(l[:X+Y-i-j-k])
    elif j==Y:
        l = p[i:] + r[k:]
        l.sort(reverse=1)
        res += sum(l[:X+Y-i-j-k])
    else:
        res = 0
        for i in range(X+Y-c):
            if i < X and X+Y-c-i<Y:
                res = max(res, p[:i]+q[:X+Y-c-i])
            else:
                continue
        res += sum(r)
    print(res)


if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate
    #from itertools import product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    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()))
    i,j,k = 0,0,0
    p.sort(reverse=1)
    q.sort(reverse=1)
    r.sort(reverse=1)
    res = 0
    #[値, 種類, インデックス]
    hq = [[-p[0], 0, 0], [-q[0], 1, 0], [-r[0], 2, 0]]
    heapify(hq)
    n = 0
    while X+Y>n:
        x,y,z = heappop(hq)
        res += -x
        n += 1
        if y==0 and z+1<X:
            heappush(hq, [-p[z+1], 0, z+1])
        if y==1 and z+1<Y:
            heappush(hq, [-q[z+1], 1, z+1])
        if y==2 and z+1<c:
            heappush(hq, [-r[z+1], 2, z+1])
    print(res)
        
if __name__ == '__main__':
    main()
N, M = map(int, input().split())
ab = []
cd = []
for _ in range(N):
    a, b = map(int, input().split())
    ab.append([a, b])
for _ in range(N):
    c, d = map(int, input().split())
    cd.append([c, d])

for a, b in ab:
    near = 10**32
    for i, n in enumerate(cd):
        tmp = abs(a-n[0])+abs(b-n[1])
        if near == tmp:
            continue
        near = min(near, tmp)
        if near == tmp:
            ans = i + 1
    print(ans)

### FIXED CODE ###

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

ab = []
cd = []
for _ in range(N):
    a, b = map(int, input().split())
    ab.append([a, b])
for _ in range(M):
    c, d = map(int, input().split())
    cd.append([c, d])

for a, b in ab:
    near = 10**32
    for i, n in enumerate(cd):
        tmp = abs(a-n[0])+abs(b-n[1])
        if near == tmp:
            continue
        near = min(near, tmp)
        if near == tmp:
            ans = i + 1
    print(ans)
A,B = map(int,input().split())
S = input()

if S.count("-") == 1:
    s1,s2 = S.split("-")
    if len(s1) == A:
        if len(s2) == B:
            print("Yes")
        else:
            print("No")
            sys.exit(0)
    elif len(s2) == A:
        if len(s1) == B:
            print("Yes")
        else:
            print("No")
            sys.exit(0)
    else:
        print("No")
        sys.exit(0)
else:
    print("No")


### FIXED CODE ###

import re
A,B = list(map(int,input().split()))
S = input()

d = re.compile("\d+")

if (d.match(S[:A])) and S[A] == "-" and d.match(S[A+1:]):
    print("Yes")

else:print("No")
def overlap(p1, p2, d):
    return (p1[0] - p2[0])**2 + (p1[1] - p2[1])**2 <= d

def intersection(o1,o2):
    a  = 2*(o2[0] - o1[0])
    b  = 2*(o2[1] - o1[1])
    c  = (o1[0] - o2[0])*(o1[0] + o2[0]) + (o1[1] - o2[1])*(o1[1] + o2[1])
    a2 = a**2 + b**2
    b2 = a*c + a*b*o1[1] - b**2*o1[0]
    c2 = b**2*(o1[0]**2 + o1[1]**2 - 1) + c**2 + 2*b*c*o1[1]
    x1 = (-b2 + math.sqrt(b2**2 - a2*c2))/a2
    x2 = (-b2 - math.sqrt(b2**2 - a2*c2))/a2
    if b == 0:
        y1 = (o1[1] + o2[1])/2
        y2 = (o1[1] + o2[1])/2
    else:
        y1 = -(a*x1 + c)/b
        y2 = -(a*x2 + c)/b
    if b2**2 - a2*c2 < 10e-6:
        return [x1, y1], [None, None]
    else:
        return [x1, y1], [x2, y2]

while True:
    n = int(input())
    if n == 0:
        break
    p = []
    for i in range(n):
        p.append(list(map(float, input().split(","))))
    ans = 0
    for i in range(n - 1):
        for j in range(i + 1, n):
            if not overlap(p[i], p[j], 4):
                continue
            p1, p2 = intersection(p[i], p[j])
            cnt1 = 0
            cnt2 = 0
            for k in range(n):
                if overlap(p1, p[k], 1):
                    cnt1 += 1
                if p2[0] != None and overlap(p2, p[k], 1):
                    cnt2 += 1
            ans = max([ans, cnt1, cnt2])
    print(ans)



### FIXED CODE ###

import math

def dist(p1, p2):
    return math.sqrt((p1[0] - p2[0])**2 + (p1[1] - p2[1])**2)

def intersection(o1,o2):
    if dist(o1,o2) > 2:
        p1, p2 =  [None, None], [None, None]
    elif dist(o1,o2) == 2:
        p1, p2 =  [(o1[0] + o2[0])/2, (o1[1] + o2[1])/2], [None, None]
    else:
        m = [(o1[0] + o2[0])/2, (o1[1] + o2[1])/2]
        v = [m[0] - o1[0], m[1] - o1[1]]
        v_abs = dist(v,[0,0])
        w = [v[1], -v[0]]
        w_abs = dist(w,[0,0])
        n = [w[0]/w_abs, w[1]/w_abs]
        l = math.sqrt(1 - v_abs**2)
        p1 = [m[0] + l*n[0], m[1] + l*n[1]]
        p2 = [m[0] - l*n[0], m[1] - l*n[1]]
    return p1, p2
err = 1.0e-6
while True:
    n = int(input())
    if n == 0:
        break
    p = []
    for i in range(n):
        p.append(list(map(float, input().split(","))))
    ans = 1
    for i in range(n - 1):
        for j in range(i + 1, n):
            p1, p2 = intersection(p[i], p[j])
            cnt1 = 0
            cnt2 = 0
            for k in range(n):
                if p1[0] and dist(p1, p[k]) <= 1 + err:
                    cnt1 += 1
                if p2[0] and dist(p2, p[k]) <= 1 + err:
                    cnt2 += 1
            ans = max([ans, cnt1, cnt2])
    print(ans)
from math import gcd
N=int(input())
A=list(map(int,input().split()))
left,right=[0],[0]
[(left.append(gcd(left[i],A[i])),right.append(gcd(right[i],A[N-i-1]))) for i in range(N-1)]
right.reverse()
max([gcd(a,b) for a,b in zip(left,right)])

### FIXED CODE ###

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

def gcd(x,y):
    if y > x:
        x,y = y,x
    if y == 0:
        return x
    if x%y == 0:
        return y
    else:
        return gcd(x%y,y)

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

print(max([gcd(L[i],R[N-i-1]) for i in range(N)]))
from bisect import bisect_left

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

k = 1
ans = 0
for _ in range(32):
    t = k * 2
    temp_b = sorted([x % t for x in b])
    check = 0
    for temp_a in a:
        x = temp_a % t
        check += bisect_left(temp_b, 2 * k - x) - bisect_left(temp_b, k - x) + bisect_left(temp_b, 4 * k - x) - bisect_left(temp_b, 3 * k - x)
    ans += k * (check % 2)
    k = t

print(ans)


### FIXED CODE ###

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

if a + b >= c:
    print('Yes')
else:
    print('No')
N,Z,W=map(int,input().split())
A=list(map(int,input().split()))
print(max(abs(A[-1]-W),abs(A[-2]-A[-1]))

### FIXED CODE ###

N,Z,W=map(int,input().split())
A=list(map(int,input().split()))
if N>=2:
    print(max(abs(A[-1]-W),abs(A[-2]-A[-1])))
elif N==1:
    print(abs(A[-1]-W))
# -*- coding: utf-8 -*-
def main():
    A,B = map(int(input().split()))
    ans = []
    ans.append(A+B)
    ans.append(A-B)
    ans.append(A*B)
    print(max(ans))

if __name__ == '__main__':
    main()

### FIXED CODE ###

# -*- coding: utf-8 -*-
def main():
    A,B = map(int,input().split())
    ans = []
    ans.append(A+B)
    ans.append(A-B)
    ans.append(A*B)
    print(max(ans))

if __name__ == '__main__':
    main()