Harryxun/stf_run huggingface dataset:
n,k = map(int, input().split())
s = list(x for x in input())
ans = 0

if s[0] == 'R':
  s.insert(0, 'L')
if s[-1] == 'R':
  s.append('L')
s.append(0)
l = []
r = []


for i in range(len(s)-1):
  if s[i] == 'L':
    l.append(i)
    if s[i+1] == 'L':
      ans += 1
      
for i in range(len(l)-1):
  r.append(l[i+1] - l[i] - 1)

r.sort(reverse = True)

for i in range(k):
  if r[i] != 0:
    ans += r[i] + 1
  else:
    break

if n == 1:
  print(0)
elif ans == n:
  print(n-1)
else:
  print(ans)


### FIXED CODE ###

n,k = map(int, input().split())
s = input()
ans = 0
for i in range(len(s)-1):
	if s[i] == s[i+1]:
		ans += 1
ans += 2*k
 
print(min(ans, n-1))
i = input()
print(re.sub'[abcdefghijklmnopqrstuvwyz]', 'x',i)

### FIXED CODE ###

i = input().split()
j = list(map(int, input().split()))
k = input()
if k==i[0]:
    j[0]=j[0]-1
else:
    j[1]=j[1]-1
print(j[0], j[1])
# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
#from heapq import heappop, heappush
#from collections import defaultdict
sys.setrecursionlimit(10**7)
import math
#from itertools import product, accumulate, combinations, product
#import bisect
#import numpy as np
#from copy import deepcopy
#from collections import deque

INF = 1 << 50


def run():
    N, K = map(int, sysread().split())
    A = list(map(int, sysread().split()))

    l = 0
    r = 10**9
    eps = 1e-8
    while int(l) != int(r):
        test = (l + r) / 2
        sum = 0
        for a in A:
            sum += (a-eps) // test
        if sum > K:
            l = test
        elif a < K:
            r = test
        else:# sum == K
            r = test

    if int(l) == l:
        sum = 0
        for a in A:
            sum += (a - eps) // int(l)
        if sum == K:
            print(int(l))

    print(int(l)+1)





if __name__ == "__main__":
    run()

### FIXED CODE ###

# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
#from heapq import heappop, heappush
#from collections import defaultdict
sys.setrecursionlimit(10**7)
import math
#from itertools import product, accumulate, combinations, product
#import bisect
#import numpy as np
#from copy import deepcopy
#from collections import deque

INF = 1 << 50


def run():
    N, K = map(int, sysread().split())
    A = list(map(int, sysread().split()))

    l = 0
    r = 10**9
    while int(l) != int(r):
        #print(l, r)
        test = (l + r) / 2
        sum = 0
        for a in A:
            sum += math.ceil(a / test) - 1

        if sum > K:
            l = test
        elif sum < K:
            r = test
        else:# sum == K
            r = test
        if int(r) == r and r-l < 1:
            print(int(r))
            return

    if int(l) == 0:
        print(1)
        return
    if int(l) == l:
        sum = 0
        for a in A:
            sum += math.ceil(a / int(l)) - 1
        if sum == K:
            print(int(l))
            return

    print(int(l)+1)

if __name__ == "__main__":
    run()
N,i=map(int,input().split())
if 1<=n<=100:
if 1<=i<=n:
print(N-i+1)
    


### FIXED CODE ###

N,i=map(int,input().split( ))
count=0

while N>=i:
    count+=1
    N-=1


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

def lcm(a, b):
    return int((a * b) / gcd(a,  b))

def lcm_list(li):
    if len(li) == 2:
        return lcm(li[0], li[1])
    else:
        li = [lcm(li[0], li[1])] + li[2:]
        return  lcm_list(li)

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


i = lcm_list(a) -1
print(sum([i%j for j in a]))


### FIXED CODE ###

import sys
sys.setrecursionlimit(30000)

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

def lcm(a, b):
    return (a * b) // gcd(a, b)

def lcm_list(li):
    if len(li) == 2:
        return lcm(li[0], li[1])

    else:
        li = [lcm(li[0], li[1])] + li[2:]
        return lcm_list(li)

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


