Harryxun/stf_run huggingface dataset:
import sys
n=int(input())
X=[]
Y=[]
H=[]
MAX=100
for i in range(n):
    x,y,h=map(int,input().split())
    X.append(x)
    Y.append(y)
    H.append(h)
for posX in range(MAX+1):
    for posY in range(MAX+1):
        needH=-1
        for i in range(n):
            if H[i]>0:
                tmp=H[i]+abs(X[i]-posX)+abs(Y[i]-posY)
                if needH==-1:
                    needH=tmp
                else:
                    if needH!=tmp:
                        needH=-2
                        break
                 
        if needH==-2:
            continue
        for i in range(n):
            if H[i]==0: 
                dis=abs(X[i]-posX)+abs(Y[i]-posY)
                if needH>dist:
                    needH=-2
                    break 
        if needH==-2:
            continue
        print(posX,posY,needH)

### FIXED CODE ###

import sys
n=int(input())
X=[]
Y=[]
H=[]
MAX=100
for i in range(n):
    x,y,h=map(int,input().split())
    X.append(x)
    Y.append(y)
    H.append(h)
for posX in range(MAX+1):
    for posY in range(MAX+1):
        needH=-1
        for i in range(n):
            if H[i]>0:
                tmp=H[i]+abs(X[i]-posX)+abs(Y[i]-posY)
                if needH==-1:
                    needH=tmp
                else:
                    if needH!=tmp:
                        needH=-2
                        break
                 
        if needH==-2:
            continue
        for i in range(n):
            if H[i]==0: 
                dis=abs(X[i]-posX)+abs(Y[i]-posY)
                if needH>dis:
                    needH=-2
                    break 
        if needH==-2:
            continue
        print(posX,posY,needH)
n,a,b = map(int, input().split())
ans = 0
for i in range(1,n+1):
    if a <= sum([int(c) for c in str(i)]) => b:
        ans += i
print(ans)

### FIXED CODE ###

n,a,b = map(int, input().split())
ans = 0
for i in range(1,n+1):
    if a <= sum([int(c) for c in str(i)]) <= b:
        ans += i
print(ans)
N,K = map(int,input().split())
A = list(map(int,input().split()))
B = [a%K for a in A]
cs = [0]
for b in B:
    c = (cs[-1] + b-1) % K
    cs.append(c)

from collections import deque
mk = min(K,N+1)
qs = [deque() for i in range(mk)]

ans = 0
for i,c in enumerate(cs):
    while qs[c] and qs[c][0] + mk <= i:
        qs[c].popleft()
    ans += len(qs[c])
    qs[c].append(i)
print(ans)

### FIXED CODE ###

N,K = map(int,input().split())
A = list(map(int,input().split()))
B = [a%K for a in A]
cs = [0]
for b in B:
    c = (cs[-1] + b-1) % K
    cs.append(c)

from collections import deque
from collections import defaultdict
qs = defaultdict(lambda: deque())

ans = 0
for i,c in enumerate(cs):
    while qs[c] and qs[c][0] + K <= i:
        qs[c].popleft()
    ans += len(qs[c])
    qs[c].append(i)
print(ans)
if __name__ == "__main__":
    S, T = input().split()
    A, B = map(int, input().split())
    U = input()

if c == a[0]:
  print(b[0]-1)
if U == S:
    A -= 1
else:
    B -= 1
print(A, B)

### FIXED CODE ###

if __name__ == "__main__":
    S, T = input().split()
    A, B = map(int, input().split())
    U = input()

if U == S:
    A -= 1
else:
    B -= 1
print(A, B)
N=int(input())
A=list(map(int,input().split()))

for i in range(N-1,0,-1) :
    if A[i-1]>A[i] :
        A.pop(i)

if len(A)==1 :
    print(1000)
    exit()

n=len(A)
money=1000
kabu=0


