Harryxun/stf_run huggingface dataset:
n = int(input())
A=[]
for x in input().split():
    A.append(int(x))

B=[]
for x in input().split():
    B.append(int(x))

B.append(int(0))    

TOT = sum ( A )

print ( A )

for i in range (n) :
    KILL = min ( A[i], B[i] )
    A [i] = A [i] - KILL
    A [i+1] = A[i+1] - min (A[i+1], B[i] - KILL)
    print ( A )    
    
print ( TOT - sum ( A ) )

### FIXED CODE ###

n = int(input())
A=[]
for x in input().split():
    A.append(int(x))

B=[]
for x in input().split():
    B.append(int(x))

B.append(int(0))    

TOT = sum ( A )

for i in range (n) :
    KILL = min ( A[i], B[i] )
    A [i] = A [i] - KILL
    A [i+1] = A[i+1] - min (A[i+1], B[i] - KILL)
    
print ( TOT - sum ( A ) )
a, b = map(int,input().split())
c = 100 * a * b
ans = c // 100
print(ans)


### FIXED CODE ###

a,b = map(str, input().split())
c = b.replace('.', '')
x = int(a)
y = int(c)
d = x * y
ans = d // 100
print(ans)
N = input()
nums = list(map(int, input().split()))
cnt = 0
for i in range(0,n-1):
    taisyouN = nums[i]
    while taisyouN %2 == 0:
        taisyouN = taisyouN/2
        cnt = cnt+1
print(cnt)

### FIXED CODE ###

N = int(input())
nums = list(map(int, input().split()))
cnt = 0
cntlst = []
for i in range(0,N):
    taisyouN = nums[i]
    while taisyouN %2 == 0:
        taisyouN = taisyouN/2
        cnt = cnt+1
    cntlst.append(cnt)
    cnt = 0
print(sum(cntlst))
ca = [int(i) for i in input().split()]
b = [int(j) for j in input().split()]
t = int(input())

if (a[0]<b[0]) & (b[1]*t + (b[0]-a[0]) - a[1]*t) < 0:
    print("YES")
elif (a[0]>b[0]) & (b[1]*t + (a[0]-b[0]) - a[1]*t) < 0:
    print("YES")
else:
    print("NO")


### FIXED CODE ###

a = [int(i) for i in input().split()]
b = [int(j) for j in input().split()]
t = int(input())

dis = abs(a[0]-b[0])

if (b[1]*t+dis) <= a[1]*t:
    print("YES")
else:
    print("NO")
import collections
N,M = map(int,input().split())
H=list(map(int,input().split()))
A=[None for _ in range(M)]
B=[None for _ in range(M)]
for i in range (M):
    A[i],B[i] = map(int,input().split())

C=[None for _ in range(M)]
for i in range(M):
    if H[A[i]-1]<=H[B[i]-1]:
        C[A[i]-1]="bad"
    elif H[A[i]-1]>=H[B[i]-1]:
        C[B[i]-1]="bad"

c = collections.Counter(C)
cook=c["bad"]
ans=N-cook
print(ans)

### FIXED CODE ###

import collections
N,M = map(int,input().split())
H=list(map(int,input().split()))
A=[None for _ in range(M)]
B=[None for _ in range(M)]
for i in range (M):
    A[i],B[i] = map(int,input().split())

C=[None for _ in range(N)]
for i in range(M):
    if H[A[i]-1]<H[B[i]-1]:
        C[A[i]-1]="bad"
    elif H[A[i]-1]>H[B[i]-1]:
        C[B[i]-1]="bad"
    elif H[A[i]-1]==H[B[i]-1]:
        C[A[i]-1]="bad"
        C[B[i]-1]="bad"
c = collections.Counter(C)
cook=c["bad"]
ans=N-cook
print(ans)
n = int(input())
x = []
l = []
xl = []
for i in range(n):
    x1, l1 = map(int, input().split())
    xl.append([x1, x1 + l1, 2 * l1])
xl.sort()
ans = n
for i in range(n - 1):
    if xl[i][1] > xl[i + 1][0]:
        if xl[i][2] >= xl[i + 1][2]:
            ans -= 1
        else:
            ans -= 1
            xl[i + 1] = [i]
print(ans)

### FIXED CODE ###

n = int(input())
st = []
for i in range(n):
    x, l = map(int, input().split())
    st.append([x + l, x - l])

