Harryxun/stf_run huggingface dataset:
s = input()
count = 1
for i in s:
    if (count % 2 == 1) and ( i == 'L'):
        flag = False
        count += 1
    elif (count % 2 == 0) and (i == 'R'):
        flag = False
        count += 1
    else:
        count += 1
if flag:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

s = input()
flag = True
count = 1
for i in s:
    if (count % 2 == 1) and ( i == 'L'):
        flag = False
        count += 1
    elif (count % 2 == 0) and (i == 'R'):
        flag = False
        count += 1
    else:
        count += 1
if flag:
    print('Yes')
else:
    print('No')
print("Impossible" if int(input()[::2])%3 else "Possible")

### FIXED CODE ###

A,B=map(int,input().split())
print("Impossible" if (A+B)%3!=0 and A%3!=0 and B%3!=0 else "Possible")
a,b,c,x = map(int,input().strip())


count=0

for a_num in range(a+1):
  for b_num in range(b+1):
    for c_num in range(c+1):
      if a*500+b*100+c*50==x:
        count+=1

print(str(count))


### FIXED CODE ###

a,b,c,x = [int(input()) for _ in range (4)]


count=0

for a_num in range(a+1):
  for b_num in range(b+1):
    for c_num in range(c+1):
      if a_num*500+b_num*100+c_num*50==x:
        count+=1

print(str(count))
N=int(input())
A=list(map(int,input().split()))
gray=0
brown=0
green=0
light=0
blue=0
yellow=0
orange=0
red=0
god=0
for a in A:
  if 1<=a and a<=399 and gray==0:
    gray=1
  elif 400<=a and a<=799 and brown==0:
    brown=1
  elif 800<=a and a<=1199 and green==0:
    green=1
  elif 1200<=a and a<=1599 and light==0:
    light=1
  elif 1600<=a and a<=1999 and blue==0:
    blue=1
  elif 2000<=a and a<=2399 and yellow==0:
    yellow=1
  elif 2400<=a and a<=2799 and orange==0:
    orange=1
  elif 2800<=a and a<=3199 and red==0:
    red=1
  elif a>=3200:
    god+=1
mi=max(1,gray+brown+green+light+blue+yellow+orange+red)
ma=gray+brown+green+light+blue+yellow+orange+red+god
print(mi,ma)

### FIXED CODE ###

r,g,b=map(int,input().split())
num = 10*g+b
if num%4==0:print("YES")
else:print("NO")
n = int(raw_input())

d = [0 for i in range(n)]
f = [0 for i in range(n)]
a = [[0 for i in range(n)] for j in range(n)]
st = [0 for i in range(n)]
time = [0]
G = [0 for i in range(n)]

def dfs_visit(s):
    st[s] = 1
    time[0] += 1
    d[s] = time[0]
    
    for k in range(n):  
      if a[s][k] == 1 and st[k] == 0:
          dfs_visit(k)
    time[0] += 1
    f[s] = time[0]

def main():
    for s in range(n):
        if st[s] == 0:
            def_visit(s)
    for s in range(n):
        print(s+1,d[s],f[s]) 

for i in range(n):
  G = map(int, raw_input().split())
  for j in range(G[1]):
    a[G[0]-1][G[2+j]-1] = 1
   
main()


       

### FIXED CODE ###

n = int(raw_input())

d = [0 for i in range(n)]
f = [0 for i in range(n)]
a = [[0 for i in range(n)] for j in range(n)]
st = [0 for i in range(n)]
time = [0]
G = [0 for i in range(n)]


def dfs_visit(s):
    st[s] = 1
    time[0] += 1
    d[s] = time[0]
    
    for k in range(n):  
      if a[s][k] == 1 and st[k] == 0:
          dfs_visit(k)
    st[s] ==2
    time[0] += 1
    f[s] = time[0]

def main():
    for s in range(n):
        if st[s] == 0:
            dfs_visit(s)
    for s in range(n):
        print'{0} {1} {2}'.format(s+1, d[s], f[s])

for i in range(n):
    G = map(int, raw_input().split())
    for j in range(G[1]):
        a[G[0]-1][G[2+j]-1] = 1

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

