Harryxun/stf_run huggingface dataset:
a, b, c = int(input().split())

if a == b:
  print(a)
elif a==c:
  print(a)
elif b==c:
  print(c)



### FIXED CODE ###

a, b, c = map(int, input().split())
 
if a == b:
    print(c)
elif a==c:
    print(b)
elif b==c:
    print(a)
N = int(input())
A = int(input())
B = int(input())

if N == 1:
    print('Hello Would')

if N == 2:
    print(A + B)

### FIXED CODE ###

N = int(input())

if N == 1:
    print('Hello World')

else:
     A = int(input())
     B = int(input())
     print(A + B)
r1,c1,r2,c2=map(int,input().split())

mod=10**9+7
f=[1]
for i in range(2*10**6+7):f+=[f[-1]*(i+1)%mod]
def comb(a,b):return f[a]*pow(f[b],mod-2,mod)*pow(f[a-b],mod-2,mod)%mod

def F(r,c):
  ans=0
  for i in range(r+c+1):
    ans+=pow(2,i,mod)
    ans%=mod'''
  d=0
  s=0
  for i in range(r-1,-1,-1):
    s+=comb((r-i-1)+c,c)
    d+=pow(2,i,mod)*s
    s%=mod
    d%=mod
  ans=(ans+(mod-d))%mod
  d=0
  s=0
  for i in range(c-1,-1,-1):
    s+=comb((c-i-1)+r,r)
    d+=pow(2,i,mod)*s
    s%=mod
    d%=mod
  ans=(ans+(mod-d))%mod'''
  return ans

ans=F(r2,c2)
ans=(ans+(mod-F(r2,c1-1)))%mod
ans=(ans+(mod-F(r1-1,c2)))%mod
ans+=F(r1-1,c1-1)
print(ans%mod)


### FIXED CODE ###


p = 10**9+7
kai_ = [1]
for i in range(1, 10 ** 7):
    kai_.append(kai_[-1] * i % p)


def kai(x):
    return kai_[x]


def comb(a, b):
    if a < 0 or b < 0:
        return 0
    elif a < b:
        return 0
    c = 1
    c *= kai(a)
    c *= pow(kai(b), p - 2, p)
    c *= pow(kai(a - b), p - 2, p)
    return c % p


r1, c1, r2, c2 = [int(i) for i in input().split()]


def s(r, c):
    return comb(r+c+2,r+1)


print((s(r2, c2) - s(r2, c1 - 1) - s(r1 - 1, c2) + s(r1 - 1, c1 - 1)) % p)
import heapq
a, b, c, d = map(int, input().split())
al = list(map(int, input().split()))
bl = list(map(int, input().split()))
cl = list(map(int, input().split()))
al = sorted(al, reverse=True)
bl = sorted(bl, reverse=True)
cl = sorted(cl, reverse=True)
q = []
heapq.heappush(q, [-(al[0] + bl[0] + cl[0]), 0, 0, 0])
ans = []
heapq.heappush(ans, [-(al[0] + bl[0] + cl[0]), 0, 0, 0])

while True:
#for i in range(d):
    s, aq, bq, cq = heapq.heappop(q)
    if len(al) > aq+1:
        if [-(al[aq+1] + bl[bq] + cl[cq]), aq+1, bq, cq] not in ans:
            heapq.heappush(q, [-(al[aq+1] + bl[bq] + cl[cq]), aq+1, bq, cq])
            heapq.heappush(ans, [-(al[aq+1] + bl[bq] + cl[cq]), aq+1, bq, cq])
            #q.append([al[aq+1] + bl[bq] + cl[cq], aq+1, bq, cq])
            #ans.append([al[aq+1] + bl[bq] + cl[cq], aq+1, bq, cq])

    if len(bl) > bq+1:
        if [-(al[aq] + bl[bq+1] + cl[cq]), aq, bq+1, cq] not in ans:
            heapq.heappush(q, [-(al[aq] + bl[bq+1] + cl[cq]), aq, bq+1, cq])
            heapq.heappush(ans, [-(al[aq] + bl[bq+1] + cl[cq]), aq, bq+1, cq])
            #q.append([al[aq] + bl[bq+1] + cl[cq], aq, bq+1, cq])
            #ans.append([al[aq] + bl[bq+1] + cl[cq], aq, bq+1, cq])

    if len(cl) > cq+1:
        if [-(al[aq] + bl[bq] + cl[cq+1]), aq, bq, cq+1] not in ans:
            heapq.heappush(q, [-(al[aq] + bl[bq] + cl[cq+1]), aq, bq, cq+1])
            heapq.heappush(ans, [-(al[aq] + bl[bq] + cl[cq+1]), aq, bq, cq+1])
            #q.append([al[aq] + bl[bq] + cl[cq+1], aq, bq, cq+1])
            #ans.append([al[aq] + bl[bq] + cl[cq+1], aq, bq, cq+1])

    #q = sorted(q)

    if len(ans) > d:
       ans = sorted(ans, reverse=True)
        if ans[d][0] > q[len(q)-1][0]:
            break