i = max(lcm_list(a) - 1, 1)
print(sum([i % j for j in a]))
N=int(input())
A=list(map(int,input().split()))
A.sort()
B=[]#偶数だけ
C=[]#奇数だけ
if N%2==0:
  for i in range(0,int(N/2)):
    B+=[2*i,2*i]
    C+=[2*i+1,2*i+1]
  if A==B or A==C:
    print(int(2**(N/2))%(10**9+7))
  else:
    print(0)
else:
  B+=[0]
  C+=[1]
  for i in range(0,int(N/2)):
    B+=[2*i+2,2*i+2]
    C+=[2*i+3,2*i+3]
  if A==B or A==C:
    print(int(2**((N-1)/2))%(10**9+7))
  else: 
    print(0)

### FIXED CODE ###

N=int(input())
A=list(map(int,input().split()))
A.sort()
B=[]#偶数だけ
C=[]#奇数だけ

if N%2==0:
  for i in range(0,int(N/2)):
    B+=[2*i,2*i]
    C+=[2*i+1,2*i+1]
  if A==B or A==C:
    n=int(N/2)
    ans=2**n
    print(ans%(10**9+7))
  else:
    print(0)
else:
  B+=[0]
  C+=[1]
  for i in range(0,int(N/2)):
    B+=[2*i+2,2*i+2]
    C+=[2*i+3,2*i+3]
  if A==B or A==C:
    n=int((N-1)/2)
    ans=2**n
#    ans=2**((N-1)/2)
    print(ans%(10**9+7))
  else: 
    print(0)
N = input()
hoge = map(int,input().split())
fuga = [bin(i) for i in hoge]
count = 10000000
for i in fuga:
  tmp = i[::-1]
    for j in range(len(i)):
      if tmp[j] == '1'  and count > j:
        count = j
        break
print(count)  


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
b = [bin(i)[2:] for i in a]
c = [0] * n
for i,v in enumerate(b):
  for j in v[::-1]:
    if j == '0':
      c[i] += 1
    else:
      break
print(min(c))
s = input()
acgt='ACGT'

x = 0; l=[]
for c in s:
    if c in acgt:
        x += 1
    else:
        l.append(x)
        x = 0
print(max(l))

### FIXED CODE ###

s = input()
acgt='ACGT'

x = 0; l=[]
for c in s:
    if c in acgt:
        x += 1
    else:
        l.append(x)
        x = 0
l.append(x)
print(max(l))
chimpo = N
manko = A
B
AC


### FIXED CODE ###

N,A,B=map(int,input().split())
print(min(N*A,B))
N = int(input())
a = [int(x) for x in input().split()]
b = [int(y) for y in input().split()]
c = [int(z) for z in input().split()]

total = 0
pre = 0
for i in range(N):
    total += b[a[i]-1]
    if a[i] == pre+1:
        total += c[a[i]]
    pre = a[i]
print(total)

### FIXED CODE ###

N = int(input())
a = [int(x) for x in input().split()]
b = [int(y) for y in input().split()]
c = [int(z) for z in input().split()]

total = 0
pre = 999
for i in range(N):
    total += b[a[i]-1]
    if a[i] == pre+1:
        total += c[pre-1]
    pre = a[i]
print(total)
n = int(input())
c = input()

wcount = c.count('R')
count = 0

for i in range(n):
    if c[i] == 'W' and i<= wcount:
        count += 1
print(count)


### FIXED CODE ###

x = int(input())

if x >= 30:
    print('Yes')
else:
    print('No')
N, M = map(int, input().split())

l = []

for i in range(N):
    l.append(list(map(lambda x: int(x) - 1, input().split())))

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

for i in range(N):
    lis[l[i][0]].append(l[i][1])
    lis[l[i][1]].append(l[i][0])


