peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))

aa,bb=[0],[0]
for i in range(n):
  aa.append(aa[i]+a[i])
for i in range(m):
  bb.append(bb[i]+b[i])
ans,j=0,m
for i in range(n+1):
  if aa[i]>k:
    break
  while bb[j] > k-aa[i]:
    j -= 1
  ans=max(ans,i+j)
print(ans)
# Judge status: Wrong Answer
N = int(input())
List=list(map(int,input().split()))

cnt4 = 0
for i in range(N):
  a = List[i]
  if a%4 == 0:
    cnt4 += 1

cnt2 = 0
for i in range(N):
  a = List[i]
  if a%2 == 0:
    cnt2 += 1
cnt2 = int(cnt2 - cnt4)

if cnt2 == 0:
  if cnt4 > N -cnt4:
    print("Yes")
  else:
    print("No")
else:
  if cnt4-1 > (N-cnt4) -cnt4:
    print("Yes")
  else:
    print("No")
# Judge status: Wrong Answer
S = input()
T = input()

ans = len(T)
for i in range(len(S)-len(T)):
  t = 0
  for j in range(len(T)):
    if S[i+j] != T[j]:
      t += 1
  ans = min(ans, t)
print (ans)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

cnt = 0
while 1:
    if all(a[i] % 2 == 0 for i in range(n)):
        for i in range(n):
            a[i] = a[i] // 2
            print(a)
        cnt += 1
    else:
        break
print(cnt)
# Judge status: Accepted
def main():
  #n = int(input())
  s = input()
  #s = input().split()
  #a,b = list(map(int,input().split()))
  #a = [input() for i in range(n)]
  #a = [int(input()) for i in range(n)]
  #a = [input().split() for i in range(n)]
  #a = [list(map(int,input().split())) for i in range(n)]
  ans = 0
  count = 0
  lis = []
  
  if s == "ABC":
    print("ARC")
  else:
    print("ABC")

if __name__ == '__main__':
  main()
# Judge status: Accepted
n, a, b = map(int, input().split())
s = input()
count = 0
fs = 0
for i in range(n):
    if s[i] == 'a' and count < a + b:
        print('Yes')
        count += 1
    elif s[i] == 'b' and count < a + b and fs < b:
        print('Yes')
        count += 1
        fs += 1
    else:
        print('No')
# Judge status: Wrong Answer
num = input()

ls = [0] * 3
for i in range(2 ** 3):
    make7 = int(num[0])
    for j in range(3):
        if (i >> j) & 1:
            make7 += int(num[j+1])
            ls[j] = "+"
        else:
            make7 -= int(num[j+1])
            ls[j] = "-"
    if make7 == 7:
        print(num[0] + ls[0] + num[1] + ls[1] + num[2] + ls[2] + num[3])
        exit()
# Judge status: Accepted
N = int(input())
s= []
for i in range(N):
  s.append(input())

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

import collections
c_s = collections.Counter(s)
c_t = collections.Counter(t)

ans = 0
for k,v in c_s.items():
  ans = max((c_s[k]-c_t[k]),ans)

print(ans)
# Judge status: Wrong Answer
n = int(input())

ans = 0
for i in range(n):
  if i%3!=0 and i%5!=0:
    ans += i

print(ans)
# Judge status: Accepted
N,M=map(int,input().split())
ans=(M+N)*(M+N-1)/2-(M*N)
print(int(ans))
# Judge status: Wrong Answer
n,x,t = map(int,input().split())
if n % x == 0:
  print(n / x * t)
else:
  print(n / x * t + t)
# Judge status: Accepted
N = int(input())
A = []
B = []

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

A = A[::-1]
B = B[::-1]

count = 0
for i in range(N):
    if (A[i] + count) % B[i] != 0:
        count += (B[i] - (A[i] + count) % B[i])

print(count)
# Judge status: Accepted
import sys

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

H = [int(x) for x in sys.stdin.readlines()]

H.sort()

ans = 10 ** 10
for i in range(K - 1, N):
    left = H[i - (K - 1)]
    right = H[i]
    ans = min(ans, right - left)