for i in range(d):
    print(-heapq.heappop(ans)[0])


### FIXED CODE ###

a, b, c, d = map(int, input().split())
al = list(map(int, input().split()))
bl = list(map(int, input().split()))
cl = list(map(int, input().split()))
al = sorted(al, reverse=True)
bl = sorted(bl, reverse=True)
cl = sorted(cl, reverse=True)
q = [[al[0] + bl[0] + cl[0], 0, 0, 0]]
ans = [[al[0] + bl[0] + cl[0], 0, 0, 0]]
#while True:
for i in range(d):
    s, aq, bq, cq = map(int, q.pop())
    if len(al) > aq+1:
        if [al[aq+1] + bl[bq] + cl[cq], aq+1, bq, cq] not in ans:
            q.append([al[aq+1] + bl[bq] + cl[cq], aq+1, bq, cq])
            ans.append([al[aq+1] + bl[bq] + cl[cq], aq+1, bq, cq])

    if len(bl) > bq+1:
        if [al[aq] + bl[bq+1] + cl[cq], aq, bq+1, cq] not in ans:
            q.append([al[aq] + bl[bq+1] + cl[cq], aq, bq+1, cq])
            ans.append([al[aq] + bl[bq+1] + cl[cq], aq, bq+1, cq])

    if len(cl) > cq+1:
        if [al[aq] + bl[bq] + cl[cq+1], aq, bq, cq+1] not in ans:
            q.append([al[aq] + bl[bq] + cl[cq+1], aq, bq, cq+1])
            ans.append([al[aq] + bl[bq] + cl[cq+1], aq, bq, cq+1])

    q = sorted(q)

    #if len(ans) > d:
    #   ans = sorted(ans, reverse=True)
    #    if ans[d][0] > q[len(q)-1][0]:
    #        break

ans = sorted(ans, reverse=True)
for i in range(d):
    print(ans[i][0])
a, = list(map(int,input().split()))
a.sort(reverse=True)
print(10*a[0] + a[1] +a[2])


### FIXED CODE ###

a = list(map(int,input().split()))
a.sort(reverse=True)
print(a[0]*10 + a[1] + a[2])
from itertools import accumulate, count, islice, takewhile
 
def eratosthenes():
    d = {}
    for q in count(2):
        p = d.pop(q, None)
        if p:
            x = next(x for x in count(q + p, p) if x not in d)
            d[x] = p
        else:
            yield q
            d[q*q] = q

def likes():
    xs = set()
    for p in eratosthenes():
        if p in xs:
            yield p
        xs.add(2*p - 1)

likeset = set(takewhile(lambda n: n <= 100000, likes()))
onehot = (i in likeset for i in range(100000))
likecounts = list(accumulate(onehot))

q = int(input())
lrs = [[int(x) for x in input().split()] for _ in range(q)]

for l, r in lrs:
    print(likecounts[r+1] - likecounts[l-1]) 

### FIXED CODE ###

from itertools import accumulate, count, islice, takewhile
 
def eratosthenes():
    d = {}
    for q in count(2):
        p = d.pop(q, None)
        if p:
            x = next(x for x in count(q + p, p) if x not in d)
            d[x] = p
        else:
            yield q
            d[q*q] = q

def likes():
    xs = set()
    for p in eratosthenes():
        if p in xs:
            yield p
        xs.add(2*p - 1)