st.sort()
cnt = 1
right = st[0][0]
for i in range(1, n):
    if right <= st[i][1]:
        right = st[i][0]
        cnt += 1

print(cnt)
N ,X, Y = map(int, input().split())

X -= 1
Y -= 1
k = [0]*n

for i in range(N-1):
    for j in range(i+1, N):
        a = j-i
        b = abs(i-x)+1+abs(y-j)
        c = abs(j-x)+1+abs(y-i)
        m =  min(a, b, c)
        k[m] += 1

for i in range(1, N):
    print(k[i])

### FIXED CODE ###

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

X -= 1
Y -= 1
k = [0]*N

for i in range(N-1):
    for j in range(i+1, N):
        a = j-i
        b = abs(i-X)+1+abs(Y-j)
        c = abs(j-X)+1+abs(Y-i)
        m =  min(a, b, c)
        k[m] += 1

for i in range(1, N):
    print(k[i])
n = int(input())
d = list(map(int, input().split()))

d.sort()
c = [0]
j = 0
for i in range(1, max(d)):
	tmp = 0
	 while d[j] == i:
	 	tmp += 1
	 	j += 1
	 c.append(tmp)

ans = 1
if d[0] == 0 and d.count(0) == 1 and c.count(0) == 0:
	for i in range(1, max(d)):
		ans = ans * (c[i]**c[i+1])
else:
	ans = 0

print(ans%998244353)

### FIXED CODE ###

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

dd = sorted(d)
c = []
j = 0
for i in range(max(d)+1):
	tmp = 0
	while dd[j] == i:
		tmp += 1
		j += 1
		if j == n:
			break
	c.append(tmp)

ans = 1
if d[0] == 0 and d.count(0) == 1 and c.count(0) == 0:
	for i in range(1, max(d)):
		ans = ans * (c[i]**c[i+1])
else:
	ans = 0

print(ans%998244353)
n=int(input())
V=list(map(int,input().split()))

A=[[0,i] for i in range(10**5+3)]
B=[[0,i] for i in range(10**5+3)]

for i in range(0,n,2):
    A[V[i]][0]+=1
for i in range(1,n,2):
    B[V[i]][0]+=1

A.sort(reverse=1)
B.sort(reverse=1)

#print(A[:10])
#print(B[:10])

Ma=[]
Mb=[]

ma=A[0][0]
mb=B[0][0]
i=0
j=0
while A[i][0]==ma :
    Ma.append(A[i][1])
    i+=1

while B[j][0]==mb :
    Mb.append(B[j][1])
    j+=1

if Ma==Mb :
    print(min(n-ma-B[j][0],n-mb-A[i][0]))
else :
    print(n-ma-mb)


### FIXED CODE ###

n=input()

ans=""
for i in range(len(n)):
  if n[i]=="1" :
    ans+="9"
  elif n[i]=="9" :
    ans+="1"

print(ans)
return x * 3

### FIXED CODE ###

x = int(input())
print (x ** 3)
import sys


def topological_sort(root, links, in_count):
    topological = []
    q = root.copy()
    while q:
        v = q.pop()
        topological.append(v)
        for u in links[v]:
            in_count[u] -= 1
            if in_count[u] == 0:
                q.add(u)
    return topological


n = int(input())
match_count = n * (n - 1) // 2

offsets = [0]
tmp = -2
for i in range(1, n + 1):
    offsets.append(tmp)
    tmp += n - i - 1

roots = set()
in_links = [set() for _ in range(match_count)]
out_links = [set() for _ in range(match_count)]

for i, line in enumerate(sys.stdin, start=1):
    aaa = list(map(int, line.split()))
    j = aaa[0]
    a, b = (i, j) if i < j else (j, i)
    prev = offsets[a] + b
    roots.add(prev)

    for j in aaa[1:]:
        a, b = (i, j) if i < j else (j, i)
        key = offsets[a] + b
        out_links[prev].add(key)
        in_links[key].add(prev)
        prev = key

in_count = list(map(len, in_links))
roots = {r for r in roots if in_count[r] == 0}

if not roots:
    print(-1)
    exit()

topological = topological_sort(roots, out_links, in_count)
if len(topological) != n * (n - 1) // 2:
    print(-1)
    exit()

depth = [0] * match_count
for v in topological:
    depth[v] = max(map(depth.__getitem__, in_links[v]), default=0) + 1

print(max(depth))


### FIXED CODE ###