for i in range(n-1) : 
    if i==n-2 :
        if A[i-1]<=A[i] :
            continue
        elif A[i-1]>A[i] :
            kabu+=money//A[i]
            money-=A[i]*(money//A[i])

    if A[i]<A[i+1] and money>=A[i] : #株を買う
        kabu+=money//A[i]
        money-=A[i]*(money//A[i])

    elif A[i]>A[i+1] and kabu>0 :    #株を売る
        if A[i+1]>=A[i+2] :          #下がり続けていれば何もしない
            continue
        elif A[i+1]<A[i+2] :
            money+=kabu*A[i]
            kabu=0

else :
    money+=kabu*A[n-1]
    print(money)
    

### FIXED CODE ###

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

money=1000
stock=0

for i in range(N-1) :
    if A[i]<A[i+1] :
        stock=money//A[i]
        money-=stock*A[i]
        money+=stock*A[i+1]

    else :
        continue

print(money)
#!/usr/bin/env python
# coding: utf-8

dp = {}
NOT_FOUND = pow(10, 4) + 1

def sget(i):
    if i in dp:
        return dp[i]
    return NOT_FOUND

def chmin(a, b):
    if (a > b):
        return b
    return a

def main(N, hs):
    dp[0] = 0
    #for i in range(1, N):
    #    dp[i] = chmin(sget(i), sget(i - 1) + abs(hs[i] - hs[i - 1]))
    #    if i > 1:
    #        dp[i] = chmin(sget(i), sget(i - 2) + abs(hs[i] - hs[i - 2]))
    def rec(i):
        if sget(i) < NOT_FOUND:
            return sget(i)
        if i == 0:
            return 0
        res = NOT_FOUND
        res = chmin(res, rec(i-1) + abs(hs[i] - hs[i-1]))
        if (i > 1):
            res = chmin(res, rec(i-2) + abs(hs[i] - hs[i-2]))
        dp[i] = res
        return dp[i]
    return rec(N-1)


if __name__ == '__main__':
    #N = 4
    #hs = [10, 30, 40, 20]
    #N = 2
    #hs = [10, 10]
    #N = 6
    #hs = [30, 10, 60, 10, 60, 50]
    #N = 2
    #hs = [1, 3, 2, 1]
    N = int(input())
    hs = list(map(int, input().split(" ")))
    print(main(N, hs))
    #print(dp)


### FIXED CODE ###

#!/usr/bin/env python
# coding: utf-8

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

DP = [0, abs(h[0]-h[1])]
for i in range(N-2):
    DP += [min(DP[-2] + abs(h[i]-h[i+2]), DP[-1] + abs(h[i+1]-h[i+2]))]

print(DP[-1])

#dp = {}
#NOT_FOUND = pow(10, 4) + 1
#
#def sget(i):
#    if i in dp:
#        return dp[i]
#    return NOT_FOUND
#
#def chmin(a, b):
#    if (a > b):
#        return b
#    return a
#
#def main(N, hs):
#    dp[0] = 0
#    #for i in range(1, N):
#    #    dp[i] = chmin(sget(i), sget(i - 1) + abs(hs[i] - hs[i - 1]))
#    #    if i > 1:
#    #        dp[i] = chmin(sget(i), sget(i - 2) + abs(hs[i] - hs[i - 2]))
#    #def rec(i):
#    #    if sget(i) < NOT_FOUND:
#    #        return sget(i)
#    #    if i == 0:
#    #        return 0
#    #    res = NOT_FOUND
#    #    res = chmin(res, rec(i-1) + abs(hs[i] - hs[i-1]))
#    #    if (i > 1):
#    #        res = chmin(res, rec(i-2) + abs(hs[i] - hs[i-2]))
#    #    dp[i] = res
#    #    return dp[i]
#    #return rec(N-1)
#    return dp[N-1]
#
#
#if __name__ == '__main__':
#    #N = 4
#    #hs = [10, 30, 40, 20]
#    #N = 2
#    #hs = [10, 10]
#    #N = 6
#    #hs = [30, 10, 60, 10, 60, 50]
#    #N = 2
#    #hs = [1, 3, 2, 1]
#    N = int(input())
#    hs = list(map(int, input().split()))
#    print(main(N, hs))
from collections import Counter
import sys

sys.setrecursionlimit(10 ** 6)

mod = 1000000007
inf = int(1e18)

dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]


def inverse(a):
    return pow(a, mod - 2, mod)


def usearch(x, a):
    lft = 0
    rgt = len(a) + 1
    while rgt - lft > 1:
        mid = (rgt + lft) // 2
        if a[mid] <= x:
            lft = mid
        else:
            rgt = mid
    return lft


memo = {}

def countbit(x):
    i = 0
    cnt = 0
    while x >= 1<<i:
        if x & (1<<i):
            cnt += 1
        i += 1
    return cnt


def count(x, c):
    # if c == 0:
    #     return 0
    # s = 1
    # x = x % c
    s = 0
    while x != 0:
        s += 1
        x = x % countbit(x)
    return s

def main():
    n = int(input())
    xs = list(input())
    c = len([i for i in xs if i == '1'])
    # t = 21
    # x = int(xs[-t:], 2)
    for i in range(n):
        base = 1
        cc = c
        if xs[i] == '1':
            cc -= 1
        else:
            cc += 1
        xs[i] = '1' if xs[i] == '0' else '0'
        res = 0
        for j in range(n):
            if xs[-j-1] == '1':
                res += base
            base = base * 2 % cc
        count(int("".join(xs), 2), 0)
        s = count(res % cc, 0) + 1
        xs[i] = '1' if xs[i] == '0' else '0'
        print(s)


main()


### FIXED CODE ###

from collections import Counter
import sys

sys.setrecursionlimit(10 ** 6)

mod = 1000000007
inf = int(1e18)

dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]