likeset = set(takewhile(lambda n: n <= 100000, likes()))
onehot = (i in likeset for i in range(100001))
likecounts = list(accumulate(onehot))

q = int(input())
lrs = [[int(x) for x in input().split()] for _ in range(q)]

for l, r in lrs:
    print(likecounts[r+1] - likecounts[l-1])
def resolve():
    # 整数 1 つ
    # n = int(input())
    # 整数複数個
    n, y = map(int, input().split())
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    flag = False
    for i in range(n):
        for j in range(n-i):
            if (10000 * i) + (5000 * j) + (1000 * (n-i-j)) == y:
                print(i, j, (n-i-j))
                flag = True
                break
        if flag == True:
            break

    if flag == False
        print("-1 -1 -1")
resolve()

### FIXED CODE ###

def resolve():
    # 整数 1 つ
    # n = int(input())
    # 整数複数個
    n, y = map(int, input().split())
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    flag = False
    for i in range(n+1):
        for j in range(n-i+1):
            if (10000 * i) + (5000 * j) + (1000 * (n-i-j)) == y:
                print(i, j, (n-i-j))
                flag = True
                break
        if flag == True:
            break

    if flag == False:
        print("-1 -1 -1")
resolve()
#N = int(input())
N, M =  map(int,input().split())
#W =list(map(int,input().split()))
a = [(int(input())) for i in range(M)]

memo  =[-1]*(N+1)
def stair_count(n):
    if memo[n]!= -1:
        return memo[n]
    if n==0 or n==1:
        memo[n] =1
        return memo[n]
    memo[n] = stair_count(n-1) + stair_count(n-2)
    return memo[n]

start = 0
answer = 1
for i in a:
        if i == start:
            print(0)
            exit()
        else:
            n = i-1-start
            answer = (answer * stair_count(n))
            start = i+1
n = N -start
answer = (answer * stair_count(n))
print(answer%1000000007)


### FIXED CODE ###

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

import sys

sys.setrecursionlimit(100000)
memo  =[-1]*(N+2)
def stair_count(n):
    if memo[n]!= -1:
        return memo[n]
    if n==0 or n==1:
        memo[n] =1
        return memo[n]
    memo[n] = stair_count(n-1) + stair_count(n-2)
    return memo[n]

start = 0
answer = 1
for i in a:
        if i == start:
            print(0)
            exit()
        else:
            n = i-1-start
            answer = (answer * stair_count(n))
            start = i+1
n = N -start
answer = (answer * stair_count(n))
print(answer%1000000007)
From0 = ['0','1']*(10**5)
From1 = ['1','0']*(10**5)
s = list(input())
F0 = From0[::len(s)]
F1 = From1[::len(s)]
count_0 = 0
count_1 = 0
for i in range(len(s)):
  if s[i] != F0[i]:
    count_0 += 1
for i in range(len(s)):
  if s[i] != F1[i]:
    count_1 += 1
print(min(count_0,count_1))

### FIXED CODE ###

From0 = ['0','1']*(10**6)
From1 = ['1','0']*(10**6)
s = list(input())
F0 = From0[:len(s)]
F1 = From1[:len(s)]
count_0 = 0
count_1 = 0
for i in range(len(s)):
  if s[i] != F0[i]:
    count_0 += 1
for i in range(len(s)):
  if s[i] != F1[i]:
    count_1 += 1
print(min(count_0,count_1))
import sys
from collections import deque
from copy import copy

N,K = list(map(int, input().split()))
V = deque(list(map(int, input().split())))

max_value = 0

def calc_max_value(V, k, l, r):
    store = []
    for i in range(l):
        if len(V)>0:
            store.append(V.popleft())
            continue
        else:
            break
    for i in range(r):
        if len(V)>0:
            store.append(V.pop())
            continue
        else:
            break
    store.sort()
    store = deque(store)
    max_value = sum(store)
    for i in range(k-l-r):
        if len(store)>0:
            e = store.popleft()
            if e < 0:
                max_value -= e
            else:
                break
        else:
            break
    return max_value

    
for k in range(K+1):
    for l in range(K+1):
        for r in range(K+1-l):
            max_value = max(max_value, calc_max_value(V.copy(), k, l, r))