print(ans)
# Judge status: Accepted
n = int(input())
ans = 1
while ans**2 <= n:
    if ans**2 <= n: ans += 1
print((ans-1)**2)
# Judge status: Accepted
a, b, c, d = map(int, input().split())

if (abs(a - b) <= d and abs(b - c) <= d) or abs(a - c) <= d:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n=int(input())

def go(s):
   global n
   if len(s)==n:
       print(s)
       return
   l=max(s)
   for i in range(ord('a'),ord(l)+1):
       go(s+chr(i))
   if l < 'z':
       go(s + chr(ord(l) + 1))

go("a")
# Judge status: Accepted
a=sum(map(int,input().split()))
print(a if a<=23 else a-24)
# Judge status: Accepted
n,l = map(int, input().split())
s = [input() for _ in range(n)]
s.sort()
print("".join(s))
# Judge status: Wrong Answer
def solve():
    n, m = map(int, input().split())
    if m==1:
        print(1,2)
        return
    if n % 2 == 1:
        for i in range(m):
            print(i+1, 2*m-i)
    else:
        for i in range(m):
            print(i+1, 2*m+1-i)


if __name__ == '__main__':
    solve()
# Judge status: Accepted
MAX = 10**5
N = int(input())
A = list(map(int, input().split()))

numlist = [0] * (MAX+1)
for i in range(N):
  numlist[A[i]] += 1
sumA = sum(A)
  
Q = int(input())
for i in range(Q):
  b, c = map(int, input().split())
  bcount = numlist[b]
  numlist[b] = 0
  numlist[c] += bcount
  sumA = sumA - bcount*b + bcount*c
  print(sumA)
# Judge status: Accepted
n,c,k=map(int,input().split())
data=[]
for i in range(n):
    data.append(int(input()))
data.sort()
i=0
count=0
while i <= n-1:
    j=i
    bus_join=0
    while bus_join < c and j <= n-1 and data[j]-data[i] <= k:
        j += 1
        bus_join += 1
    i=j
    count += 1
print(count)
# Judge status: Accepted
a,b,c = map(int, input().split())
m = max(a, max(b, c))
if (a+b+c)%2 != (3*m)%2:
    m += 1