def inverse(a):
    return pow(a, mod - 2, mod)


def usearch(x, a):
    lft = 0
    rgt = len(a) + 1
    while rgt - lft > 1:
        mid = (rgt + lft) // 2
        if a[mid] <= x:
            lft = mid
        else:
            rgt = mid
    return lft


memo = {}

def countbit(x):
    i = 0
    cnt = 0
    while x >= 1<<i:
        if x & (1<<i):
            cnt += 1
        i += 1
    return cnt


def count(x):
    # if c == 0:
    #     return 0
    # s = 1
    # x = x % c
    s = 0
    while x != 0:
        s += 1
        x = x % countbit(x)
    return s

def main():
    n = int(input())
    xs = list(input())
    c = len([i for i in xs if i == '1'])
    dp = {}
    dps = {}
    for i in range(-1, 2):
        cc = c + i
        if cc == 0:
            continue
        dp[cc] = [-1] * n
        base = 1 % cc
        dpstmp = 0
        for i in range(n):
            dp[cc][i] = base
            if xs[-i-1] == '1':
                dpstmp += base
            base = base * 2 % cc
        dps[cc] = dpstmp % cc

    for i in range(n):
        cc = c
        if xs[i] == '1':
            cc -= 1
        else:
            cc += 1
        if cc == 0:
            print(0)
            continue
        res = dps[cc]
        if xs[i] == '1':
            res = (res - dp[cc][-i-1]) % cc
        else:
            res = (res + dp[cc][-i-1]) % cc
        s = count(res) + 1
        print(s)


main()
a = input().split(' ')
b = list(map((int), a))
sum = sum(b)
A = sum[0]
B = sum[1]

if sum % 3 == 0 || A % 3 == 0 || B % 3 == 0:
    print('Possible')

else:
    print('Impossible')


### FIXED CODE ###

a = input().split(' ')
b = list(map((int), a))
sum = sum(b)
A = b[0]
B = b[1]

if sum % 3 == 0 or A % 3 == 0 or B % 3 == 0:
    print('Possible')

else:
    print('Impossible')
N,K=map(int,input().split())
V=list(map(int,input().split()))