# 隣接行列
# list = [[0 for c in range(M)] for r in range(N)]
#
# for i in range(M):
#     tmp_n, tmp_m = map(int, input().split())
#     list[tmp_n - 1][tmp_m - 1] = 1
#
#
# def dot(index1, index2):
#     results = [[0 for c in range(M)] for r in range(N)]
#     for (i, j) in zip(index1, zip(*index2)):
#         print(i,j)
#     return results



# 再起関数
# def travel(now, nextnodes, visited):
#     ends.append(visited)
#     visited.append(now + 1)
#     for node in nextnodes:
#         if node in visited:
#             continue
#         travel(node - 1, lis[node - 1], visited[:])
#
#
# travel(0, lis[0], [])

que = [[0, lis[0], []]]
ends = []

while que:
    now, nextnodes, visited = que.pop()
    ends.append(visited)
    visited.append(now)
    for node in nextnodes:
        if node in visited:
            continue
        que.append([node, lis[node], visited[:]])

print(len(list(filter(lambda i : len(i) is N, ends))))

### FIXED CODE ###

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

l = []

for i in range(M):
    l.append(list(map(lambda x: int(x) - 1, input().split())))

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

for i in range(M):
    lis[l[i][0]].append(l[i][1])
    lis[l[i][1]].append(l[i][0])


# 隣接行列
# list = [[0 for c in range(M)] for r in range(N)]
#
# for i in range(M):
#     tmp_n, tmp_m = map(int, input().split())
#     list[tmp_n - 1][tmp_m - 1] = 1
#
#
# def dot(index1, index2):
#     results = [[0 for c in range(M)] for r in range(N)]
#     for (i, j) in zip(index1, zip(*index2)):
#         print(i,j)
#     return results



# 再起関数
# def travel(now, nextnodes, visited):
#     ends.append(visited)
#     visited.append(now + 1)
#     for node in nextnodes:
#         if node in visited:
#             continue
#         travel(node - 1, lis[node - 1], visited[:])
#
#
# travel(0, lis[0], [])

que = [[0, lis[0], []]]
ends = []

while que:
    now, nextnodes, visited = que.pop()
    ends.append(visited)
    visited.append(now)
    for node in nextnodes:
        if node in visited:
            continue
        que.append([node, lis[node], visited[:]])

print(len(list(filter(lambda ii: len(ii) is N, ends))))
n=int(input())
A=[int(x) for x in input().split()]

q=int(input())
M=[int(x) for x in input().split()]


def solve(m,AA):
    if len(AA)==0:
        return False
    if m in AA:
        return True
    else:
        for i in range(len(AA)):
            if solve(m-AA[i],AA[:i]+AA[i+1:]):
                return True
                break
        return False
    
    
for m in M:
    if solve(m,A):
        print('yes')
    else:
        print('no')


### FIXED CODE ###

input()
X = [int(x) for x in input().split()]
input()
Y = [int(x) for x in input().split()]

flag = [False]*2000
for j in range(1 << len(X)):
    n = 0
    for i in range(len(X)):
        if 1 & (j >> i) == 1:
            n += X[i]
    flag[n] = True

for m in Y:
    print("yes" if flag[m] else "no")
n = input()
s = input()

if len(s) <= n:
  print(s)
else :
  print(s[:n] + "...")

### FIXED CODE ###

n = int(input())
s = input()

if len(s) <= n:
  print(s)
else :
  print(s[:n] + "...")
a, b = map(int, input())
if a >= 10 or a >= 10:
    print(a * b)

else:
    print(-1)

### FIXED CODE ###

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

if max(a, b) <= 9:
  print(a * b)
else:
  print(-1)
import math
import fractions


def calc_lcm(x, y):
    return (x * y) // math.gcd(x, y)