print((3*m-(a+b+c))//2)
# Judge status: Accepted
import sys
input=sys.stdin.readline

def main():
    H, N = map(int, input().split())
    AB = [tuple(map(int, input().split()))for _ in range(N)]
    DP = [10**10] * (H+1)
    DP[H] = 0
    for h in range(H, 0, -1):
        for a, b in AB:
            x = max(0, h - a)
            DP[x] = min(DP[x], DP[h] + b)
    print(DP[0])

if __name__ == "__main__":
    main()
# Judge status: Accepted
n = int(input())
s = input()
t = input()
ans = 0
for i in range(n):
    dum1 = s[n-i-1:n]
    dum2 = t[0:i+1]
    if dum1 == dum2:
        ans = n*2-((i+1))
if ans == 0:
    ans = n*2
print(ans)
# Judge status: Accepted
N = int(input())
AB = [list(map(int, input().split())) for _ in range(N)]
A = sorted([ab[0]*(2-N%2) for ab in AB])
B = sorted([ab[1]*(2-N%2) for ab in AB])
if N%2 == 1:
  print(B[N//2]-A[N//2]+1)
else:
  print((B[N//2]+B[N//2-1])//2-(A[N//2]+A[N//2-1])//2+1)
# Judge status: Accepted
N=int(input())
L=list(map(int,input().split()))
x=max(L)
sum=0
i=0
for i in range(N):
  sum+=L[i]
  i+=1
y=sum-x
if x<y:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
a = list(input())
b = list(input())
c = list(input())
p = a.pop()
print(p)
while 1:
    if p=='a':
        if len(a)==0:
            print('A')
            exit()
        p = a.pop()
    elif p=='b':
        if len(b)==0:
            print('B')
            exit()
        p = b.pop()
    else:
        if len(c)==0:
            print('C')
            exit()
        p = c.pop()
# Judge status: Wrong Answer
top=int(input())
bottom=int(input())
height=int(input())

num=top+bottom

ans=num*height/2

print(str(ans))
# Judge status: Wrong Answer
k,x = map(int, input().split())
num = []
for i in range(-1000000,1000000):
    num.append(i)
if x-k+1 <= -1000000:
    print(num[:k])
else:
    print(num[x-k+1000001:x+1000001])
# Judge status: Accepted
N = int(input())

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


# A_sum = sum(A)
A_sum = 0
for ai in A:
    A_sum ^= ai

for i in range(N):
    ai = A[i]
    print(A_sum ^ ai, end=" ")
print()
# Judge status: Accepted
N, C, K = map(int, input().split())
T = []
for i in range(N):
    t = int(input())
    T.append(t)
T.sort()

cnt = 0
tmp = 0
jousha = 0
for t in T:
    jousha += 1
    if jousha == 1:
        tmp = t

    if t - tmp > K:
        cnt += 1
        jousha = 1
        tmp = t
        continue

    if jousha == C:
        tmp = 0
        cnt += 1
        jousha = 0
        continue
if tmp != 0:
    cnt+=1
print(cnt)
# Judge status: Accepted
N = int(input())
X = list(map(int, input().split()))

Y = sorted(X)
m = Y[N//2 - 1]
M = Y[N//2]

for i in X:
  if i <= m:
    print(M)
  else:
    print(m)
# Judge status: Accepted
import math

N = int(input())

goal_x = 1
goal_y = N

for i in range(2, int(math.sqrt(N) + 1)):
    if N % i == 0:
        if goal_x + goal_y > i + int(N / i):
            goal_x = i
            goal_y = int(N / i)

print(goal_x + goal_y - 2)
# Judge status: Wrong Answer
n = int(input())

res = []
for i in range(n):
  city, value = input().split()
  value = int(value)
  res.append([city, value, i])
res_s = sorted(res, key = lambda x: (x[0], x[1]))
for i in range(n):
  res_s[i].append(i+1)
ans = sorted(res_s, key = lambda x: x[2])
for i in range(n):
  print(ans[i][3])
# Judge status: Accepted
from collections import deque

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

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

h.sort()
h = deque(h)
d = []
d = deque(d)

for _ in range(k):
	d.append(h.popleft())

ans = d[-1] - d[0]
for _ in range(n-k):
	d.popleft()
	d.append(h.popleft())
	num = d[-1] - d[0]
	if ans > num:
		ans = num
print(ans)
# Judge status: Accepted
def dice_in_line(k, p_list):
    max_line = [0 for i in range(k+1)]
    max_sum = 0
    sum_list = [0]
    for i in range(len(p_list)):
        sum_list.append(p_list[i]+sum_list[i])
    for i in range(len(p_list)-k+1):
        if max_sum < sum_list[i+k]-sum_list[i]:
            max_sum = sum_list[i+k]-sum_list[i]
        
    return (max_sum+k)/2.0

n, k = [int(i) for i in input().split()]
p_list = [int(p) for p in input().split()]

print(float(dice_in_line(k, p_list)))
# Judge status: Accepted
from fractions import gcd
A,B = map(int,input().split())
g = gcd(A,B)

from collections import Counter
def factorize(n):
    d = Counter()
    m = 2
    while m*m <= n:
        while n%m == 0:
            n //= m
            d[m] += 1
        m += 1
    if n > 1:
        d[n] += 1
    return d
f = factorize(g)
print(len(f) + 1)
# Judge status: Accepted
def ii(): return int(input())
def si(): return input()
def mi(): return map(int,input().split())
def li(): return list(mi())

import math 

for i in range(1):
    a,b,c=mi()
    if a==b!=c or b==c!=a or c==a!=b:
        print("Yes")
    else:
        print("No")
# Judge status: Wrong Answer
K,X = input().split(' ')

def main(K,X):
  if K * 500 >= X:
    print('Yes')
  else:
    print('No')
 
if __name__ == '__main__':
  main(K,X)
# Judge status: Wrong Answer
from sys import stdin
from sys import setrecursionlimit
setrecursionlimit(10 ** 7)

n = int(stdin.readline().rstrip())
s = [stdin.readline().rstrip() for _ in range(n)]
final = s[0]
for i in s:
    for j in final:
        if j not in i:
            final = final.replace(j,"")
final = list(final)
final.sort()

print("".join(final))
# Judge status: Accepted
# B
s = list(input())

count = 0
l = []
for i in range(len(s)):
    if s[i] == 'A':
        count += 1
        continue
    elif s[i] == 'C':
        count += 1
        continue
    elif s[i] == 'G':
        count += 1
        continue
    elif s[i] == 'T':
        count += 1
        continue
    else:
        l.append(count)
        count = 0
l.append(count)

print(max(l))
# Judge status: Accepted
n, k = map(int,input().split())
ab = [list(map(int,input().split())) for i in range(n)]

ab = sorted(ab)
cnt = 0
for a, b in ab:
    cnt += b
    if cnt >= k:
        print(a)
        exit()
# Judge status: Wrong Answer
n = int(input())
l = list(map(int,input().split()))
count1 = len([x for x in l if x%2 != 0])
count2 = len([x for x in l if x == 2])
count4 = len([x for x in l if x%4 == 0])

if count4 + 1 >= count1 :
    print ("Yes")
    exit ()

if count2 > 0:
    if count4 + 1 >= count1 + count2//2:
        print ("Yes")
        exit ()

print ("No")
# Judge status: Accepted
N,T = map(int,input().split())
ans = 1001

for n in range(N):
  c,t = map(int,input().split())
  if t<=T:
    ans = min(c,ans)
    
if ans==1001:
  print("TLE")
else:
  print(ans)
# Judge status: Wrong Answer
def main():
    S = int(input())
    x1, y1 = 10**9, 1
    if S < 10**9:
        x1 = 1
        x2 = 0
        y2 = S
    else:
        y2 = S//10**9
        x2 = S - x1*y2
    print(0, 0, x1, y1, x2, y2)


if __name__ == '__main__':
    main()
# Judge status: Accepted
n, k = map(int, input().split())

x = 1
while k**x <= n:
  x += 1
  
print(x)
# Judge status: Wrong Answer
n=int(input())
def mul(x,y):
    return x*y
def div(x):
    i=1
    d=0
    while i <= x:
        if x % i ==0:
            d += 1
        i += 1
    return d

d=[]
a=[i+1 for i in range(n)]
k = 1
while k <= n:
    j = k*div(k)
    d.append(j)
    k += 1

print(sum(list(map(mul,a,d))))
# Judge status: Wrong Answer
from math import sqrt
X = int(input())

for x in reversed(range(1, X+1)):
  t = sqrt(x)
  if t.is_integer():
    print(x)
    break
# Judge status: Wrong Answer
k=list(map(int,input().split()))
k.sort
print(k[2]+k[1])
# Judge status: Accepted
a,b,c = map(int,input().split())

if a+b >= c:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
import sys
input = lambda: sys.stdin.readline().rstrip()
 
q,h,s,d=map(int,input().split())
n=int(input())

a=min(d,s*2,h*4,q*8)
b=min(s,h*2,q*4)
c=min(h,q*2)
ans=0
ans+=(n//2)*a
n-=2*(n//2)
ans+=(n//1)*b
n-=(n//1)
ans+=(n*2)*c
n-=0.5*(n//0.5)
ans+=0.25*(n//0.25)*q
print(int(ans))
# Judge status: Accepted
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

n,c,k = map(int, input().split())
t = list(int(input()) for i in range(n))
t.sort()
ans =0

from collections import deque
queue = deque()

INF = float('inf')
t.append(INF)

for i in range(n):

    queue.append(t[i])
    limit = queue[0]+k

    if limit < t[i+1] or len(queue)>=c:
        for i in range(min(len(queue), c)):
            queue.popleft()
        ans += 1

while queue:
    for i in range(min(len(queue), c)):
        queue.popleft()
    ans += 1

print(ans)
# Judge status: Accepted
s = input()
if s[0] == s[1] and s[2] == s[3] and s[0] != s[2]:
  print("Yes")
elif s[0] == s[2] and s[1] == s[3] and s[0] != s[3]:
  print("Yes")
elif s[0] == s[3] and s[1] == s[2] and s[0] != s[1]:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
def main():
    a, b = map(int, input().split())
    cnt = 0
    for i in range(1, 13):
        if i <= a and i <= b:
            cnt += 1
    print(cnt)
if __name__ == "__main__":
    main()
# Judge status: Accepted
a,b,k=map(int,input().split())
list=[]
if k>b-a+1:
    k=b-a+1
for i in range(k):
    print(a+i)
    list.append(a+i)
for i in range(k):
    if not b-k+i+1 in list:
        print(b-k+i+1)
# Judge status: Wrong Answer
n = int(input())
s = input()
cnt = 0

a = set(s[:(n//2)])

for i in a:
    if(s.rfind(i) >= (n//2)-2):
        cnt += 1
print(cnt)
# Judge status: Accepted
n = int(input())
s = input()

cnt = 0
m = 0

for i in range(len(s)):
    if s[i] == 'I':
        cnt += 1
        m = max(m, cnt)
    if s[i] == 'D':
        cnt -= 1
        m = max(m, cnt)
print(m)
# Judge status: Accepted
s=input()
if(s.isupper()== True):
    print("A")
else:
    print("a")
# Judge status: Wrong Answer
n,m = map(int, input().split())
a = list(map(int, input().split()))
syukudai = 0

for i in range(m):
    syukudai += a[i]
    if syukudai < 0:
        print(-1)
        break
else:
    print(n-syukudai)
# Judge status: Accepted
N, K = map(int, input().split())
A = list(map(int, input().split()))
import math
if N == K:
  ans = 1
else:
  ans = math.ceil((N-1) / (K-1))
print(ans)
# Judge status: Wrong Answer
n, m = map(int, input().split())

n = (n + 3) if n < 2 else n
m = (m + 3) if m < 2 else m
print((n - 2) * (m - 2))
# Judge status: Wrong Answer
s=input()
t=input()
u=[]
v=[]
s_len=len(s)
for i in range(s_len):
    s_i=s[i]
    t_i=t[i]
    ts=t_i+s_i
    if s_i!=t_i:
        if ts not in u:
            u.append(ts)
    elif s_i not in v:
        v.append(s_i)
ans="Yes"
u_len=len(u)
for i in range(u_len):
    if u[i][0] in v or u[i][1] in v:
        ans="No"
        break
print(ans)
# Judge status: Accepted
import sys
 
stdin = sys.stdin

mod = 1000000007
inf = 1 << 60
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()
nas = lambda: stdin.readline().split()

n, k = na()
x = na()

ans = inf
for i in range(n):
    if i + k - 1 < n:
        l, r = x[i], x[i + k - 1]
        ans = min(ans, min(abs(l) + abs(r - l), abs(r) + abs(r - l)))

print(ans)
# Judge status: Accepted
L, R, d = list(map(int, input().split()))

cnt = 0
for i in range(L, R+1):
    if i % d == 0:
        cnt += 1

print(cnt)
# Judge status: Accepted
n = int(input())
s = input()
l = []
for i in range(1, n):
    cnt = 0
    for j in set(s[:i]):
        if j in list(s[i:]):
            cnt += 1
    l.append(cnt)
print(max(l))
# Judge status: Wrong Answer
a, b = map(int, input().split())
s = input()

if len(s) == a+b+1 and s[a] == '-':
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
a, b, c, d = map(int, input().split())

print(min(b, d) - max(a, c))
# Judge status: Accepted
a = list(map(int,input().split()))
a = sorted(a)
if a[0]%2 == 0 or a[1]%2 == 0 or a[2]%2 == 0:
    print(0)
else:
    print(a[0]*a[1])
# Judge status: Wrong Answer
a = input()
b = input()
print({1,2,3}.difference({a,b}).pop())
# Judge status: Accepted
def main():
    x, y, z = map(int, input().split())
    x -= y + z * 2
    ans = 0
    if x < 0:
        return ans
    while x >= 0:
        ans += 1
        x -= y + z
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
a=list(input())
for i in range(4):
  a[i]=int(a[i])
x=sum(a)-7
dict={0:'+',1:'-'}
ans=0
for i in range(2):
  for j in range(2):
    for k in range(2):
        if x==(i*a[1]+j*a[2]+k*a[3])*2:
          print(a[0],dict[i],a[1],dict[j],a[2],dict[k],a[3],'=7',sep='')
          ans=1
        if ans==1:
          break
    if ans==1:
      break
  if ans==1:
    break
# Judge status: Accepted
A, B, K = map(int, input().split())

ans = set()
for i in range(A, min(B + 1, A + K)):
    ans.add(i)

for i in range(max(A, B - K + 1), B + 1):
    ans.add(i)
ans = sorted(list(ans))
for i in ans:
    print(i)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
ans = float('inf')

for i, a in enumerate(A):
  cost = 0
  for j, aj in enumerate(A):
    cost += (aj - a)**2
  ans = min(ans, cost)

print(ans)
# Judge status: Wrong Answer
n = int(input())
sq = 0
for i in range(n):
    if n == 1:
        print(1)
        break
    sq = i**2
    if sq > n:
        print((i - 1)**2)
        break
    else:
        pass
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

if e - a <= k:
    print('Yay!')
else:
    print(':(')
# Judge status: Wrong Answer
a,b=input().split()
a=int(a)
b=int(b)
if a<=8:
  if b<=8:
    print("Yay!")
else:
  print(":(")
# Judge status: Accepted
n=int(input())


a=0
for i in range(0,n):
    for j in range(0,n):
        if 4*i+7*j==n:
            a+=1


if a==0:
    print("No")
else:
    print("Yes")
# Judge status: Accepted

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

if a >= b:
    print("delicious")
elif a + x >= b:
    print("safe")
else:
    print("dangerous")
# Judge status: Accepted
n = int(input())
ls = list(map(int,input().split()))
di = [100]*(n+1)
di[0] = 0
for i in range(n):
    N = n - i
    num = int(n/N)
    fi = []
    for j in range(num):
        fi.append(N*(j+1))
    p = 0
    for k in fi:
        p += di[k]
    if (p - 100)%2 == ls[fi[0]-1]:
        di[fi[0]] = 0
    else:
        di[fi[0]] = 1
print(sum(di))
for e in range(1,len(di)):
    if di[e] == 1:
        print(e,end=" ")
# Judge status: Accepted
n,k = map(int, input().split())
x = list(map(int, input().split()))
ans = float("inf")
for i in range(0,n-k+1):
    if (x[i]<=0 and x[i+k-1]<=0):
        ans = min(ans, -x[i])
    elif (x[i]>=0 and x[i+k-1]>=0):
        ans = min(ans, x[i+k-1])
    else:
        ans = min (ans, x[i+k-1]-x[i]+(min(abs(x[i+k-1]),abs(x[i]))))
print(ans)
# Judge status: Accepted
a,b,c,d=map(int,input().split())
if a>=c:
    a,c=c,a
    b,d=d,b
if d<=b:
    print(d-c)
else:
    print(max(0,b-c))
# Judge status: Accepted
N = int(input())
a = list(map(int, input().split()))
a.sort()
s = 0
for i in range(1, N + 1):
  if i % 2 == 1:
    s += a[-i]
  else:
    s -= a[-i]
print(s)
# Judge status: Accepted
d, n = [int(w) for w in input().split()]

if n == 100:
    n = 101
print(100**d*n)
# Judge status: Wrong Answer
x,y=map(int,input().split())
print(x*y-1 if x!=y else -1)
# Judge status: Accepted
A,B,C,K=map(int,input().split())
l=[A,B,C]
#l.sort(reverse=True)
if K%2==0:
    if abs(A-B)>10**18:
        print("Unfair")
    else:
        print(A-B)
else:
    if abs(B-A)>10**18:
        print("Unfair")
    else:
        print(B-A)
# Judge status: Wrong Answer
a, b = map(int, raw_input() .split())
x = ''
for i in range(a):
  x += str(b)
print x
# Judge status: Accepted
Score = int(input())

Numero = 0

for i in range (1, 10000000):
	if i*(i+1)/2 >= Score:
		Numero = i
		break

K = Numero

P = []

for i in range (0, K):
	if Score >= (K-i):
		P.append(K-i)
		Score = Score - (K-i)

P = reversed(P)

print(*P, sep = "\n")
# Judge status: Wrong Answer
r, g, b = map(int, input().split())

if (g % 2 == 0) and (b % 2 == 0):
    print('YES')
else:
    print('NO')
# Judge status: Accepted
# 初期入力
a,b,X = map(int, input().split())

#
suito_taiseki = a*a*b #水筒の体積
h_wate = X/a/a #水面の高さ

from math import atan,degrees
if suito_taiseki/2 <=X:
    y = (b-h_wate)*2
    kakudo =degrees( atan(y/a) )
else:
    y =2*X/b/a
    kakudo =90-degrees(atan(y/b))


print(kakudo)
# Judge status: Wrong Answer
n,m = map(int,input().split())
a = [int(c) for c in input().split()]
a.sort()
def putmid():
	right = n
	left = 0
	mid = 0
	while right - left > 1:
		mid = (right + left) // 2
		if a[mid] <= a[-1]:
			left = mid
		else:
			right = mid
	a.insert(mid,a[-1])
	a.pop(-1)

for i in range(m):
	a[-1] = a[-1]//2
	putmid()
	
print(sum(a))
# Judge status: Accepted
'''
Created on 2020/08/20

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  A,B,C=map(int,pin().split())
  if (A<C and C<B) or (B<C and C<A):
    print("Yes")
    return 
  print("No")
  return 

main()
# Judge status: Accepted
import sys
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
X,Y = LI()
ans = 1
while 1:
    X *= 2
    if X>Y:
        break
    ans += 1
print(ans)
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
"""
Created on Sun Jun  7 14:28:00 2020

@author: NEC-PCuser
"""

N, M = map(int, input().split())
x, y = [], []

for i in range(M):
    x_tmp, y_tmp = map(int, input().split())
    x.append(x_tmp)
    y.append(y_tmp)
    
ball_set = set()
ball_set.add(1)
start_flg = True
for i in range(len(x)):
    if x[i] in ball_set:
        if start_flg == True:
            ball_set.discard(1)
        ball_set.add(y[i])
        

print(len(ball_set))
# Judge status: Accepted
H = int(input())
W = int(input())
N = int(input())
ans = 0
painted_mas = 0


def min_raw():
    if H > W:
        return W
    elif W >= H:
        return H


def max_raw():
    if H > W:
        return H
    elif W >= H:
        return W


for i in range(min_raw()):
    ans += 1
    painted_mas += max_raw()
    if N <= painted_mas:
        print(ans)
        break
# Judge status: Accepted
# -*- coding: utf-8 -*-

X = int(input())

num = X // 100
if num*100 <= X and X<=num*105:
    print("1")
else:
    print("0")
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
A.sort(reverse=True)
i = 1
ans = A[0]
N -= 2
while N>0:
    if N>1:
        ans += 2*A[i]
        N -= 2
        i += 1
    else:
        ans += A[i]
        break
print(ans)
# Judge status: Wrong Answer
N, K = map(int, input().split())
arr = list(map(int, input().split()))
index = arr.index(1)
left = -(-index//2)
right = -(-(N - (index + 1))//2)
print(left+right)
# Judge status: Wrong Answer
N=int(input())
if N%2==0:
  print((N/2)**2)
elif N%2!=0:
  print((N//2)*(N-(N//2)))
# Judge status: Accepted
q,h,s,d = map(int,input().split())
n = int(input())
s = min(q*4, h*2,s)
print(min(s*n, n//2*d + (n%2)*s))
# Judge status: Wrong Answer
a,b = map(int, input().split())

if a+b % 3 == 0:
    print("Possible")
else:
    print("Impossible")