base=sum(V)
ans=base
for i in range(K+1):
    for j in range(K-i+1):
        tmp=[V[k] for k in range(i)]
        for k in range(j):
            tmp.append(V[-1-k])
        tmp.sort()
        rest=K-i-j
        minus=0
        base=sum(tmp)
        for k in range(min(rest,len(tmp))):
            if tmp[k]<0:
                minus+=tmp[k]
            else:
                break
        test=base-minus
        ans=max(ans,test)

print(ans)


### FIXED CODE ###

import copy,heapq

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

ans=0
left=copy.copy(V)
for i in range(1,N):
    left[i]+=left[i-1]
right=copy.copy(V)
for i in range(1,N):
    right[-i-1]+=right[-i]
for i in range(0,N+1):
    for j in range(0,N-i+1):
        dispose=K-i-j
        if 0>dispose:
            continue
        test=0
        q=[]
        if i>0:
            test+=left[i-1]
            q+=V[:i]
        if j>0:
            test+=right[-j]
            q+=V[N-j:N]

        heapq.heapify(q)
        while dispose>0 and q:
            x=heapq.heappop(q)
            if 0>x:
                test-=x
                dispose-=1
            else:
                break
        ans=max(ans,test)

print(ans)
N = int(input())
A = [int(a) for a in input().split()]

dpmax = [[0]*N for _ in range(N)]
dpmin = [[0]*N for _ in range(N)]
        
def f(i, j, t):
    if i > j or i < 0 or j >= N:
        return 0
    
    if i == j:
        if t == 0:
            dpmin[i][j] = -A[i]
            return -A[i]
        if t == 1:
            dpmax[i][j] = A[i]
            return A[i]
        
    if t == 0 and dpmin[i][j] > 0:
        return dpmin[i][j]
    elif t == 1 and dpmax[i][j] > 0:
        return dpmax[i][j]
    
    if t == 0:
        dpmin[i][j] = min(-A[i]+f(i+1, j, 1), -A[j]+f(i, j-1, 1))
        return dpmin[i][j]
    else:
        dpmax[i][j] = max(A[i]+f(i+1, j, 0), A[j]+f(i, j-1, 0))
        return dpmax[i][j]

ans = f(0, N-1, 1)
print(ans)

### FIXED CODE ###

N = int(input())
A = [int(a) for a in input().split()]

dp = [[0]*N for _ in range(N)]
        
for k in range(N):
    for i in range(N-k):
        if k == 0:
            dp[i][i] = A[i]
            continue
    
        dp[i][i+k] = max(A[i]-dp[i+1][i+k], A[i+k]-dp[i][i+k-1])

print(dp[0][N-1])
def a():
    n, k = map(int, input().split())
    if n - 1 >= K:
        print("YES")
    else:
        print("NO")
a()

### FIXED CODE ###

def a():
    n, k = map(int, input().split())
    if int(n / 2 + 0.5) >= k:
        print("YES")
    else:
        print("NO")