print(max_value)


### FIXED CODE ###

import sys
from collections import deque
from copy import copy

N,K = list(map(int, input().split()))
V = deque(list(map(int, input().split())))

max_value = 0

def calc_max_value(V, K, k, l, r):
    store = deque([])
    for i in range(l):
        if len(V)>0:
            store.append(V.popleft())
            continue
        else:
            break
    for i in range(r):
        if len(V)>0:
            store.append(V.pop())
            continue
        else:
            break
    store = deque(sorted(store))
    for i in range(K-l-r):
        if len(store)>0:
            e = store.popleft()
            if e < 0:
                continue
            else:
                store.appendleft(e)
                break
        else:
            break
    max_value = sum(store)
    return max_value

    
for k in range(min(K+1,N+1)):
    for l in range(k+1):
        for r in range(k+1-l):
            max_value = max(max_value, calc_max_value(copy(V), K, k, l, r))

print(max_value)
S = list(input())
lon = len(S)
count = 0
num = S.count("?")

if S == "?":
  print("D")
if S == "P?":
  print("PD")
if S == "D?":
  print("DD")
if S == "?D":
  print("PD")
if S == "?P":
  print("DP")

#print(S)

if S[0] == "?":
  if S[1] == "D":
    S[0] = "P"
  else:
    S[0] = "D"
    
if S[-1] == "?":
  if S[-2] == "P":
    S[-1] = "D"
  else:
    S[-1] = "D"
    
    
for i in range(1, lon-1):
  if S[i] == "?":
    if S[i-1] == "P":
      S[i] = "D"
    elif S[i-1] == "D":
      S[i] = "P"

    
T = "".join(S)
#print(T.count("D") + T.count("PD") )
print(T)

### FIXED CODE ###

S = list(input())
lon = len(S)
for i in range(lon):
  if S[i] == "?":
    S[i] = "D"
 
    

T = "".join(S)
#print(T.count("D") + T.count("PD") )
print(T)
N = int(input())
abc = [list(map(int, input().split())) for _ in range(3)]

dp = [[0] * 3 for _ in range(N+1)]

for i in range(1, N+1):
    for j in range(3):
        for k in range(3):
            if j != k:
                dp[i][j] = max(dp[i][j], dp[i-1][k] + abc[i-1][k])

print(max(dp[N]))

### FIXED CODE ###

N = int(input())
abc = [list(map(int, input().split())) for _ in range(N)]

dp = [[0] * 3 for _ in range(N+1)]

for i in range(1, N+1):
    for j in range(3):
        for k in range(3):
            if j != k:
                dp[i][j] = max(dp[i][j], dp[i-1][k] + abc[i-1][k])

print(max(dp[N]))
a=int(input())
b=int(input())
c=int(input())
if a+b+c>22:
  print('bust')
else:
  print('win')

### FIXED CODE ###

a,b,c = map(int,input().split())
if a+b+c>=22:
  print('bust')
else:
  print('win')
def combi(y,x,p=998244353):
  s=fac[y]
  t=fac[x]
  u=fac[y-x]
  ans= (s* pow(t,p-2,p)*pow(u,p-2,p))%p
  return ans

###############################

N,M,K=map(int,input().split())
p=998244353
fac=[1,1]
for i in range(2,N+1):
  fac.append( (fac[-1]*i)%p )
R = M*(M-1)**(N-K-2)

ans=0
for i in range(K,-1,-1):
  R = (R*(M-1))%p
  L = combi(N,i)
  ans = (ans + (R*L)%p)%p
print(ans)

### FIXED CODE ###

def combi(y,x,p=998244353):
  s=fac[y]
  t=fac[x]
  u=fac[y-x]
  ans= (s* pow(t,p-2,p)*pow(u,p-2,p))%p
  return ans

###############################

N,M,K=map(int,input().split())
p=998244353
fac=[1,1]
for i in range(2,N+1):
  fac.append( (fac[-1]*i)%p )


ans=0
for i in range(0,K+1):
  R = ( (M%p) *pow(M-1,N-1-i,p) )%p
  L = combi(N-1,i)
  ans = (ans + (R*L)%p)%p
  