S=[[]for i in range(10**1+1)]
for i in range(N):
    a,b=map(int,input().split())
    S[a].append(b)
S.sort(reverse=True)
#print(S)

k=0
o=0
E=[]
for i in range(len(S)):
    if S[i]==[]:
        break
    else:
        k+=1
        o+=S[i][0]
        E.append(S[i][0])
        del S[i][0]
E.sort()
#print(S)
S.sort(reverse=True)
A=[]
if k>K:
    for i in range(k-K):
        A.append(E[i])
    for i in range(k-K):
        del E[i]
        k-=1

for i in range(len(S)):
    if S[i]==[]:
        break
    else:
        for j in range(len(S[i])):
            A.append(S[i][j])
A.sort(reverse=True)
#print(A)
if K-k>0:
    for i in range(K-k):
        o+=A[i]
        #print(i)
    del A[:i+1]
    print(A)
    print(E)
for i in range(min(K,len(A))):
    if k*k+o<(k-1)**2+o-E[i]+A[i]:
        k=(k-1)
        o=o-E[i]+A[i]
    else:
        break
print(k*k+o)

### FIXED CODE ###

Num,K=map(int,input().split())
L=[[]for i in range(Num+1)]
for i in range(Num):
    t,d=map(int,input().split())
    L[t].append(d)
for i in range(1,Num+1):
    L[i].sort(reverse=True)

M=[]
m=[]
for i in range(1,Num+1):
    if len(L[i])>=1:
        M.append(L[i][0])
        if len(L[i])>=2:
            for j in range(1,len(L[i])):
                m.append(L[i][j])
M.sort(reverse=True)
m.sort(reverse=True)
MM=[0]
for i in range(len(M)):
    MM.append(MM[-1]+M[i])
mm=[0]
for i in range(len(m)):
    mm.append(mm[-1]+m[i])
#print(MM)
#print(mm)
ANS=0

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**5+10
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

for i in range(1,min(K,len(M))+1):
    ANS=max(i*i+MM[i]+mm[min(len(mm)-1,K-i)],ANS)
    #print(ANS,i)
print(ANS)
n = int(input())
l = list(map(int, input(),split()))

L = [0]*n

for i, order in enumerate(l, 1):
    L[order-1] = i

print(*L)

### FIXED CODE ###

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

L = [0]*n

for i, order in enumerate(l, 1):
    L[order-1] = i

print(*L)
A=int(input())
B=[1]*8
for i in range(2:10):
  for j in range(A+1):
    if j**i <= A:
      B[i-2]= j**i
    else:break
print(B.sort()[-1])

### FIXED CODE ###

A=int(input())
B=[1]*8
for i in range(2,10):
  for j in range(A+1):
    if j**i <= A:
      B[i-2]= j**i
    else:break
print(max(B))
l, n = map(int, input().split())
a = []
for i in range(n):
  a.append(input())
a.sort()
b = ""
for i in a:
  b += a
print(b)

### FIXED CODE ###

n, l = map(int, input().split())
a = []
for i in range(n):
  a.append(input())
a.sort()
b = ""
for i in a:
  b += i
print(b)
W,H,x,y,r=map(int,input().split())
if 0 <= x + r <= W:
  if 0 <= y + r <= H:
    print("Yes")
  else:
    Print("No")
else:
  print("No")

### FIXED CODE ###

W,H,x,y,r=map(int,input().split())
if r <= x and r <= y and x+r <= W and y+r <= H:
  print("Yes")
else:
  print("No")
n = input()
l = len(n)
mod = [0]*2019
mod[0] += 1
T = 0
d = 1 # 桁数
for i, s in enumerate(Sr):
  T += int(s) * d
  T %= 2019
  d = (d * 10) % 2019
  
res = 0  
for m in mod:
  res += m*(m-1)/2
print(int(res))


### FIXED CODE ###

n = input()
mod = [0]*2019
mod[0] += 1
T = 0
d = 1 # 桁数
for i, s in enumerate(n[::-1]):
  T += int(s) * d
  T %= 2019
  d = (d * 10) % 2019
  mod[T] += 1
  
res = 0  
for m in mod:
  res += m*(m-1)/2