if __name__ == '__main__':
    n, m = list(map(int, input().split()))
    a = list(map(lambda x: int(x)//2, input().split()))
    a = list(set(a))

    while True:
        odd_flag = 0
        even_flag = 0
        for i in range(len(a)):
            if a[i] % 2 == 0:
                a[i] = a[i] / 2
                even_flag = 1
                if odd_flag == 1:
                    print(0)
                    exit()
            else:
                odd_flag = 1
                if even_flag == 1:
                    print(0)
                    exit()

        if even_flag == 0:
            break
        elif odd_flag == 0:
            m = m // 2

    lcm = a[0]
    for i in a:
        lcm = calc_lcm(lcm, i)

    print(math.ceil((m//lcm)/2))

### FIXED CODE ###

from fractions import gcd
from functools import reduce
import sys
sys.setrecursionlimit(10 ** 7)

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)


if __name__ == '__main__':
    n, m = list(map(int, input().split(" ")))
    a = list(map(int, input().split(" ")))
    a = list(set(a))

    # for j in a:
    #     if j % 2 != 0:
    #         print("0")

    # a = [i/2 for i in a]
    l = lcm_list(a)

    # if l == 0:
    #     print(0)
    #     exit()

    if (2 * m) < l:
        print("0")
        exit()

    i = l / 2

    for j in a:
        if i // (j // 2) % 2 == 0:
            print(0)
            exit()

    # if m < i:
    #     print("0")
    else:
        # print("1")
        print(int(((m - i) // l) + 1))
        # print(int((m // i + 1) // 2))
n=int(input())
A=[int(input()) for i in range(n)]
s=0

Z=[]
R=[]
z=0
r=0
for a in A:
  if a==0:
    z+=1
  r+=a
  Z.append(z)
  R.append(r)

for i in range(n-1,-1,-1):
  if Z[i]>=R[i]:
    s+=sum(A[:i+1])
    A=A[i+1:]
    
    break

if A==[]:
  print(s)
  exit()
  
Z=[]
R=[]
z=0
r=0
for a in A[::-1]:
  if a==0:
    z+=1
  r+=a
  Z.append(z)
  R.append(r)
Z=Z[::-1]
R=R[::-1]

for i in range(len(a)):
  if Z[i]>=R[i]:
    s+=sum(A[i:])
    A=A[:i]
    break

if A==[]:
  print(s)
  exit()

for i in range(len(A)):
  if A[i]==0:
    s+=1
    A[i]=1
s0=s

O=[]
E=[]
o=0
e=0
for a in A:
  if a%2==0:
    e+=1
  else:
    o+=1
  E.append(e)
  O.append(o)
l=0
f=0

for i in range(len(A)-1,-1,-1):
  if E[i]>O[i] and f==1:
    s+=O[i]
    A=A[i+1:]

    break
  if A[i]==1:
    f=1
O=[]
E=[]
o=0
e=0
for a in A[::-1]:
  if a%2==0:
    e+=1
  else:
    o+=1
  E.append(e)
  O.append(o)
l=0
f=0
E=E[::-1]
O=O[::-1]
for i in range(len(A)):
  if E[i]>O[i]:
    s+=O[i]
    A=A[i+1:]

    break


O=[]
E=[]
o=0
e=0
for a in A[::-1]:
  if a%2==0:
    e+=1
  else:
    o+=1
  E.append(e)
  O.append(o)
l=0
f=0
E=E[::-1]
O=O[::-1]
for i in range(len(A)):
  if E[i]>O[i]:
    s0+=O[i]
    A=A[i+1:]

    break
O=[]
E=[]
o=0
e=0
for a in A:
  if a%2==0:
    e+=1
  else:
    o+=1
  E.append(e)
  O.append(o)
l=0
f=0

for i in range(len(A)-1,-1,-1):
  if E[i]>O[i] and f==1:
    s0+=O[i]
    A=A[i+1:]

    break
  if A[i]==1:
    f=1
print(min(s,s0)) 


### FIXED CODE ###

n=int(input())
zot=lambda x:0 if x==0 else (x+1)%2+1
A=[int(input()) for i in range(n)]
D=[0,0,0,0,0]

for a in A:
  d0 = D[0] + a
  d1 = min(D[:2])+ [2,1,0][zot(a)]
  d2 = min(D[:3])+ [1,0,1][zot(a)]
  d3 = min(D[:4])+ [2,1,0][zot(a)]
  d4 = min(D) + a
  D=[d0,d1,d2,d3,d4]
print(min(D))
N,X = map(int,input().split())

"""
　　レベルnの層数：a_0 = 1 , a_n = 2*a_(n-1)+3
レベルnのパティ数：b_0 = 1 , b_n = 2*b_(n-1)+1
"""

def thickness(n):
    if n == 0:
        return 1
    else:
        return 2 * thickness(n-1) + 3

def patty(n):
    if n == 0:
        return 1
    else:
        return 2 * patty(n-1) + 1

def ans(n,x):
    if n == 0:
        return 1
    else:
        if x == 1:
            return 0
        if 1 < x <= thickness(n-1)+1:
            return ans(n-1,x-1)
        if x == thickness(n-1) + 2:
            return patty(n-1) + 1
        if thickness(n-1) + 2 < x <= 2 * thickness(n) + 2:
            return patty(n-1) + 1 + ans(n-1,x-2-thickness(n-1))
        if x == 2 * thickness(n-1) + 3:
            return 2 * patty(n-1) + 1

print(ans(N,X))


### FIXED CODE ###

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

"""
　　レベルnの層数：a_0 = 1 , a_n = 2*a_(n-1)+3
レベルnのパティ数：b_0 = 1 , b_n = 2*b_(n-1)+1
"""

def thickness(n):
    if n == 0:
        return 1
    else:
        return 2 * thickness(n-1) + 3

def patty(n):
    if n == 0:
        return 1
    else:
        return 2 * patty(n-1) + 1

def ans(n,x):
    if n == 0:
        return 1
    else:
        if x == 1:
            return 0
        if 1 < x <= thickness(n-1)+1:
            return ans(n-1,x-1)
        if x == thickness(n-1) + 2:
            return patty(n-1) + 1
        if thickness(n-1) + 2 < x <= 2 * thickness(n-1) + 2:
            return patty(n-1) + 1 + ans(n-1,x-2-thickness(n-1))
        if x == 2 * thickness(n-1) + 3:
            return 2 * patty(n-1) + 1

print(ans(N,X))
a, b = map(int, input().split())
if a == 1:
    if b ==2:
        print(3)
    else:
        print(2)
elif a == 2:
    if b == 1:
        print(3)
    else:
        print(1)
else:
    if b == 1:
        print(2)
    else:
        print(1)

### FIXED CODE ###

a = int(input())
b = int(input())
if a == 1:
    if b ==2:
        print(3)
    else:
        print(2)
elif a == 2:
    if b == 1:
        print(3)
    else:
        print(1)
else:
    if b == 1:
        print(2)
    else:
        print(1)
h, w, a, b = map(int, input().split())
mx = [[0 for i in range(w)] for _ in range(h)]
for k in range(a):
  mx[0][k] = 1

for i in range(b):
  mx[i][0] = 1

if w == 1 and a != 0:
  print("No")
elif w == 1 and a == 0:
  for j in range(h):
    s = [str(x) for x in mx[j]]
    print("".join(s))
elif h == 1 and b != 0:
  print("No")
elif h == 1 and b == 0:
  for j in range(h):
    s = [str(x) for x in mx[j]]
    print("".join(s))
else:
  pr = 1
  pc = 1

  while pr < w:
    print(pr, pc, mx)
    for k in range(pc, pc + a - sum(mx[pr][:pc])):
      mx[pr][k] = 1

    csum = 0
    for i in range(pr):
      csum += mx[i][pc]
    for i in range(pr, pr + b - csum):
      mx[i][pc] = 1
    pr += 1
    pc += 1

  flg = 0
  for j in range(w):
    bsum = sum(mx[:][j])
    if min(bsum, h - bsum) != b:
      flg = 1
      break

  if flg == 1:
    print("No")
  else:
    for j in range(h):
      s = [str(x) for x in mx[j]]
      print("".join(s))

### FIXED CODE ###

h, w, a, b = map(int, input().split())
for i in range(h):
  if i < b:
    print("0"*a + "1"*(w-a))
  else:
    print("1"*a + "0"*(w-a))
s = input()

count = 0;

for i in s:
  if s[i] == '1':
    count++
  
print(count)

### FIXED CODE ###

s = input()
 
count = 0
 
for i in s:
  if i == '1':
    count = count + 1
  
print(count)
from fractions import gcd
a = int(input())
b = int(input())
print(a * b / gcd(a, b))

### FIXED CODE ###

from fractions import gcd
a, b = map(int, input().split())
print(a * b // gcd(a, b))
N,M=map(int,input().split(" "))

listing=[]
for i in range(M):
    a=list(map(int,input().split(" ")))
    listing.append(a)

#listing.sort()
#print(listing)
aa=list(map(list, set(map(tuple, listing))))
#aa.sort()

for i in aa:
    if(i[0]>N):
        print(-1)
        exit()

if(N==1 and aa[0][0]==1):
    print(aa[0][1])
    exit()
elif(N==1):
    print(0)
    exit()


a1=[]
a2=[]
for i in aa:
    a1.append(i[0])
    a2.append(i[0])
if(len(a1)!=len(set(a2))):
    print(-1)
    exit()

num=""
#print(aa)
digit=1
digit1=1
for i in range(N):
    for j in aa:
        if(j[0]==1 and j[1]==0):
            print(-1)
            exit()
        if(j[0]==digit):
            num+=str(j[1])
            digit1=digit+1
            break
    if(digit1==digit):
        if(digit==1):
            num+="1"
        else:
            num+="0"
    digit+=1
print(num)
            


### FIXED CODE ###

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

if(M==0):
    if(N==1):
        print(0)
    elif(N==2):
        print(10)
    elif(N==3):
        print(100)
    exit()



listing=[]

for i in range(M):
    a=list(map(int,input().split(" ")))
    listing.append(a)


aa=list(map(list, set(map(tuple, listing))))




a1=[]
a2=[]
for i in aa:
    a1.append(i[0])
    a2.append(i[0])
if(len(a1)!=len(set(a2))):
    print(-1)
    exit()

if(N==1 and aa[0][0]==1):
    print(aa[0][1])
    exit()
num=""
#print(aa)
digit=1
digit1=1
for i in range(N):
    digit1=digit
    for j in aa:
        if(j[0]==1 and j[1]==0):
            print(-1)
            exit()
        if(j[0]==digit):
            num+=str(j[1])
            digit1=digit+1
            break
    if(digit1==digit):
        if(digit==1):
            num+="1"
        else:
            num+="0"
    digit+=1
print(num)
import numpy as np

def getInt():
  return map(int, input().split())

N, M, C = getInt()
B = list(getInt())
ans = 0
for i in range(N):
  A = list(getInt())
  if sum(a*b for a,b in zip(A,B)) + C > 0:
    ans += 1
print(ans)

### FIXED CODE ###

H, W = map(int, input().split())
h, w = map(int, input().split())

res = (H-h)*(W-w)

print(res)
ans = [-1] * (N+1)
graph = [[] for _ in range(N+1)]
for a,b in AB:
    graph[a].append(b)
    graph[b].append(a)

for i in range(N+1):
    graph[i].sort()
    
from collections import deque
todo = deque([(1,0)])
while todo:
    x,parent = todo.pop()
    ans[x] = parent
    for y in graph[x]:
        if y == parent:
            continue
        if ans[y] == -1:
            todo.append((y,x))
print('Yes')
for i in range(2,N+2):
    print(ans[i])

### FIXED CODE ###

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

from collections import deque
import sys
ans = [-1] * (N+1)
todo = deque([(1,0)])
while todo:
    x,parent = todo.popleft()
    # ans[x] = parent
    for y in graph[x]:
        if y == parent:
            continue
        if ans[y] != -1:
            continue
        ans[y] = x
        todo.append((y,x))
        

if -1 in ans[2:]:
    print('No')
else:
    print('Yes')
    for i in range(2,N+1):
        print(ans[i])
number = int(input())

def to_bin(n):
    if n == 0:
        return 0
    
    digits = []
    i = 0
    base = 1
    while n != 0:
        if n % (base * 2) == 0:
            digits.append('0')
        else:
            digits.append('1')
            n -= base
        i+= 1
        base *= -2
    return digits[::-1]

ans_list = to_bin(number)

for ans in ans_list:
    print(ans, end='')

### FIXED CODE ###

number = int(input())

def to_bin(n):
    if n == 0:
        return [0]
    
    digits = []
    i = 0
    base = 1
    while n != 0:
        if n % (base * 2) == 0:
            digits.append('0')
        else:
            digits.append('1')
            n -= base
        i+= 1
        base *= -2
    return digits[::-1]

ans_list = to_bin(number)

for ans in ans_list:
    print(ans, end='')
from sys import stdin
input=stdin.readline
input()
a=list(map(int,input().split()))
ans=sum(a)
b=[0]*(max(a)+1)
for i in a:
  b[i]+=1
c=int(input())
for i in range(c):
  n,m=map(int,input().split())
  x=b[n]
  if x>0:
    b[m]+=x
    b[n]=0
    ans+=(m-n)*x
  print(ans)

### FIXED CODE ###

from sys import stdin
input=stdin.readline
input()
a=list(map(int,input().split()))
ans=sum(a)
b=[0]*(10**5+1)
for i in a:
  b[i]+=1
c=int(input())
for i in range(c):
  n,m=map(int,input().split())
  if b[n]>0:
    x=b[n]
    if x>0:
      b[m]+=x
      b[n]=0
      ans+=(m-n)*x
  print(ans)
n, x = map(int, input().split())
c = list(map(int, input().split()))
c = set([abs(x-c[i]) for i in range(n)])
l = min(c)
for i in range(l+1, 0, -1):
    if l % i == 0:
        d = True
        for item in c:
            if item % i != 0:
                d = False
        if d:
            print(i)
            break

### FIXED CODE ###

a, b = map(int, input().split())
if (a*b)%2 == 0:
    print("No")
else:
    print("Yes")
import math

A = int(input())
B = int(input())
#A = math.log10(A)
#B = math.log10(B)

if A > B:
    print('GREATER')
elif A < B:
    print('LESS')
else:
    print('EQUAL')


### FIXED CODE ###

s1, s2, s3 = input().split()

print(s1[0].upper() + s2[0].upper() + s3[0].upper())
XA = map(int, input().split())
if XA[0]<XA[1]:
  print(0)
else:
  ptint(10)

### FIXED CODE ###

XA = list(map(int, input().split()))
if XA[0]<XA[1]:
  print(0)
else:
  print(10)
s=input()
k=int(input())
l=[]
for i in range(len(s)-1):
  for j in range(i+1,min(len(s),i+5)):
    if s[i:j] not in l:
      l.append(s[i:j])
l.sort()
print(l[k-1])

### FIXED CODE ###

s=input()
k=int(input())
l=[]
for i in range(len(s)):
  for j in range(i+1,min(len(s),i+k)+1):
    if s[i:j] not in l:
      l.append(s[i:j])
l.sort()
print(l[k-1])
n = input()
a = input()
b = input()
c = input()

la = list(a)
lb = list(b)
lc = list(c)

total = 0
for i in range(int(n)):
    count = 0
    if la[i] != lb[i]:
        count += 1
    if la[i] != lc[i]:
        count += 1
    if lb[i] != lc[i]:
        count += 1

    if count == 3:
        total += 2
    elif count == 2:
        total += 1
    elif count == 1:
        total += 1
    else:
        total += 0

print(total)

### FIXED CODE ###

i = input().split()
all = int(i[0])
x = int(i[1])
y = int(i[2])
t = 0
max = 0
if x > y:
    max = x - abs(x - y)
    t = x
elif y > x:
    max = y - abs(x - y)
    t = y 
else:
    t = x
    max = x

min = 0
nx = all - x
ny = all - y

if nx > ny:
    nt = nx
elif ny > nx:
    nt = ny
else:
    nt = nx
if t >= nt: 
    min = t - nt
else:
    min = 0
print("{0} {1}".format(max,min))