print(ans)
from heapq import heappush, heappop N = int(input()) vLst = list(map(int, input().split())) v = [] for i in range(N): heappush(v, vLst[i]) ans = 0 for i in range(N - 1): tmp1 = heappop(v) tmp2 = heappop(v) ans = float((tmp1 + tmp2) / 2) heappush(v, ans) print(v[0])


### FIXED CODE ###

from heapq import heappush, heappop

N = int(input())
vLst = list(map(int, input().split()))
v = []
for i in range(N):
    heappush(v, vLst[i])

ans = 0
for i in range(N - 1):
    tmp1 = heappop(v)
    tmp2 = heappop(v)
    ans = float((tmp1 + tmp2) / 2)
    heappush(v, ans)

print(v[0])
# encoding: utf-8
N = int(input())
xyh = [list(map(int, input().split())) for i in range(N)]

ans = None
for cx in range(101):
    for cy in range(101):
        H_tmp = 0
        for xi, yi, hi in xyh:
            dx = xi - cx if xi >= cx else cx - xi
            dy = yi - cy if yi >= cy else cy - yi
            if H_tmp == 0 or H_tmp == hi + dx + dy: H_tmp = hi + dx + dy
            else: break
        else:
            ans = (cx, cy, H_tmp)
        if ans != None: break
    if ans != None: break

print(ans[0], ans[1], ans[2])


### FIXED CODE ###

# encoding: utf-8
N = int(input())
xyh = [list(map(int, input().split())) for i in range(N)]

ans = None
for cx in range(101):
    for cy in range(101):
        H_tmp = -1
        # print("#", cx, cy)
        for xi, yi, hi in sorted(xyh, key=lambda x: -x[2]):
            # print("##", (xi, yi, hi), H_tmp)
            dx = (xi - cx) if xi >= cx else (cx - xi)
            dy = (yi - cy) if yi >= cy else (cy - yi)
            if H_tmp == -1: H_tmp = hi + dx + dy
            elif hi == 0:
                if dx + dy < H_tmp: break
                else: continue
            elif H_tmp == hi + dx + dy: H_tmp = hi + dx + dy
            else: break
        else:
            ans = (cx, cy, H_tmp)
        if ans != None: break
    if ans != None: break

print(ans[0], ans[1], ans[2])
while True:
    n = int(raw_input())
    if n == 0:
        break
    a = map(int, raw_input().split())
    b = list(set(a))
    flag = 0
    for i in b:
        if a.count(i) > n/2.0:
            ans = i
            flag = 1
            break
    print ans if flag = 1 else "NO COLOR"

### FIXED CODE ###

while 1:
    n = input()
    if n == 0: break
    A = map(int,raw_input().split())
    A.sort()
    c,l = A[0],0
    for i in A:
        if i == c:
            l += 1
            if l > n/2:
                print c
                break
        else:
            c = i
            l = 1
    else:
        print "NO COLOR"
N = int(raw_input())
a = []
t = []
for i in range(1,N+1):
        for j in range(1,N+1):
                if i*j == N:
                        a.append(i)
                        a.append(j)
                        a.sort() 
                        if a in t:
                                break       
                        else:
                                t.append(a)
                        a = []
        else:
                continue
        break
ans = []
for i in range(0,len(t)):
        x = t[i][0]
        y = t[i][1]
        if x > y:
                ans.append(len(str(x)))
        else:
                ans.append(len(str(y)))
        
print min(ans)

### FIXED CODE ###

N = long(raw_input())
def dig(A,B):
        if A > B:
                return A
        else:
                return B
A = 0
B = 0 
X = []
i = long(1)
while N >= A*A:
        A = long(i)
        if N%i == 0:
                B = long(N/i)
                X.append(dig(A,B))
        if A in X:
                break
        i+=1
print len(str(min(X)))
import math
A,B=list(map(str,input().split()))
A=int(A)
B.replace('.','')
C=int(B)
D=A*C
if D<100:
    print(0)
    exit()
D=str(D)
print(D[0:-2])

### FIXED CODE ###

import decimal
import math
A,B=list(map(decimal.Decimal,input().split()))
C=decimal.Decimal(A*B)
print(math.floor(C))
from math import factorial

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