print(int(res))
import fractions
import numpy as np
n,x=map(int,input().split())
li=np.array(input().split(),dtype=np.int64)

li=abs(li-x)

if len(li)==1:
    print(li[0])
else:
    mini=fractions.gcd(li[0],li[1])
    for i in range(2,n):
        mini=math.gcd(mini,li[i])
    print(mini)
    

### FIXED CODE ###

import fractions
import numpy as np
n,x=map(int,input().split())
li=np.array(input().split(),dtype=np.int64)

li=abs(li-x)

if n==1:
    print(li[0])
else:
    ans=0
    for i in li:
        ans=fractions.gcd(ans,i)
    print(ans)
import math
N,X=map(int,input().split(" "))
xl=list(map(int,input().split(" ")))
xl.append(X)
xl=sorted(xl)
xx=[xl[i+1]-xl[i] for i in range(len(xl)-1)]
ans=max(xx)
for i in range(len(xx)):
    ans=math.gcd(ans,xx[i])

print(ans)

### FIXED CODE ###

def gcd(a, b):
	while b:
		a, b = b, a % b
	return a


N,X=map(int,input().split(" "))
xl=list(map(int,input().split(" ")))
xl.append(X)
xl=sorted(xl)

xx=[xl[i+1]-xl[i] for i in range(len(xl)-1)]

ans=max(xx)
for i in range(len(xx)):
    ans=gcd(ans,xx[i])

print(ans)
s = list(map(int, input()))

head = s[:1]
tail = s[1:]

if head > 12:
  print("YYMM")
if tail > 12:
  print("MMYY")
if 0 < head <= 12 and 0 < tail <=12:
  print("AMBIGUOUS")
if head = 0 or tail = 0:
  print("NA")
if head > 12 and tail > 12:
  print("NA")


### FIXED CODE ###

s = input()

head = int(s[:2])
tail = int(s[2:])

if 0 < head <= 12 and 0 < tail <= 12:
  print("AMBIGUOUS")

elif 0 < head <= 12:
  print("MMYY")

elif 0 < tail <= 12:
  print("YYMM")

else :
  print("NA")
n, m, k = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

i = 0
j = 0
c = []

if k < a[0] and k < b[0]:
    print(0)
    exit()

if k < a[0] and k >= b[0]:
    for i in range(len(b)):
        k -= b[i]
        if k < 0:
            print(i)
            exit()
        if i == len(b)-1:
            print(m)
            exit()

if k >= a[0] and k < b[0]:
    for i in range(len(a)):
        k -= a[i]
        if k < 0:
            print(i)
            exit()
        if i == len(a)-1:
            print(n)
            exit()


while True:
    if a[i] <= b[j]:
        c.append(a[i])
        i += 1
        if i == n -1:
            if j == m -1:
                break
            else:
                for l in range(j, m):
                    c.append(b[l])
                break
    else:
        c.append(b[j])
        j += 1
        if j == m -1:
            if i == n -1:
                break
            else:
                for l in range(i, m):
                    c.append(a[l])
                break

for i in range(len(c)):
    k -= c[i]
    if k < 0:
        print(i)
        exit()
    if i == len(c)-1:
        print(n+m)
        exit()

### FIXED CODE ###

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

best = 0

a, b = [0], [0]
for i in range(N):
    a.append(a[i] + A[i])
for j in range(M):
    b.append(b[j] + B[j])

ans , j = 0, M

for i in range(N +1):
    if a[i] > K:
        break
    while b[j] > K -a[i]:
        j -= 1
    ans = max(ans, i +j)
print(ans)
n = int(input())
d= {}
for _ in range(n):
    i = input()
    if i in d:
        d[i] += 1
    else: d[i] = 1

for _ in range(int(input())):
    i = input()
    if i in d:
        d[i] -= 1

print(max(*d.values(), 0))


### FIXED CODE ###

n = int(input())
d= {}
for _ in range(n):
    i = input()
    if i in d:
        d[i] += 1
    else: d[i] = 1

for _ in range(int(input())):
    i = input()
    if i in d:
        d[i] -= 1

print(max(max(d.values()), 0))
x=int (input())

i=0