import sys
from collections import defaultdict


def dfs(root, links):
    status = {}
    topological = []
    q = [(r, 0, 1) for r in root]
    while q:
        node = q.pop()
        if node[1] == 0:
            v, _, d = node
            q.append((v, 1))
            status[v] = 1
            d += 1
            for u in links[v]:
                if u in status:
                    if status[u] == 1:
                        return False
                else:
                    q.append((u, 0, d))
        else:
            v = node[0]
            status[v] = 2
            topological.append(v)
    topological.reverse()
    return topological


n = int(input())
links = defaultdict(set)
may_root = set()
lines = sys.stdin.readlines()
matches = []
for i in range(n):
    line = lines[i]
    aaa = list(map(int, line.split()))
    match_order = []
    for j in aaa:
        j -= 1
        a, b = (i, j) if i < j else (j, i)
        key = a * n + b
        match_order.append(key)
    matches.append(match_order)
    may_root.add(match_order[0])

for i in range(n):
    kkk = matches[i]
    prev = kkk[0]

    for key in kkk[1:]:
        links[prev].add(key)
        may_root.discard(key)
        prev = key

if not may_root:
    print(-1)
    exit()

topological = dfs(may_root, links)
if topological == False:
    print(-1)
    exit()

ans = 0
depth = defaultdict(lambda: 1)
for v in topological:
    d = depth[v] + 1
    for u in links[v]:
        depth[u] = max(depth[u], d)

print(max(depth.values()))
# 一日ごとに晴れ(Sunny)、くもり(Cloudy)、雨(Rainy)

weather_forecast {
	'Sunny': 'Cloudy',
	'Cloudy': 'Rainy',
	'Rainy': 'Sunny'
}

print(weather_forecast[intput()])



### FIXED CODE ###

weather_forecast = {
	'Sunny': 'Cloudy',
	'Cloudy': 'Rainy',
	'Rainy': 'Sunny'
}
 
print(weather_forecast[input()])
N = int(input())
n = N
alpha = "abcdefghijklmnopqrstuvwxyz"

for i in range(1,10):
    
    if n <= 26 ** i:
        digits = i
        break
    else:
        n -= 26 ** i
#print("桁数は{0}桁".format(digits))
n -= 1
output = ""
for j in range(digits-1):
    amari = n % 26
    n //= 26
    output = alpha[amari] + output
output = alpha[n] + output
print(output)

### FIXED CODE ###

N = int(input())
n = N
alpha = "abcdefghijklmnopqrstuvwxyz"

for i in range(1,12):
    
    if n <= 26 ** i:
        digits = i
        break
    else:
        n -= 26 ** i
#print("桁数は{0}桁".format(digits))
n -= 1
output = ""
for j in range(digits-1):
    amari = n % 26
    n //= 26
    output = alpha[amari] + output
output = alpha[n] + output
print(output)
# C - Vacation AC
N = int(input())
A = []
for _ in range(N):
    a,b,c = map(int,input().split())
    A.append((a,b,c))

# 無限大の値
INF = 10**10

# DP テーブル
dp = [[0]*3 for _ in range(5)]

# DP テーブル全体を初期化
for i in range(5):
    for j in range(3):
        dp[i][j] = 0# 最大化問題

def rec(v):
    # v-1 日目の活動 (本当は v)
    for w in range(3):
        print(v,w)
        if dp[v][w] > 0:
       
            return dp[v]
        if v == 0:
            dp[v][w] = 0
         
            return dp[v]
        res = 0
        # v 日目の活動 (本当は v-1)
        for k in range(3):
            if w == k:
               
                continue
            res = max(res,rec(v-1)[k] + A[v-1][w]) # v-1日の活動のところに記録している？
            dp[v][w] = res # ここで kを記録しているのに w を呼び出していた
            print(v,w,k,dp[v])
    return dp[v]

rec(N)
ans = max(dp[N])
print(ans)
# w がずっと 0
# w と k の扱いが逆

### FIXED CODE ###

# C - Vacation
N = int(input())
A = []
for _ in range(N):
    a,b,c = map(int,input().split())
    A.append((a,b,c))
    
# 無限大の値
INF = 10**10

# DP テーブル (値と前に選んだ活動を保持)
# a (j = 0), b (j = 1), c (j = 2)に記録
dp = [[0]*3 for _ in range(100010)]