l = [None]*2010
l[0] = 1
for i in range(1, N+1):
    l[i] = l[i-1]*i

for i in range(1, K+1):
    a = l[N-K+1] // l[i] // l[(N-K+1)-i]
    b = l[K-1] // l[i-1] // l[(K-1)-(i-1)]
    print(a*b % (10**9+7))
    

### FIXED CODE ###

from math import factorial

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

l = [None]*2010
l[0] = 1
for i in range(1, 2010):
    l[i] = l[i-1]*i

for i in range(1, K+1):
    a = l[N-K+1] // l[i] // l[(N-K+1)-i]
    b = l[K-1] // l[i-1] // l[(K-1)-(i-1)]
    print(a*b % (10**9+7))
a, b = map(int, input().split())
n = min(a, b) // 2
t = list(range(2, n+1))
#for i in range(len(t)):
#    if t[i] == -1:
#        continue
#    if a % t[i] == 0 and b % t[i] == 0:
#        for j in range(i+1, len(t)):
#            if t[j] == -1:
#                continue
#            if t[j] % t[i] == 0:
#                print(t[j], t[i])
#                t[j] = -1
#    else:
#        t[i] = -1
print(1)

### FIXED CODE ###

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

def getPrimeFactors(x):
    ans = []
    for d in range(2, int(x**0.5)+1):
        while x%d == 0:
            ans.append(d)
            x //= d
    if x != 1:
        ans.append(x)
    return ans

res_a = getPrimeFactors(a)
res_b = getPrimeFactors(b)

res = len(set(res_a) & set(res_b))
print(res + 1)
n = int(input())
a = list(map(int,input().split()))


### FIXED CODE ###


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

if a <= 2*b:
    print(0)
else:
    print(a - 2*b)
n = input()
a = []
m = []

for i in range(int(n)):
    a.append(input())
for i in range(int(n)):
    c = 0
    for j in range(i+1, int(n), 1):
        if(a[i] >= a[j]):
            c += 1
        else:
            break
    m.append(c)

print(max(m))

### FIXED CODE ###

n = int(input())

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

x = 0
y = 0

for i in range(1, n):
    if(a[i] <= a[i-1]):
        y +=1
    else:
        x = max(x,y)
        y = 0

print(max(x,y))
S = input()
if s == 'ABC':
    print("ARC")
elif s == 'ARC':
    print('ABC')

### FIXED CODE ###

S = input()
if S == 'ABC':
    print("ARC")
elif S == 'ARC':
    print('ABC')
n = int(input())
l = list(map(int,input().split()))
l.append(10**9)
m = 'Yes'
for i in range(0,n-1)
  if l[n-i-1] <= l[n-i]:
    continue
  elif l[n-i-1] > l[n-i] + 1:
    m = 'No'
    break
  else:
    l[n-i-1] = l[n-i-1] - 1

print(m)


### FIXED CODE ###

n = int(input())
l = list(map(int,input().split()))
l.append(1000000000)
m = 'Yes'
for i in range(0,n-1):
  if l[n-i-1] <= l[n-i]:
    continue
  elif l[n-i-1] > l[n-i] + 1:
    m = 'No'
    break
  else:
    l[n-i-1] = l[n-i-1] - 1

print(m)
import heapq
n,m = map(int,input().split())
AB =[tuple(map(int,input().split())) for i in range(n)]
ans,memo=0,0
hq=[]
AB.sort(key=lambda tup:tup[0])
for day in range(m):
	for i in range(memo,n):
		if AB[i][0]<=(day+1):
			heapq.push(hq,AB[i][1])
			memo+=1
		else:
			break
	if len(hq):	
		ans += -heapq.heappop(hq)
print(ans)




### FIXED CODE ###

import heapq
n,m = map(int,input().split())
AB =[tuple(map(int,input().split())) for i in range(n)]
ans,memo=0,0
hq=[]
AB.sort(key=lambda tup:tup[0])
for day in range(m):
	for i in range(memo,n):
		if AB[i][0]<=(day+1):
			heapq.heappush(hq,-AB[i][1])
			memo+=1
		else:
			break
	if len(hq):	
		ans += -heapq.heappop(hq)