while(x=>100((1+0.01)**i){
  i=i+1
}


print(i)

### FIXED CODE ###

X=int(input())
total,Y=100,0
while X>total:
  total=total*101//100
  Y=Y+1
print(Y)
N, M = map(int, input().split())
S = [0]*M
C = [0]*M
SC = {1: set([]), 2: set([]), 3: set([])}
for m in range(M):
    S[m], C[m] = map(int, input().split())
    SC[S[m]].add(C[m])

ANS = [0]*N
out = 0
for i in range(1, 4):
    if len(SC[i]) >= 2:
        out = 1
if out == 1:
    print(-1)

else:
    if N == 1:
        if len(SC[1]) == 0:
            ANS[0] = 0
        else:
            ANS[0] = list(SC[1])[0]

    else:
        for i in range(N):
            if i == 0:
                if list(SC[i+1])[0] == 0:
                    out = 1
                elif len(SC[i+1]) == 0:
                    ANS[0] = 1
                else:
                    ANS[0] = list(SC[i+1])[0]
            else:
                if len(SC[i+1]) == 0:
                    ANS[i] = 0
                else:
                    ANS[i] = list(SC[i+1])[0]
    if out == 1:
        print(-1)
    else:
        ans = 0
        for i in range(N):
            ans += ANS[i]*10**(N-i-1)
        print(ans)

### FIXED CODE ###

N, M = map(int, input().split())
S = [0]*M
C = [0]*M
SC = {}
SC = {1: set([]), 2: set([]), 3: set([])}
for m in range(M):
    S[m], C[m] = map(int, input().split())
    SC[S[m]].add(C[m])

ANS = [0]*N
out = 0
for i in range(1, 4):
    if len(SC[i]) >= 2:
        out = 1
if out == 1:
    print(-1)

else:
    out = 0
    if N == 1:
        if len(SC[1]) == 0:
            ANS[0] = 0
        else:
            ANS[0] = list(SC[1])[0]

    else:
        for i in range(N):
            if i == 0:
                if len(SC[i+1]) == 0:
                    ANS[0] = 1
                elif list(SC[i+1])[0] == 0:
                    out = 1
                else:
                    ANS[0] = list(SC[i+1])[0]
            else:
                if len(SC[i+1]) == 0:
                    ANS[i] = 0
                else:
                    ANS[i] = list(SC[i+1])[0]
    if out == 1:
        print(-1)
    else:
        ans = 0
        for i in range(N):
            ans += ANS[i]*10**(N-i-1)
        print(ans)
n,k=map(int,input().split())
l=list(int(input()))
l.sort(reverse=True)
s=0
for i in range(k):
    s+=l[i]
print(l)

### FIXED CODE ###

n,k=map(int,input().split())
l=list(map(int,input().split()))
l.sort(reverse=True)
s=0
for i in range(k):
    s+=l[i]
print(s)
ans = 0
N = int(input())
for i in range(N):
  r1, r2 = input().sprit()
  ans += r2 - r1 + 1
print(ans)

### FIXED CODE ###

ans = 0
for i in range(int(input())):
  r1, r2 = input().split()
  ans += int(r2) - int(r1) + 1
print(ans)
import math
import bisect


def cmb(n, r):
    if n - r < r:
        r = n - r
    if r == 0:
        return 1
    if r == 1:
        return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result


n = int(input())

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

ncr = 0
ans = [0, 0]

id = bisect.bisect_left(a[:n-1], a[n-1]//2)
if abs(a[-1]/2 - a[id]) <= abs(a[-1] - a[id+1]):
    ans = id
else:
    ans = id+1

print(a[-1], a[ans])


### FIXED CODE ###

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


ans=a.pop(a.index(max(a)))

for i in range(n - 1):
    if a[i] > ans / 2:
        a[i] = [ans - a[i],a[i]]
    else:
        a[i] = [a[i],a[i]]
a = sorted(a,reverse = True)

print(str(ans) + " " + str(a[0][1]))
a,b = map(int,input().split())
if 0 == ((a*b)%2):
  print('even')
else:
  print('Obb’)


### FIXED CODE ###

a,b=map(int,input().split())
if ((a*b)%2) == 0:
  print('Even')
else:
  print('Odd')
n = int(input())
a = list(map(int, input().split()))
s = 1
for i in a :
  s *= i
  if s > 10**18:
    print("-1")
  else:
    print(s)

### FIXED CODE ###

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

print(a*b)
h, w = map(int, input().split())
if h == 1 or w == 1: print(1)
else: print((h * w + 1) // 2)

### FIXED CODE ###

a, b, c = map(int, input().split())
val = a * b
if c - a - b > 0 and 4 * a * b < (c - a - b) ** 2: print('Yes')
else: print('No')
s=sorted(map(list(input()).count,set(s)))
t=sorted(map(list(input()).count,set(t)))
print("Yes" if s==t else "No")

### FIXED CODE ###

from collections import Counter
s=Counter(list(input()))
t=Counter(list(input()))
s,t=list(s.values()),list(t.values())
print("Yes" if sorted(s)==sorted(t) else "No")
n,k_num = map(int,input().split())
info =[list(map(int,input().split())) for i in range(n)]
li_x = []
li_y = []

for i in range(n):
 # if info[i][0] not in li_x:
    li_x.append(info[i][0])
 # if info[i][1] not in li_y:
    li_y.append(info[i][1])

li_x = sorted(li_x)
li_y = sorted(li_y)

bunpu = [[0]*n for i in range(n)]
for i in range(n):
  for j in range(n):
    if info[i][0]==li_x[j]:
      zahyo_x=j
      break
  for k in range(n):
    if info[i][0]==li_y[k]:
      zahyo_y=k
      break
  bunpu[zahyo_x][zahyo_y]=1

ruiseki = [[0]*n for i in range(n)]


#for i in range(0,n):
#  for j in range(0,n):
#    ruiseki[i][j] = bunpu[i][j]
#横方向(j)の累積
#for i in range(n):
#  for j in range(1,n):
#    ruiseki[i][j] = ruiseki[i][j-1] + ruiseki[i][j]
#縦方向(i)の累積
#for j in range(n):
#  for i in range(1,n):
#    ruiseki[i][j] = ruiseki[i-1][j] + ruiseki[i][j]

#print(bunpu)
#print(ruiseki)

ans = float("inf")

#for i in range(len(li_x)):
#  for j in range(i,len(li_x)):
#    for k in range(len(li_y)):
#      for l in range(j,len(li_y)):
#        count = ruiseki[j][l]
#        if 0<=k-1:
#          count -= ruiseki[j][k-1]
#        if 0<=i-1:
#          count -= ruiseki[i-1][l]
#        if 0<=k-1 and 0<=i-1:
#          count += ruiseki[i-1][k-1]      
#        if count ==k_num:
#          ans = min(ans,(li_x[j]-li_x[i])*(li_y[l]-li_y[k]))
print(1)


### FIXED CODE ###

n,k_num = map(int,input().split())
info =[list(map(int,input().split())) for i in range(n)]
li_x = []
li_y = []

for i in range(n):
 # if info[i][0] not in li_x:
    li_x.append(info[i][0])
 # if info[i][1] not in li_y:
    li_y.append(info[i][1])

li_x = sorted(li_x)
li_y = sorted(li_y)

bunpu = [[0]*n for i in range(n)]
for i in range(n):
  for j in range(n):
    if info[i][0]==li_x[j]:
      zahyo_x=j
      break
  for k in range(n):
    if info[i][1]==li_y[k]:
      zahyo_y=k
      break
  bunpu[zahyo_x][zahyo_y]=1

ruiseki = [[0]*n for i in range(n)]


for i in range(0,n):
  for j in range(0,n):
    ruiseki[i][j] = bunpu[i][j]
#横方向(j)の累積
for i in range(n):
  for j in range(1,n):
    ruiseki[i][j] = ruiseki[i][j-1] + ruiseki[i][j]
#縦方向(i)の累積
for j in range(n):
  for i in range(1,n):
    ruiseki[i][j] = ruiseki[i-1][j] + ruiseki[i][j]

#print(bunpu)
#print(ruiseki)

ans = float("inf")

for i in range(len(li_x)):
  for j in range(i,len(li_x)):
    for k in range(len(li_y)):
      for l in range(k,len(li_y)):
        count = ruiseki[j][l]
        if 0<=k-1:
          count -= ruiseki[j][k-1]
        if 0<=i-1:
          count -= ruiseki[i-1][l]
        if 0<=k-1 and 0<=i-1:
          count += ruiseki[i-1][k-1]      
        if count ==k_num:
          ans = min(ans,(li_x[j]-li_x[i])*(li_y[l]-li_y[k]))
print(ans)
# 最大公約数
def gcd(m, n):
    while(n != 0):
        temp = n
        n = m % n
        m = temp
    return m


N = int(input())
T = [int(input()) for _ in range(N)]
ans = 0
for i in range(len(T)):
    if ans == 0:
        ans = T[i]
    else:
        ans = int(ans / gcd(ans, T[i])) * T[i]
print(ans)


### FIXED CODE ###

# 最大公約数
def gcd(m, n):
    while(n != 0):
        temp = n
        n = m % n
        m = temp
    return m


N = int(input())
T = [int(input()) for _ in range(N)]
ans = 0
for i in range(len(T)):
    if ans == 0:
        ans = T[i]
    else:
        ans = ans // gcd(ans, T[i]) * T[i]
print(ans)
31
4 1 5 9 2 6 5 3 5 8 9 7 9 3 2 3 8 4 6 2 6 4 3 3 8 3 2 7 9 5 0

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
A.sort(reverse=True)
ans = 1
flg = True
for i in range(N):
    ans *= A[i]
    if A[-1] != 0:
        if ans > 10**18:
            flg = False
            break
    if A[-1] == 0:
        ans = 0
        break
if flg == False:
    print(-1)
else:
    print(ans)
N = int(input())
ab_list = [list(map(int,input().split())) for i in range(N-1)]

ab_list.sort()

graph = [[] for i in range(N)]
for i in ab_list:
    graph[i[0]-1].append(i[1])
    graph[i[1]-1].append(i[0])
    
ans = []
ten_col = [[] for i in range(N)]
def dfs(start,now,color):
    ten_col[now-1]=[color]
    for i in graph[now-1]:
        if i == start:
            pass
        else:
            new_col = 1
            while True:
                if new_col not in ten_col[now-1]:
                    ten_col[now-1].append(new_col)
                    ans.append(new_col)
                    break
                else:
                    new_col += 1
            dfs(now,i,new_col)
            
dfs(-1,1,0)
print(max(ans))
for i in ans:
    print(i)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)

N = int(input())

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

for i in range(N-1):
    a,b = map(int,input().split())
    graph[a-1].append((b,i))
    graph[b-1].append((a,i))
    
ans = [0]*(N-1)

def dfs(past,now,edge_col):
    new_col = 1
    for (future,i) in graph[now-1]:
        if future == past:
            pass
        else:
            if new_col == edge_col:
                new_col += 1
            ans[i] = new_col
            dfs(now,future,new_col)
            new_col += 1
            
dfs(-1,1,-1)

print(max(ans))
for i in ans:
    print(i)
a,b,k=map(int,input().split())
for i in range (k):
	if a>0:
		a-=1
    break
	elif b>0:
		b-=1
print(a,b)

### FIXED CODE ###

a,b,k=map(int,input().split())
if k<=a:
	A=a-k
	B=b
elif k>=a and k-a<=b:
	A=0
	B=b+a-k
else:A=B=0
print(A,B)
A, B = input().split()
A = int(A)
B = int(float(B * 100))
print(A * B / 100)

### FIXED CODE ###

A, B = input().split()
A = int(A)
B = int(float(B) * 1000)
print((A * B) // 1000)
H,W = map(int,input().split())
A = [list(map(int,input().split())) for _ in [0]*H]
B = [list(map(int,input().split())) for _ in [0]*H]


C = [[abs(b-a) for a,b in zip(a_row,b_row)] for a_row,b_row in zip(A,B)]

dm = [[0]*W for _ in [0]*H]
dm[-1][-1] = 80
for i in range(H-1,-1,-1):
    for j in range(W-1,-1,-1):
        c = C[i][j]
        if i-1>0:
            dm[i-1][j] = max(dm[i-1][j],dm[i][j] + c)
        if j-1>0:
            dm[i][j-1] = max(dm[i-1][j],dm[i][j] + c)

d = [[set() for _ in [0]*W] for _ in [0]*H]
d[0][0] = {C[0][0]}

for i in range(H):
    for j in range(W):
        for n in d[i][j]:
            if i+1<H:
                c = C[i+1][j]
                if n+c <= dm[i][j]:
                    d[i+1][j].add(n+c)
                if n-c <= dm[i][j]:
                    d[i+1][j].add(abs(n-c))
            if j+1<W:
                c = C[i][j+1]
                if n+c <= dm[i][j]:
                    d[i][j+1].add(n+c)
                if n-c <= dm[i][j]:
                    d[i][j+1].add(abs(n-c))
ans = min(abs(o) for o in d[-1][-1])
print(ans)

### FIXED CODE ###

H,W = map(int,input().split())
A = [list(map(int,input().split())) for _ in [0]*H]
B = [list(map(int,input().split())) for _ in [0]*H]


C = [[abs(b-a) for a,b in zip(a_row,b_row)] for a_row,b_row in zip(A,B)]

dm = [[0]*W for _ in [0]*H]
dm[-1][-1] = 80
for i in range(H-1,-1,-1):
    for j in range(W-1,-1,-1):
        c = C[i][j]
        if i-1>=0:
            dm[i-1][j] = max(dm[i-1][j],dm[i][j] + c)
        if j-1>=0:
            dm[i][j-1] = max(dm[i][j-1],dm[i][j] + c)

d = [[set() for _ in [0]*W] for _ in [0]*H]
d[0][0] = {C[0][0]}

for i in range(H):
    for j in range(W):
        for n in d[i][j]:
            if i+1<H:
                c = C[i+1][j]
                if n+c <= dm[i][j]:
                    d[i+1][j].add(n+c)
                if n-c <= dm[i][j]:
                    d[i+1][j].add(abs(n-c))
            if j+1<W:
                c = C[i][j+1]
                if n+c <= dm[i][j]:
                    d[i][j+1].add(n+c)
                if n-c <= dm[i][j]:
                    d[i][j+1].add(abs(n-c))
ans = min(abs(o) for o in d[-1][-1])
print(ans)
n = int(input())
s = list(map(int,input().split()))
S = s.sort(Reverse=True)
A = S[0:n+1:2]
B = S[1:n+1:2]
sum_A = sum(A)
sum_B = sum(B)
print(sum_A - sum_B)




### FIXED CODE ###

N = int(input())
a = list(map(int,input().split()))
b = sorted(a, reverse=True) 
Alice = 0
Bob = 0

for i in range(N):
  if i % 2 == 0:
    Alice += b[i]
  else:
    Bob += b[i]
    
print(Alice - Bob)
import numpy as np

n,m=map(int,input().split())
a=input().split()
a = list(map(int, a))
a = np.array(a)
for i in range(m):
    a = np.sort(a)
    b,c=map(int,input().split())
    for j in range(b):
        if a[j]<c:
            a[j] = c
a = np.array(a)
print(a.sum())


### FIXED CODE ###

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

if a<6:
    print("0")
elif a<13:
    print(int(b/2))
else:
    print(b)
n = longlong(input())

a = 0


for i in n:
	if(n%i*3 == 0 and n%i*5 == 0):
      a += i
    elif(n%i*3 == 0):
      a += i
    elif(n%i*5 == 0):
      a += i
print(i)
      
  
 

### FIXED CODE ###

n = int(input())

a = 0


for i in range(1,n+1):
  
  if(i%3 == 0 or i%5 == 0):
    pass
  else:
    a += i
print(a)
#166d
x = int(input())
for i in range(-118,119):
    for j in range(-118,119):
        if i**5-j**5==x:
            a = i
            b = j
            break
        
print(a,b)

### FIXED CODE ###

#166d
x = int(input())
for i in range(-120,120):
    for j in range(-120,120):
        if i**5-j**5==x:
            a = i
            b = j
            break
        
print(a,b)