# DP テーブル全体を初期化
for i in range(100010):
    for j in range(3):
        dp[i][j] = -INF# 最大化問題
        
# 初期条件
dp[0][0],dp[0][1],dp[0][2] = 0,0,0
        
# v 日目以前に (v 日目以前の幸福度最大値を求める)
for v in range(1,N+1):
    # v-1 日目の活動
    for w in range(3):
        # v 日目の活動
        for k in range(3):
            # 前日と活動が同じならスルー
            if w == k:
                continue
            # v 日目の情報は A[v-1] であることに注意
            dp[v][k] = max(dp[v][k], dp[v-1][w] + A[v-1][k])

# N 日目以前の幸福度最大値を出力
ans = max(dp[N])            
print(ans)
n = map(int, input().split())

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

for i in range(len(a)):
    a[i] -= i + 1

a.sort()

d1, d2 = a[len(a) // 2], a[len(a) // 2 + 1]
print(sum([abs(i - d1) for i in a]))

### FIXED CODE ###

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

for i in range(len(a)):
    a[i] -= i + 1

a.sort()

d1 = a[len(a) // 2]
print(sum([abs(i - d1) for i in a]))
import heapq
def SME(start,end):
    A = []
    if end > N : end = N
    count = 0
    for i,x in enumerate(Whole[start:end]):
        heapq.heappush(A,[x,i])
    for j in range(start,end):
        a = heapq.heappop(A)
        for i in range(L):
            idx = a[1] + i
            try :
                if ANS[idx] == 0:
                    ANS[idx] = a[0]
                    count += 1
            except IndexError : continue
        if count > N * parameter : break
    for i in range(L):
        if ANS[i] == 0 : ANS[i] = min(Whole[:i+1])
    for i in range(L,N):
        if ANS[i] == 0 : ANS[i] = min(Whole[i+1-L:i+1])
    return ANS

[N,L] = [int(x) for x in input().split()]
Whole = [int(x) for x in input().split()]
if N = 10**5 :
    parameter = 0.9999
else :
    parameter = 0.995
ANS = [0]*N
ANS = SME(0, N)
for i in ANS[L-1:-1]:print(i, end=" ")
print(ANS[-1])

### FIXED CODE ###

def ascend(a,b):
    mini = min(A[a:a+L])
    ans[a] = mini
    for i in range(a+1,b):
        if A[i+L-1] <= mini : mini = A[i+L-1]
        elif A[i-1] == mini : mini = min(A[i:i+L])
        ans[i] = mini

def descend(a,b):
    mini = min(A[b-1:b+L-1])
    ans[b-1] = mini
    for i in range(b-2,a-1,-1):
        if A[i] <= mini : mini = A[i]
        elif A[i+L] == mini: mini = min(A[i:i+L])
        ans[i] = mini
    
[N,L] = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]
ans = [None]*(N-L+1)
count = 0;
if N > 10 ** 4:
    for i in range(100):
        if A[i+1] > A[i] : count += 1
    if count > 80 : descend(0, N-L+1)
    else : ascend(0,N-L+1)
else :
    ascend(0, N-L+1)
for i in ans[:-1] : print(i, end=" ")
print(ans[-1])
a = {1:300000,2:200000,3:100000}

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

if x == 1 and y == 1:
	print(a[x] + a[y] + 400000)
else:
	if x > 3 and y <=  3:
		print(a[y])
	elif x <= 3 and y >  3:
		print(a[x])
	else:
		print(a[x] + a[y])

### FIXED CODE ###

a = {1:300000,2:200000,3:100000}

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

if x == 1 and y == 1:
	print(a[x] + a[y] + 400000)
else:
	if x > 3 and y <= 3:
		print(a[y])
	elif x <= 3 and y > 3:
		print(a[x])
	elif x>3 and y >3:
		print(0)
	else:
		print(a[x] + a[y])
n,m = input().split(' ')

ncount = 0 if n < 2 else n*(n-1)/2
mcount = 0 if m < 2 else m*(m-1)/2

print(str(ncount + mcount))

### FIXED CODE ###

inp = input().split(' ')

n = int(inp[0])
m = int(inp[1])

ncount = 0 if n < 2 else n*(n-1)//2
mcount = 0 if m < 2 else m*(m-1)//2

print(str(ncount + mcount))
a, b = map(float, input().split())
print(((a*(100*b))/100)

### FIXED CODE ###

from fractions import Fraction
a, b = map(Fraction, input().split())

print(int(a*b))
W,H,x,y=map(int,input().split())
print(max(min(x*H,(W-x)*H),min(y*W,(H-y)*W)),sum([x/W==y/H,x/W==(H-y)/H,(W-x)/W==y/H])=>1)


### FIXED CODE ###

W,H,x,y=map(int,input().split())
if x==W/2 and y==H/2:
    print(W*H/2,1)
elif not x or not y:
    print(W*H/2,0)
elif x/W==y/H or x/W==(H-y)/H:
    print(W*H/2,0)
else:
    print(W*H/2,0)
import math

n, m = map(int, input().split(" "))

remain = abs(n-m)
if remain <= 1:
	print((math.factorial(n) * math.factorial(m) * (2 if remain==0 else 1)) % (10**9+7)))
else:
	print(0)


### FIXED CODE ###

import math

n, m = map(int, input().split(" "))

remain = abs(n-m)
if remain <= 1:
	print((math.factorial(n) * math.factorial(m) * (2 if remain==0 else 1)) % (10**9+7))
else:
	print(0)
from fractions import gcd
import sys

N, X = map(int,input().split())
lis = list(map(int,input().split()))
diff = []

if N==1:
	print(lis[0]-X)
	sys.exit
for i in range(N):
	diff.append(abs(X-lis[i]))

for j in range(N-1):
	x = gcd(diff[i],diff[i+1])
print(x)

### FIXED CODE ###

from fractions import gcd

n, x = map(int, input().split())
x_lis = [abs(int(i)-x) for i in input().split()]

ans = x_lis[0]
for i in range(n):
	ans = gcd(ans, x_lis[i])
	if ans == 1:
		break
print(ans)
#ABC168

n = int(input())

unit = {0:'pon', 1:'pon', 2:'hon', 3:'bon', 4:'hon', 5:'hon', 6:'pon', 7:'hon', 8:'pon', 9:'hon'}

x = n % 10
print(unit[x])


### FIXED CODE ###

#ABC167-A

id_1 = input()
id_2 = input()

length_1 = len(id_1)
length_2 = len(id_2)

if length_2 == length_1 + 1 and id_2.startswith(id_1):
    print('Yes')
else:
    print('No')
inf = 10**9+7
mod = 10**9+7
n = int(input())
a = [int(input()) for i in range(n)]
h = max(a)
print(sum(a)-h+h//2)

### FIXED CODE ###

inf = 10**9+7
mod = 10**9+7
n,k = map(int, input().split())
a = [int(input()) for i in range(n)]
a.sort()
minh = inf
for i in range(n-k+1):
    minh = min(minh, a[i+k-1]-a[i])
print(minh)
n = int(input())
list = [int(input()) for i in range(n)]
check = 101
count = 0

list.sorted(reverse=True)

for k in list:
    if k < check:
        count += 1
        check = k

print(count)


### FIXED CODE ###

n = int(input())
list_original = [int(input()) for i in range(n)]
check = 101
count = 0

list_mid = sorted(list_original)
list = []

for j in range(1, n+1):
    list.append(list_mid[-j])

for k in list:
    if k < check:
        count += 1
        check = k

print(count)
# 最小公倍数
import math

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


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


print(lcm(a, b))


### FIXED CODE ###

# 最小公倍数
import fractions

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


def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)


print(lcm(a, b))
(n,),*s=[t.rstrip()for t in open(0)]
n=int(n)
c=0
for _ in range(n):
  c+=all(x==''.join(y)for x,y in zip(s,zip(*s)))*n
  s=s[1:]+s[:1]
print(c)

### FIXED CODE ###

n,*s=[t[:-1]for t in open(0)]
n=int(n)
c=0
for _ in range(n):
  c+=all(x==''.join(y)for x,y in zip(s,zip(*s)))*n
  s=s[1:]+s[:1]
print(c)
# -*- coding: utf-8 -*-
import math

N, X = map(int, input().split())
xn = list(map(int, input().split()))
xn2 = []

for xi in xn:
    xn2.append(xi - X)

xn2.sort()

gcd_num = max(xn2)
for xi2 in xn2:
    tmp = math.gcd(xi2,gcd_num)
    if tmp < gcd_num:
        gcd_num = tmp

print(gcd_num)


### FIXED CODE ###

# -*- coding: utf-8 -*-
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

N, X = map(int, input().split())
xn = list(map(int, input().split()))
xn2 = []

for xi in xn:
    xn2.append(abs(xi - X))

xn2.sort()

gcd_num = max(xn2)
for xi2 in xn2:
    tmp = gcd(xi2,gcd_num)
    if tmp < gcd_num:
        gcd_num = tmp

print(gcd_num)
n, k = list(map(int, input().split()))
h = list(map(int, input().split()))

dp = [-1] * n
dp[0] = 0

for i in range(1, min(n, k)):
    dp[i] = min([dp[j] + abs(h[i]-h[j]) for j in range(i)])

for i in range(k, n):
    dp[i] = min([dp[i-j] + abs(h[i]-h[i-j]) for j in range(1, k+1)])

print(dp[n-1])

### FIXED CODE ###

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

dp = [-1] * n
dp[0] = 0
dp[1] = abs(h[1]-h[0])

for i in range(2, n):
    dp[i] = min(dp[i-1]+abs(h[i]-h[i-1]), dp[i-2]+abs(h[i]-h[i-2]))

print(dp[n-1])
def fx(X, n):
    if (int(X/n)):
        return fx(int(X/n), n)+(X//n)
    return 0

N=int(input())
if N%2==1:
  print(0)
else:
  print(fx(n/2,0))

### FIXED CODE ###

def fx(X, n):
    if (X//n):
      #print(X//5)
      return fx(X//n, n)+X//n
    return 0

N=int(input())
if N%2==1:
  print(0)
else:
  print(fx(N//2,5))
a = map(int,input().split())
print(max(a)-min(a))

### FIXED CODE ###

a = list(map(int,input().split()))
print(max(a) - min (a))
N = int(input())
A = list(map(int, input().split()))

tar = reduce(lambda x, y: x*y, values)

if tar > 10 ** 18:
    print(-1)
else:
    print(tar)


### FIXED CODE ###


import sys
N = int(input())
A = list(map(int, input().split()))
A.sort()
tar = 1
for i in A:
    tar *= i
    if tar > 10 ** 18:
        print('-1')
        sys.exit()

print(tar)
n = int(input())
x = input()

x0 = int('0b'+x,0)

ceil = 2*10**5+2
ppc = [0]*(ceil)

def popcount(n):    
  if n == 0:
    return 0
  if ppc[n] != 0:
    return ppc[n]
    
  b = bin(n).count('1')  
  tmp = n%b
  ppc[n] = popcount(tmp) + 1
  return ppc[n]

c1 = bin(x0).count('1')  
for i in range(n):
  p = 2 ** (n - i - 1)
  if x[i] == '1':    
    tmp = x0 - p
    tmp2 = tmp % (c1 - 1)
  else:
    tmp = x0 + p  
    tmp2 = tmp % (c1 + 1)
    
  if tmp > ceil:      
    print(popcount(tmp2)+1)
  else:
    print(popcount(tmp))

### FIXED CODE ###

n = int(input())
X = input()

def goes_to_zero(n):
  cnt = 0
  while(n > 0):
    n %= bin(n).count('1')
    cnt += 1
  return cnt
  
c1 = X.count('1')
xint = int(X,2)
xtp = xint % (c1 + 1)
if (c1 - 1) == 0:  
  xtm = 0
else:
  xtm = xint % (c1 - 1)
  
for i in range(n)  :
  if X[i] == '0':
    print(goes_to_zero( (xtp + pow(2,n-1-i,(c1+1))) % (c1+1) ) + 1)
  else:
    if (c1-1) == 0:
      print(0)
    else:
      print(goes_to_zero( (xtm - pow(2,n-1-i,(c1-1)) ) % (c1-1) ) +1)
import math
N = int(input())
def main(val):
  for i in range(2,math.floor(math.sqrt(val)):
   if val % i == 0:
     return True
  return False
while(True):
  if main(N) == False:
	print(N)
	break
  N += 1

### FIXED CODE ###

import math
N = int(input())
def main(val):
  for i in range(2,int(math.sqrt(val))):
    if val % i == 0:
      return True
  return False
while(True):
  if main(N) == False:
    print(N)
    break
  N += 1
n,m=map(int,input().split())
a =list( map(int,input().split()))

for ii in range(m):
    a[a.index(max(a))] = int(a[a.index(max(a))] / 2)

print(sum(a))


### FIXED CODE ###

S=str(input())

if S ==	"Sunny":
    print("Cloudy")
elif S=="Cloudy":
    print("Rainy")
else:
    print("Sunny")
# -*- coding: utf-8 -*-
# kakomon toku
import math
import sys
import itertools
import numpy as np
 
e = list(input())
num =int(input())
 
 
alpha = list("abcdefghijklmnopqrstuvwxyz")
n = len(e)
a=[0]*(n+5)
#print(alpha)
for t in range(n) :
    for k in range(26):
        if alpha[k] == e[t]:
            a[t] = k
            break
#print(a)
 
ma = [-1]*5
mlen = 1
 
b= [1]*n
for k in range(n):
    b[k]= a[k]
ma[0] = np.argmin(b)
 
#print(ma[0],e[ma[0]])
 
for i in range(1,num):
#    print(b, ma[i-1], n, mlen)
    if ma[i-1] < (n-mlen):
        for k in range(n):
            b[k]= b[k] * 26 + a[k+mlen] 
        mlen += 1
    else:
        b[n-i]= 26 ** 5
        mlen = 1
 
    ma[i] = np.argmin(b)
 
#    for j in range(1,mlen+1):
#        print(e[ma[i]+j-1],end='')
#    print("")
 
for j in range(1,mlen+1):
    print(e[ma[num-1]+j-1],end='')
print("")


### FIXED CODE ###

# -*- coding: utf-8 -*-
# kakomon toku
import math
import sys
import itertools
import numpy as np

e = input()
num =int(input())

a = []

for i in range(len(e)) :
    for j in range(i+1,i+6):
        if e[i:j] not in a:
            a.append(e[i:j])

b = list(set(a))
b.sort()
print(b[num-1])
N, x = map(int, input().split())
a = input().split()
count = 0
for i in range(len(a)):
      a[i] = int(a[i])
      if a[i] > x:
            count = count + a[i] - x
            a[i] = x
      else:
            a[i] = a[i]
for i in range(len(a)-1):  
      if i%2 == 0:
            if a[i] + a[i + 1] > x:
                  count = count + a[i] + a[i + 1] - x
                  a[i+1] = x - a[i]
      else:
            if a[i] + a[i + 1] > x:
                  count = count + a[i] + a[i + 1] - x
                  a[i] = x - a[i + 1]
print(count)



### FIXED CODE ###

a, x, c = input().split()
print("A"+x[0]+"C")
def solve(N, M, A):
    from math import log, ceil
    from heapq import heappush, heappop, heapify
    Q = [-a for a in A]
    heapify(Q)

    if len(A) == 1:
        return A[0]>>M

    while Q and M:
        a = - heappop(Q)
        b = - Q[0]
        if b < a:
            k = min(M, ceil(log(a,2) - log(b, 2)))
        else:
            k = min(M, 1)
        c = a >> k
        #print("prev=%d, dis=%d, %d - %d = %d" % (a, c, M, k, M-k))
        M -= k
        heappush(Q, -c)
    return sum(-a for a in Q)


def main():
    import sys
    input = sys.stdin.readline

    N, M = map(int, input().split())
    A = sorted([int(x) for x in input().split()], reverse=True)

    print(solve(N, M, A))

def gen():
    import random
    with open("9", "w") as f:
        print(10**5, 10**5, file=f)
        print(*[random.randint(1, 10**9) for i in range(10**5)],file=f)

main()



### FIXED CODE ###

def solve(N, M, A):
    from math import log, ceil
    from heapq import heappush, heappop, heapify
    Q = [-a for a in A]
    heapify(Q)

    if len(A) == 1:
        return A[0]>>M

    while Q and M:
        a = - heappop(Q)
        b = - Q[0]
        if a == 0:
            continue
        if b == 0:
            k = M
        elif b < a:
            k = min(M, ceil(log(a,2) - log(b, 2)))
        else:
            k = min(M, 1)
        c = a >> k
        #print("prev=%d, dis=%d, %d - %d = %d" % (a, c, M, k, M-k))
        M -= k
        heappush(Q, -c)
    return sum(-a for a in Q)


def main():
    import sys
    input = sys.stdin.readline

    N, M = map(int, input().split())
    A = sorted([int(x) for x in input().split()], reverse=True)

    print(solve(N, M, A))

def gen():
    import random
    with open("9", "w") as f:
        print(10**5, 10**5, file=f)
        print(*[random.randint(1, 10**9) for i in range(10**5)],file=f)

main()