print(ans)
h,w=map(int,input().split())
ans=[]
import sys
def s(a,b):
    if a%3==1:
        s=a*b
        x=(a//3)*b
        y=((a-(a//3))//2)*b
        z=s-x-y

        e=(a-(a//3))*(b//2)
        d=s-x-e
        ma=max(x,y,z)
        mi=min(x,y,z)
        mc=max(x,e,d)
        mn=min(x,e,d)
        return(min((ma-mi),(mc-mn)))
    elif a%3==2:
        s=a*b
        x=((a//3)+1)*b
        y=((a-(a//3)-1)//2)*b
        z=s-x-y
        e=(a-(a//3)-1)*(b//2)
        d=s-x-e
        ma=max(x,y,z)
        mi=min(x,y,z)
        mc=max(x,e,d)
        mn=min(x,e,d)
        return(min((ma-mi),(mc-mn)))
j=min(h,w)
if (h%3==0)or(w%3==0):
    print(0)
elif j==1:
    print(1)
    sys.exit()
    
else:
    k=s(h,w)
    ans.append(k)
    r=s(w,h)
    ans.append(r)
    
# print(ans)
print(min(ans))
    


### FIXED CODE ###

x,y=map(int,input().split())
a=[1,3,5,7,8,10,12]
b=[4,6,9,11]
c=[2]
if ((x in a)and(y in a))\
    or((x in b)and(y in b))\
    or((x in c)and(y in c)):
    print('Yes')
else:
    print('No')
N,M = map(int,input().split())
A = sorted(list(map(int,input().split())))
BC = [list(map(int,input().split())) for _ in range(M)]
BC = sorted(BC, key=lambda x:x[1], reverse=True)
D = []
for b,c in BC:
    D += [c]*b
# print(D)

for i in range(N):
    if A[i] < D[i]:
        A[i] = D[i]
    else:
        break
# print(sorted(A))
print(sum(A))

### FIXED CODE ###

N,M = map(int,input().split())
A = sorted(list(map(int,input().split())))
BC = [list(map(int,input().split())) for _ in range(M)]
BC = sorted(BC, key=lambda x:x[1], reverse=True)
D = [0] * N
idx = 0
for b,c in BC:
    for i in range(b):
        D[idx] = c
        idx += 1
        if idx >= N:
            break
    if idx >= N:
        break
# print(D)


# print(D)
# print(sorted(A))
# print(len(D), len(A))
for i in range(N):
    if A[i] < D[i]:
        A[i] = D[i]
    else:
        break
print(sum(A))
x, a, b =map(int, input().split())
if b - a > x
  print('dangerous')
elif b - a == x:
  print('safe')
else:
  print('delicious')
  

### FIXED CODE ###

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

if a < b <= x + a:
  print('safe')
  
elif b <= a:
  print('delicious')

else:
  print('dangerous')
while True:
    n, x = map(int, input().split())
    if (n == x == 0):
    break

    count = 0
    for a in range(1, x // 3):
        for b in range(a + 1, x // 2):
            for c in range(b + 1, n + 1)
                Sum = a + b + c
                if (Sum == x):
                    count += 1 
    print(count)

### FIXED CODE ###

while True:
    n, x = map(int, input().split())
    if (n == x == 0):
        break

    count = 0
    for a in range(1, x // 3):
        for b in range(a + 1, x // 2):
            for c in range(b + 1, n + 1):
                Sum = a + b + c
                if (Sum == x):
                    count += 1 
    print(count)
#<B>
N = input()
ans = 0
for i in range(1, int(N + 1)):
    if len(str(i)) % 2 != 0:
        ans += 1

print(ans)

### FIXED CODE ###

N=int(input())
ans=0
for i in range(1,N+1):
    if len(str(i))%2==1:
        ans+=1
print(ans)
N = int(input())
a = list(map(int,input().split()))
ans = 1
for i in range(n):
  ans *= a[i]
  if(ans>10**18):
    ans = -1
    break
print(ans)

### FIXED CODE ###

N = int(input())
a = list(map(int,input().split()))
ans = 1
if(0 in a):
  ans = 0
else:
  for i in range(N):
    ans*=a[i]
    if(ans>10**18):
      ans = -1
      break
print(ans)