a()
while True:
	try:
	    ans = []
	    n = int(raw_input())
	    nb = format(n,'b')
	    nb.reverse
	    nb += " "*(10-len(nb))
	    for i in xrange(10):
	    	if nb[i] == 1:
	    		ans.append(str(2**(9-i))
	    print ' '.join(ans)
	except:
		break

### FIXED CODE ###

import sys
nyu = sys.stdin.read()
nyu = map(int,nyu.split())
for n in nyu:
   	ans = []
	for b in [512,256,128,64,32,16,8,4,2,1]:
		if n >= b:
			n -= b
			ans.append(b)
	ans.reverse()
	ans = map(str,ans)
	ans = ' '.join(ans)
	print ans
n,x = map(int,input().split())
x_list = list(map(int,input().split()))
x_list.append(x)
x_list = sorted(x_list)
a = []
for i in range(n):
    b = x_list[i+1]-x_list[i]
    a.append(b)
import math
from functools import reduce
ans = reduce(math.gcd, a)
print(int(ans))

### FIXED CODE ###

n,x = map(int,input().split())
x_list = list(map(int,input().split()))
x_list.append(x)
x_list = sorted(x_list)
a = []
for i in range(n):
    b = x_list[i+1]-x_list[i]
    a.append(b)
import math
from functools import reduce
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
ans = reduce(gcd, a)
print(int(ans))
N, K = map(int, input().split())
if(K==1):
  print(0)
  else:
    print(N-K)

### FIXED CODE ###

N, K = map(int, input().split())
if(K==1):
  print("0")
else:
  print(N-K)
data = [
    [[0 for r in range(10)] for f in range(3)] for b in range(4)
]

count = int(input())
for c in range(count):
    c, f, r, v = [int(i) for i in input().split]
    data[b - 1][f - 1][r - 1] += v
    

for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')
    
        print()

    if bi < 3:
        print('#' * 20)

### FIXED CODE ###

data = [
    [[0 for r in range(10)] for f in range(3)] for b in range(4)
]
    
count = int(input())
for c in range(count):
    b,f,r,v = [int(i) for i in input().split()]
    data[b-1] [f-1] [r-1] += v
    
for bi, b in enumerate(data):
    for f in b:
        for r in f:
            print(' {0}'.format(r), end='')
        print()
    if bi < 3:
        print('#' * 20)
def to_str(symbol, num):
    return '{0} {1}'.format(symbol, num)

if __name__ == '__main__':
    symbols = ['S','H','C','D']
    cards = [to_str(x,y) for x in symbols for y in range(1,14)]
    n = int(input())
    if n == 52: break
    for i in range(n):
        cards.remove(input())
    print('\n'.join(cards))

### FIXED CODE ###

import sys

def to_str(symbol, num):
    return '{0} {1}'.format(symbol, num)

if __name__ == '__main__':
    symbols = ['S','H','C','D']
    cards = [to_str(x,y) for x in symbols for y in range(1,14)]
    n = int(input())
    if n == 52: sys.exit()
    for i in range(n):
        cards.remove(input())
    print('\n'.join(cards))
N, M = map(int, input().split())

s = [-1] * N
s[0] = 1
s[1] = 1

for m in range(0, M):
    i = int(input())
    s[i] = 0

for n in range(2, N):
    if s[n] == 0:
        continue
    s[n] = s[n - 1] + s[n - 2]

print((s[N-1] + s[N-2]) % 1000000007)

### FIXED CODE ###

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

if N == 1:
    print(1)
else:
    s = [-1] * N
    s[0] = 1
    s[1] = 1

    for m in range(0, M):
        i = int(input())
        s[i] = 0

    for n in range(2, N):
        if s[n] == 0:
            continue
        s[n] = s[n - 1] + s[n - 2]

    print((s[N-1] + s[N-2]) % 1000000007)
team = [0 for i in range(101)]
point= [[0 for i in range(2)] for i in range(31)]
while 1:
    temp= map(int, raw_input().split(','))
    if temp[0] ==0==temp[1]:
        break
    team[temp[0]]=temp[1]
    if point[temp[1]][1]==0:
        point[temp[1]][1]=1
        for i in range(temp[1]+1):
            point[i][0]+=1
while 1:
    n = input()
    print point[team[n]][0]

### FIXED CODE ###

team = [0 for i in range(101)]
point= [[0 for i in range(2)] for i in range(31)]
while 1:
    temp= map(int, raw_input().split(','))
    if temp[0] ==0==temp[1]:
        break
    team[temp[0]]=temp[1]
    if point[temp[1]][1]==0:
        point[temp[1]][1]=1
        for i in range(temp[1]+1):
            point[i][0]+=1
while 1:
    try:
        n = input()
        print point[team[n]][0]
    except EOFError:
	break
import sys

stdin = sys.stdin

ns = lambda : stdin.readline().rstrip()
ni = lambda : int(ns())
na = lambda : list(map(int, stdin.readline().split()))

def main():
  n = ni()
  a = na()

  if n % 2 == 0:
    if 0 in a:
      print(0)
      return 
    else:
      print(2 ** len(list(set(a))))
  else:
    zero = 0
    for aa in a:
      if aa == 0:
        zero += 1
    if zero > 1:
      print(0)
      return
    else:
      if zero == 1:
        print(2 ** (len(list(set(a)) - 1))
      else:
        print(2 ** len(list(set(a)))

main()

### FIXED CODE ###

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

mod = 10**9+7
if(N%2 == 0 and len(set(A)) == N//2):
  print(2**(N//2) % mod)
elif(N%2 != 0 and A.count(0) == 1):
  print(2**((N-1)//2) % mod)
else:
  print(0)
import numpy as np
n=int(input())
a=list(map(int,input().split()))
# dp[i][j]:i番目の数字の中からj個数字を取った時の最大。(i//2)-1<=j<=(i+1)//2
# 求めるのはdp[n][n//2]
dp=np.zeros((n+1,n+1),np.int64)
dp[1,1]=a[0]
dp[2,1]=max(a[:2])
for i in range(2,n+1): #i番目の数字はa[i-1]
      for j in range(max(0,i//2-1),(i+1)//2+1):
            dp[i,j]=max(dp[i-2,j-1]+a[i-1],dp[i-1,j])
print(dp[n,n//2])

### FIXED CODE ###

from collections import defaultdict

n=int(input())
a=list(map(int,input().split()))
#n=2*pow(10,5)
#a=range(1,pow(10,5)+1)
# dp[i][j]:i番目の数字の中からj個数字を取った時の最大。(i//2)-1<=j<=(i+1)//2
# 求めるのはdp[n][n//2]
dp=defaultdict(lambda:-pow(10,18))
dp[(1,1)]=a[0]
for i in range(2,n+1): #i番目の数字はa[i-1]
      for j in range(i//2-1,(i+1)//2+1):
            if j==1:
                  dp[(i,j)]=max(dp[(i-1,1)],a[i-1])
            elif j==0:
                  dp[(i,j)]=0
            else:
                  dp[(i,j)]=max(dp[(i-2,j-1)]+a[i-1],dp[(i-1,j)])
print(dp[(n,n//2)])
N, M = map(int, input().strip())

if N==M:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

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

if N==M:
  print('Yes')
else:
  print('No')
a,b=map(int,input().split())
c=0
for i in range(a+b)
  if (a-2)>0 or (b-2)>0:
    a=a-2
    b=b-2
    c=c+1
print(c)  

### FIXED CODE ###

a,b=map(int,input().split())
c=0
d=a*(a-1)//2
e=b*(b-1)//2
while d>0:
  d=d-1
  c=c+1
while e>0:
  e=e-1
  c=c+1
print(c)
Str=list(input())
if Str[3]==Str[4] and Str[5]==Str[6]:
  print("Yes")
else:print("No")  

### FIXED CODE ###

List=list(input())
if List[2]==List[3] and List[4]==List[5]:
  print("Yes")
else:print("No")
s = int(input())
if (s % 2 == 0):
  print (1/2)
else:
  print ((N-1) / 2N)


### FIXED CODE ###

s = float(input())
if (s % 2 == 0):
  print (s/(2*s))
else:
  print ((s+1)/(2*s))
n,k,c=map(int, input().split())
s=input()
L=[]
R=[]
m=0
for i in range(k):
    while s[m]=="x":
        m+=1
    if s[m]=="o":
        L.append(m)
        m+=c
    m+=1
m=0
for i in range(k):
    while s[m]=="x":
        m+=1
    if s[n-m-1]=="o":
        R.append(n-m-1)
        m+=c
    m+=1
for i in range(k):
    if R[i]==L[i]:
        print(R[i]+1)

### FIXED CODE ###

n,k,c=map(int, input().split())
s=input()
L=[0]*k
R=[0]*k
m=0
l=0
for i in range(k):
    while s[m]=="x":
        m+=1
    L[i]=m
    m+=c+1
    while s[n-l-1]=="x":
        l+=1
    R[i]=n-l-1
    l+=c+1
for i in range(k):
    if R[k-i-1]==L[i]:
        print(L[i]+1)
n,m = map(int,input())
sum = {}
ans = 0

for i in range(n):
  k = list(map(int,input().split()))
  for j in range(1,k[0] + 1):
    if k[j] not in sum:
      sum[k[j]] = 1
    else:
      sum[k[j]] += 1
for l in sum:
  if sum[l] == n:
    ans += 1
print(ans)

### FIXED CODE ###

n,m = map(int,input().split())
sum = {}
ans = 0

for i in range(0,n):
  K = list(map(int,input().split()))
  for j in range(1,K[0] + 1):
    if K[j] not in sum:
      sum[K[j]] = 1
    else:
      sum[K[j]] += 1
for k in sum:
  if sum[k] == n:
    ans += 1
print(ans)
a, b, c = map(int, input().split())
input = [a, b, c]
saidai = max(input)
nokori = input.remove(saidai)

if saidai == sum(nokori):
    print('Yes')
else:
    print('No')

### FIXED CODE ###

a, b, c = map(int, input().split())
nyuryoku = [a, b, c]
saidai = max(nyuryoku)
nyuryoku.remove(saidai)

if saidai == sum(nyuryoku):
    print('Yes')
else:
    print('No')
x,y=map(int, input().split())


print(x*y,(x+y)*2)


### FIXED CODE ###

x,y=map(int, input().split())


print(x*y,(x+y)*2)
a = input()
b = input()
c = input()

if a <= c <= b or b <= c <= a:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a, b, c = (int(i) for i in input().split())  
if a <= c <= b or b <= c <= a:
    print("Yes")
else:
    print("No")
n,k = map(int,input().split())
a = [0]+list(map(int,input().split()))
b = [1]
c = a[1]
d = 0
length = 0
first = 0
ans = 0

while c not in b:
    b += [c]
    c = a[c]
    d = c

length = len(b)-b.index(d)
first = b.index(d)
if k <= first:
    ans = b[k]
else:
    ans = b[(k-first)%length+first]
print(ans)

### FIXED CODE ###

n, k = map(int, input().split())
a = [0] + list(map(int, input().split()))
t = [0 for i in range(n+1)]
b = [1]
c = a[1]
d = 0
e=1
length = 0
first = 0
ans = 0


while t[d] < 1:
    t[d]=e
    b += [c]
    c = a[c]
    d = c
    e+=1

if d != 0:
    length = e - t[d]
    first = b.index(d)
if k <= first:
    ans = b[k]
elif d == 0:
    ans = 1
else:
    ans = b[(k - first) % length + first]
print(ans)
# coding: utf-8


def main():
    
    takahashi_cookie, aoki_cookie, action_count = map(int, input().split(' '))

    if action_count < takahashi_cookie:
        takahashi_result = takahashi_cookie - action_count
        aoki_result = aoki_result
    elif action_count <= (takahashi_cookie + aoki_cookie):
        takahashi_result = 0
        aoki_result = aoki_cookie - (action_count - takahashi_cookie)
    else:
        takahashi_result = 0
        aoki_result = 0
        
    print(takahashi_result, aoki_result)

    return 0
    

if __name__ == '__main__':
    main()


### FIXED CODE ###

#coding:utf-8
 
 
def main():
    list1  = list(map(int, input().split(' '))) 
    a, b, k = list1
  
    if a > k:
        a = a - k
      
    elif a + b >= k:
        b = b - (k - a)
        a = 0
        
    else:
        a = 0
        b = 0
        
    print(a, b)
  
    return 0
 
 
if __name__ == '__main__':
    main()
n,k = map(int,input().split())
S = input()
h = 'o'
if S[k-1] == 'A':
  h = 'a'
elif S[k-1] == 'B':
  h = 'b'
else:
  h = 'c'
print(S[:k-1]+h+S[k:])

### FIXED CODE ###

a,b = list(map(int,input().split()))
print(a-b+1)