Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

import sys

from collections import defaultdict, Counter, namedtuple, deque

import itertools

import functools

import bisect

import heapq

import math

# from fractions import gcd

MOD = 10 ** 9 + 7

# MOD = 998244353

# sys.setrecursionlimit(10**8)

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

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

# N = k = 200000

# prev_arr = [0]*N

count = 0

for i in range(min(k, 3*int(math.log(N))+5)):

    que = []

    arr = [0]*N

    for j in range(N):

        heapq.heappush(que, j+prev_arr[j])

        while que[0] < j:

            heapq.heappop(que)

        arr[j] += len(que)

    # print(arr)

    que = []

    for j in reversed(list(range(N))):

        heapq.heappush(que, -(j-prev_arr[j]))

        while -que[0] > j:

            heapq.heappop(que)

        arr[j] += len(que) - 1

    prev_arr = arr

    count += 1

# print(count)

print((*prev_arr))

# optimized version of the same code:

import sys

from collections import defaultdict, Counter, namedtuple, deque

import itertools

import functools

import bisect

import heapq

import math

# from fractions import gcd

MOD = 10 ** 9 + 7

# MOD = 998244353

# sys.setrecursionlimit(10**8)

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

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

count = 0

for i in range(min(k, 3*int(math.log(N))+10)):

    arr = [0]*N

    for j in range(N):

        left = max(0, j-prev_arr[j])

        right = min(N-1, j+prev_arr[j])

        arr[left] += 1

        if right < N-1:

            arr[right+1] -= 1

    # print(arr)

    for j in range(1, N):

        arr[j] += arr[j-1]

    # print(arr)

    prev_arr = arr

    count += 1

# print(count)

print((*prev_arr))

import sys
from collections import defaultdict, Counter, namedtuple, deque
import itertools
import functools
import bisect
import heapq
import math

# from fractions import gcd
MOD = 10**9 + 7
# MOD = 998244353
# sys.setrecursionlimit(10**8)
N, k = list(map(int, input().split()))
prev_arr = list(map(int, input().split()))
# N = k = 200000
# prev_arr = [0]*N
count = 0
for i in range(min(k, 3 * int(math.log(N)) + 5)):
    que = []
    arr = [0] * N
    for j in range(N):
        heapq.heappush(que, j + prev_arr[j])
        while que[0] < j:
            heapq.heappop(que)
        arr[j] += len(que)
    # print(arr)
    que = []
    for j in reversed(list(range(N))):
        heapq.heappush(que, -(j - prev_arr[j]))
        while -que[0] > j:
            heapq.heappop(que)
        arr[j] += len(que) - 1
    prev_arr = arr
    count += 1
# print(count)
print((*prev_arr))

import sys
from collections import defaultdict, Counter, namedtuple, deque
import itertools
import functools
import bisect
import heapq
import math

# from fractions import gcd
MOD = 10**9 + 7
# MOD = 998244353
# sys.setrecursionlimit(10**8)
N, k = list(map(int, input().split()))
prev_arr = list(map(int, input().split()))
count = 0
for i in range(min(k, 3 * int(math.log(N)) + 10)):
    arr = [0] * N
    for j in range(N):
        left = max(0, j - prev_arr[j])
        right = min(N - 1, j + prev_arr[j])
        arr[left] += 1
        if right < N - 1:
            arr[right + 1] -= 1
    # print(arr)
    for j in range(1, N):
        arr[j] += arr[j - 1]
    # print(arr)
    prev_arr = arr
    count += 1
# print(count)
print((*prev_arr))

-for i in range(min(k, 3 * int(math.log(N)) + 5)):

+for i in range(min(k, 3 * int(math.log(N)) + 10)):

-        heapq.heappush(que, j + prev_arr[j])

+        right = min(N - 1, j + prev_arr[j])

-        heapq.heappush(que, -(j - prev_arr[j]))


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

import sys

def main():

    input = sys.stdin.readline

    N = int(eval(input()))

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

    ans = 0

    for C in range(1, N//2):

        n = N // C

        point = 0

        used = set([0])

        for k in range(1, n):

            A = N - 1 - k*C

            if A in used or k*C in used or A == k*C:

                break

            used.add(A)

            used.add(k*C)

            point += S[A] + S[k*C]

            ans = max(ans, point)

    return ans

if __name__ == '__main__':

    print((main()))

# optimized version of the same code:

import sys

def main():

    input = sys.stdin.readline

    N = int(eval(input()))

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

    ans = 0

    # C = A - B

    for C in range(1, N//2):

        n = (N-1) // C

        point = 0

        for k in range(1, n):

            A = N-1 - k*C

            # Check A and B are positive integer, and S_i is not used twice.

            #

            # B = A - C and B >= 0, so A must be over C (A > C).

            #

            # If C is aliquot of N-1 (N-1 % C = 0), A is also aliquot of N-1

            # (N-1 % A = 0) because A + kC = N-1. Therefore when A is less than

            # or equal kC, the A's value is already used by kC.

            if A < C or ((N-1) % C == 0 and A <= k*C):

                break

            point += S[A] + S[k*C]

            ans = max(ans, point)

    return ans

if __name__ == '__main__':

    print((main()))

import sys

def main():
    input = sys.stdin.readline
    N = int(eval(input()))
    S = list(map(int, input().split()))
    ans = 0
    for C in range(1, N // 2):
        n = N // C
        point = 0
        used = set([0])
        for k in range(1, n):
            A = N - 1 - k * C
            if A in used or k * C in used or A == k * C:
                break
            used.add(A)
            used.add(k * C)
            point += S[A] + S[k * C]
            ans = max(ans, point)
    return ans

if __name__ == "__main__":
    print((main()))

import sys

def main():
    input = sys.stdin.readline
    N = int(eval(input()))
    S = list(map(int, input().split()))
    ans = 0
    # C = A - B
    for C in range(1, N // 2):
        n = (N - 1) // C
        point = 0
        for k in range(1, n):
            A = N - 1 - k * C
            # Check A and B are positive integer, and S_i is not used twice.
            #
            # B = A - C and B >= 0, so A must be over C (A > C).
            #
            # If C is aliquot of N-1 (N-1 % C = 0), A is also aliquot of N-1
            # (N-1 % A = 0) because A + kC = N-1. Therefore when A is less than
            # or equal kC, the A's value is already used by kC.
            if A < C or ((N - 1) % C == 0 and A <= k * C):
                break
            point += S[A] + S[k * C]
            ans = max(ans, point)
    return ans

if __name__ == "__main__":
    print((main()))

-            if A in used or k * C in used or A == k * C:

+            # Check A and B are positive integer, and S_i is not used twice.

+            # B = A - C and B >= 0, so A must be over C (A > C).

+            # If C is aliquot of N-1 (N-1 % C = 0), A is also aliquot of N-1

+            # (N-1 % A = 0) because A + kC = N-1. Therefore when A is less than

+            # or equal kC, the A's value is already used by kC.


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

import sys

input = sys.stdin.readline

def I(): return int(eval(input()))

def MI(): return list(map(int, input().split()))

def LI(): return list(map(int, input().split()))

def main():

    mod=10**9+7

    N,M=MI()

    A=LI()

    CB=[[0,0]for _ in range(M)]

    A.sort()

    for i in range(M):

        CB[i][1],CB[i][0]=MI()

    CB.sort(reverse=True)

    now=0

    for i in range(N):

        if CB[now][1]<=0:

            now+=1

        if now>=M:

            break

        ch=CB[now][0]

        if A[i]<ch:

            A[i]=ch

            CB[now][1]-=1

        else:

            break

    print((sum(A)))

main()

# optimized version of the same code:

import sys

input = sys.stdin.readline

def I(): return int(eval(input()))

def MI(): return list(map(int, input().split()))

def LI(): return list(map(int, input().split()))

def main():

    mod=10**9+7

    N,M=MI()

    A=LI()

    B=[0]*M

    C=[0]*M

    for i in range(M):

        B[i],C[i]=MI()

    C,B=list(zip(*sorted(zip(C,B))))

    B=B[::-1]

    C=C[::-1]

    import heapq

    heapq.heapify(A)

    for i in range(M):

        b=B[i]

        c=C[i]

        for _ in range(b):

            a=heapq.heappop(A)

            if a>=c:

                heapq.heappush(A,a)

                break

            else:

                heapq.heappush(A,c)

    ans=0

    for i in range(N):

        a=heapq.heappop(A)

        ans+=a

    print(ans)

main()

import sys

input = sys.stdin.readline

def I():
    return int(eval(input()))

def MI():
    return list(map(int, input().split()))

def LI():
    return list(map(int, input().split()))

def main():
    mod = 10**9 + 7
    N, M = MI()
    A = LI()
    CB = [[0, 0] for _ in range(M)]
    A.sort()
    for i in range(M):
        CB[i][1], CB[i][0] = MI()
    CB.sort(reverse=True)
    now = 0
    for i in range(N):
        if CB[now][1] <= 0:
            now += 1
        if now >= M:
            break
        ch = CB[now][0]
        if A[i] < ch:
            A[i] = ch
            CB[now][1] -= 1
        else:
            break
    print((sum(A)))

main()

import sys

input = sys.stdin.readline

def I():
    return int(eval(input()))

def MI():
    return list(map(int, input().split()))

def LI():
    return list(map(int, input().split()))

def main():
    mod = 10**9 + 7
    N, M = MI()
    A = LI()
    B = [0] * M
    C = [0] * M
    for i in range(M):
        B[i], C[i] = MI()
    C, B = list(zip(*sorted(zip(C, B))))
    B = B[::-1]
    C = C[::-1]
    import heapq

    heapq.heapify(A)
    for i in range(M):
        b = B[i]
        c = C[i]
        for _ in range(b):
            a = heapq.heappop(A)
            if a >= c:
                heapq.heappush(A, a)
                break
            else:
                heapq.heappush(A, c)
    ans = 0
    for i in range(N):
        a = heapq.heappop(A)
        ans += a
    print(ans)

main()

+    C, B = list(zip(*sorted(zip(C, B))))


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

from math import factorial

n = int(eval(input()))

f = factorial(n)

mod = 10 ** 9 + 7

def primes(n):

    is_prime = [True] * (n + 1)

    is_prime[0] = False

    is_prime[1] = False

    for i in range(2, int(n ** 0.5) + 1):

        if not is_prime[i]:

            continue

        for j in range(i * 2, n + 1, i):

            is_prime[j] = False

    return [i for i in range(n + 1) if is_prime[i]]

ans = 1

for p in primes(n):

    temp = 1

    while f % p == 0:

        temp += 1

        f //= p

    ans = (ans * temp) % mod

print(ans)

# optimized version of the same code:

n=int(eval(input()))

m=10**9+7

p=[1 for i in range(10000)]

p[0]=0

p[1]=0

for i in range(2,n+1):

  if p[i]==1:

    for j in range(i*i,n+1,i):

        p[j]=0

ans=1

for i in range(2,n+1):

  if p[i]:

    c=0

    k=i

    while n//k>0:

      c=c+(n//k)%m

      k=k*i

    ans=(ans*((c+1)%m))%m

print((ans%m))

from math import factorial

n = int(eval(input()))
f = factorial(n)
mod = 10**9 + 7

def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]

ans = 1
for p in primes(n):
    temp = 1
    while f % p == 0:
        temp += 1
        f //= p
    ans = (ans * temp) % mod
print(ans)

n = int(eval(input()))
m = 10**9 + 7
p = [1 for i in range(10000)]
p[0] = 0
p[1] = 0
for i in range(2, n + 1):
    if p[i] == 1:
        for j in range(i * i, n + 1, i):
            p[j] = 0
ans = 1
for i in range(2, n + 1):
    if p[i]:
        c = 0
        k = i
        while n // k > 0:
            c = c + (n // k) % m
            k = k * i
        ans = (ans * ((c + 1) % m)) % m
print((ans % m))

-    for i in range(2, int(n**0.5) + 1):

-        for j in range(i * 2, n + 1, i):

-    return [i for i in range(n + 1) if is_prime[i]]

+        for j in range(i * i, n + 1, i):


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

# 初期入力

import sys

import math

#input = sys.stdin.readline

X = int(eval(input()))

limit =10**5

a=0

b=0

for b in range(-1*limit ,limit):

    a5 =X+pow(b,5)

    if 0 <= a5:

        a=math.pow(a5,0.2)

        a_int =int(a)

        dif =a_int**5 -b**5 -X

        if abs(dif)<10**(-5):

            break

    else:

        continue

print((a_int,b))

# optimized version of the same code:

X = int(eval(input()))

y =120

a ={i**5 for i in range(-y,y)}

ans_a =0

ans_b =0

for b in range(-y,y):

    if X +b**5 in a:

        #ans_a =int( (X +b**5 +1)**0.2 )

        if X +b**5 >0:

            ans_a =int( (X +b**5 )**0.2 )

        else:

            ans_a = -int( abs(X +b**5 )**0.2 )

        ans_b =b

        break

print((ans_a,ans_b))

# 初期入力
import sys
import math

# input = sys.stdin.readline
X = int(eval(input()))
limit = 10**5
a = 0
b = 0
for b in range(-1 * limit, limit):
    a5 = X + pow(b, 5)
    if 0 <= a5:
        a = math.pow(a5, 0.2)
        a_int = int(a)
        dif = a_int**5 - b**5 - X
        if abs(dif) < 10 ** (-5):
            break
    else:
        continue
print((a_int, b))

X = int(eval(input()))
y = 120
a = {i**5 for i in range(-y, y)}
ans_a = 0
ans_b = 0
for b in range(-y, y):
    if X + b**5 in a:
        # ans_a =int( (X +b**5 +1)**0.2 )
        if X + b**5 > 0:
            ans_a = int((X + b**5) ** 0.2)
        else:
            ans_a = -int(abs(X + b**5) ** 0.2)
        ans_b = b
        break
print((ans_a, ans_b))


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

import sys

input = sys.stdin.buffer.readline

import numpy as np

def main():

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

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

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

    a.sort()

    f.sort(reverse=True)

    if sum(a) <= K:

        print((0))

    else:

        a = np.array(a)

        f = np.array(f)

        left,right = 0,max(a)*max(f)

        while right-left > 1:

            mid = (left+right)//2

            pra = a-mid//f

            pra[pra<0] = 0

            if np.sum(pra) > K:

                left = mid

            else:

                right = mid

        print(right)

if __name__ == "__main__":

    main()

# optimized version of the same code:

import sys

input = sys.stdin.buffer.readline

def main():

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

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

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

    a.sort()

    f.sort(reverse=True)

    l,r = -1,max(a)*max(f)+1

    while r-l>1:

        mid = (r+l)//2

        count = 0

        for cost,dif in zip(a,f):

            if mid >= cost*dif:

                continue

            rest = cost*dif-mid

            count += -(-rest//dif)

        if count <= K:

            r = mid

        else:

            l = mid

    print(r)

if __name__ == "__main__":

    main()

import sys

input = sys.stdin.buffer.readline
import numpy as np

def main():
    N, K = list(map(int, input().split()))
    a = list(map(int, input().split()))
    f = list(map(int, input().split()))
    a.sort()
    f.sort(reverse=True)
    if sum(a) <= K:
        print((0))
    else:
        a = np.array(a)
        f = np.array(f)
        left, right = 0, max(a) * max(f)
        while right - left > 1:
            mid = (left + right) // 2
            pra = a - mid // f
            pra[pra < 0] = 0
            if np.sum(pra) > K:
                left = mid
            else:
                right = mid
        print(right)

if __name__ == "__main__":
    main()

import sys

input = sys.stdin.buffer.readline

def main():
    N, K = list(map(int, input().split()))
    a = list(map(int, input().split()))
    f = list(map(int, input().split()))
    a.sort()
    f.sort(reverse=True)
    l, r = -1, max(a) * max(f) + 1
    while r - l > 1:
        mid = (r + l) // 2
        count = 0
        for cost, dif in zip(a, f):
            if mid >= cost * dif:
                continue
            rest = cost * dif - mid
            count += -(-rest // dif)
        if count <= K:
            r = mid
        else:
            l = mid
    print(r)

if __name__ == "__main__":
    main()

-        left, right = 0, max(a) * max(f)


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

from collections import defaultdict

from bisect import bisect_left

s = eval(input())

n = len(s)

s = s + s

t = eval(input())

if set(t) - set(s):

	print((-1))

	exit()

d = defaultdict(list)

for i in range(2 * n):

	d[s[i]] += [i]

cur = tot = 0

for c in t:

	x = d[c][bisect_left(d[c], cur)]

	if x < n:

		cur = x + 1

	else:

		cur = x - n + 1

		tot += n

tot += cur

print(tot)

# optimized version of the same code:

from collections import defaultdict

from bisect import bisect_left

def main():

	s = eval(input())

	n = len(s)

	s = s + s

	t = eval(input())

	if set(t) - set(s):

		print((-1))

		exit()

	d = defaultdict(list)

	for i in range(2 * n):

		d[s[i]] += [i]

	cur = ncnt = 0

	for c in t:

		x = d[c][bisect_left(d[c], cur)]

		if x < n:

			cur = x + 1

		else:

			cur = x - n + 1

			ncnt += 1

	print((ncnt*n + cur))

if __name__ == "__main__":

	main()

from collections import defaultdict
from bisect import bisect_left

def main():
    s = eval(input())
    n = len(s)
    s = s + s
    t = eval(input())
    if set(t) - set(s):
        print((-1))
        exit()
    d = defaultdict(list)
    for i in range(2 * n):
        d[s[i]] += [i]
    cur = ncnt = 0
    for c in t:
        x = d[c][bisect_left(d[c], cur)]
        if x < n:
            cur = x + 1
        else:
            cur = x - n + 1
            ncnt += 1
    print((ncnt * n + cur))

if __name__ == "__main__":
    main()

+        x = d[c][bisect_left(d[c], cur)]


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

import sys

stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)

def li(): return list(map(int, stdin.readline().split()))

def li_(): return [int(x) - 1 for x in stdin.readline().split()]

def lf(): return list(map(float, stdin.readline().split()))

def ls(): return stdin.readline().split()

def ns(): return stdin.readline().rstrip()

def lc(): return list(ns())

def ni(): return int(stdin.readline())

def nf(): return float(stdin.readline())

n = ni()

ab = [list(li()) for _ in range(n)]

ab.sort(key=lambda x: x[1])

cur = 0

ans = True

for ai, bi in ab:

    cur += ai

    if cur > bi:

        ans = False

print(("Yes" if ans else "No"))

# optimized version of the same code:

import sys

stdin = sys.stdin

sys.setrecursionlimit(10 ** 7)

def li(): return list(map(int, stdin.readline().split()))

def li_(): return [int(x) - 1 for x in stdin.readline().split()]

def lf(): return list(map(float, stdin.readline().split()))

def ls(): return stdin.readline().split()

def ns(): return stdin.readline().rstrip()

def lc(): return list(ns())

def ni(): return int(stdin.readline())

def nf(): return float(stdin.readline())

n = ni()

ab = [tuple(li()) for _ in range(n)]

ab.sort(key=lambda x: x[1])

cur = 0

ok = True

for ai, bi in ab:

    cur += ai

    if cur > bi:

        ok = False

        break

print(("Yes" if ok else "No"))

import sys

stdin = sys.stdin
sys.setrecursionlimit(10**7)

def li():
    return list(map(int, stdin.readline().split()))

def li_():
    return [int(x) - 1 for x in stdin.readline().split()]

def lf():
    return list(map(float, stdin.readline().split()))

def ls():
    return stdin.readline().split()

def ns():
    return stdin.readline().rstrip()

def lc():
    return list(ns())

def ni():
    return int(stdin.readline())

def nf():
    return float(stdin.readline())

n = ni()
ab = [list(li()) for _ in range(n)]
ab.sort(key=lambda x: x[1])
cur = 0
ans = True
for ai, bi in ab:
    cur += ai
    if cur > bi:
        ans = False
print(("Yes" if ans else "No"))

import sys

stdin = sys.stdin
sys.setrecursionlimit(10**7)

def li():
    return list(map(int, stdin.readline().split()))

def li_():
    return [int(x) - 1 for x in stdin.readline().split()]

def lf():
    return list(map(float, stdin.readline().split()))

def ls():
    return stdin.readline().split()

def ns():
    return stdin.readline().rstrip()

def lc():
    return list(ns())

def ni():
    return int(stdin.readline())

def nf():
    return float(stdin.readline())

n = ni()
ab = [tuple(li()) for _ in range(n)]
ab.sort(key=lambda x: x[1])
cur = 0
ok = True
for ai, bi in ab:
    cur += ai
    if cur > bi:
        ok = False
        break
print(("Yes" if ok else "No"))

-ab = [list(li()) for _ in range(n)]
+ab = [tuple(li()) for _ in range(n)]
-ans = True
+ok = True
-        ans = False
-print(("Yes" if ans else "No"))
+        ok = False
+        break
+print(("Yes" if ok else "No"))


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

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

ans = 0

for i in range(n, m+1):

    if str(i)[0]+str(i)[1] == str(i)[-1]+str(i)[-2]: ans += 1

print(ans)

# optimized version of the same code:

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

ans = 0

for n in range(a, b+1):

    if str(n) == str(n)[::-1]: ans += 1

print(ans)

n, m = list(map(int, input().split()))
ans = 0
for i in range(n, m + 1):
    if str(i)[0] + str(i)[1] == str(i)[-1] + str(i)[-2]:
        ans += 1
print(ans)

a, b = list(map(int, input().split()))
ans = 0
for n in range(a, b + 1):
    if str(n) == str(n)[::-1]:
        ans += 1
print(ans)


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

ans=[]

for i in range (0,10):

    ans.append(int(eval(input())))

ans.sort(reverse=True)

for i in range (0,3):

    print((ans[i]))

# optimized version of the same code:

mountain=[]

for s in range(0,10):

    mountain.append(int(eval(input())))

mountain.sort(reverse=True)

for s in range(0,3):

 print((mountain[s]))

ans = []
for i in range(0, 10):
    ans.append(int(eval(input())))
ans.sort(reverse=True)
for i in range(0, 3):
    print((ans[i]))

mountain = []
for s in range(0, 10):
    mountain.append(int(eval(input())))
mountain.sort(reverse=True)
for s in range(0, 3):
    print((mountain[s]))

+    mountain.append(int(eval(input())))


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

import sys

input = sys.stdin.readline

H, W = [int(x) for x in input().split()]

a = []

for _ in range(H):

    a.append(list(input().rstrip()))

import numpy as np

a = np.array(a, np.object)

a = a.T

retsu = []

gyou = []

for i in range(W):

    if "#" not in a[i]:

        retsu.append(i)

a = a.T

for i in range(H):

    if "#" not in a[i]:

        gyou.append(i)

a = np.delete(a, retsu, 1)

a = np.delete(a, gyou, 0)

for j in a:

    j = list(j)

    print(("".join(j)))

# optimized version of the same code:

import sys

input = sys.stdin.readline

h, w = [int(x) for x in input().split()]

a = []

for _ in range(h):

    b = list(input().rstrip())

    if '#' in b:

        a.append(b)

h = len(a)

c = [1]*w

for i in range(w):

    flag = 1

    for j in range(h):

        if a[j][i] == "#":

            flag = 0

            break

    if flag:

        c[i] = 0

ans = []

for i in range(h):

    res = []

    for j in range(w):

        if c[j]:

            res.append(a[i][j])

    ans.append("".join(res))

for i in ans:

    print(i)

import sys

input = sys.stdin.readline
h, w = [int(x) for x in input().split()]
a = []
for _ in range(h):
    b = list(input().rstrip())
    if "#" in b:
        a.append(b)
h = len(a)
c = [1] * w
for i in range(w):
    flag = 1
    for j in range(h):
        if a[j][i] == "#":
            flag = 0
            break
    if flag:
        c[i] = 0
ans = []
for i in range(h):
    res = []
    for j in range(w):
        if c[j]:
            res.append(a[i][j])
    ans.append("".join(res))
for i in ans:
    print(i)

-H, W = [int(x) for x in input().split()]

+h, w = [int(x) for x in input().split()]


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

# -*- coding: utf-8 -*-

import sys

def main():

    S = int( sys.stdin.readline() )

    dp = [0]*(S+1)

    dp[0] = 1

    mod = 10**9 + 7

    for i in range(3, S+1):

        cnt = 0

        for j in range(3, i+1):

            cnt += dp[i-j]

            cnt %= mod

        dp[i] = cnt

    print((dp[-1]))

if __name__ == "__main__":

    main()

# optimized version of the same code:

# -*- coding: utf-8 -*-

import sys

def main():

    S = int( sys.stdin.readline() )

    dp = [0]*(S+1)

    dp[0] = 1

    mod = 10**9 + 7

    for i in range(3, S+1):

        dp[i] = dp[i-3] + dp[i-1]

        dp[i] %= mod

    print((dp[-1]))

if __name__ == "__main__":

    main()

# -*- coding: utf-8 -*-
import sys

def main():
    S = int(sys.stdin.readline())
    dp = [0] * (S + 1)
    dp[0] = 1
    mod = 10**9 + 7
    for i in range(3, S + 1):
        cnt = 0
        for j in range(3, i + 1):
            cnt += dp[i - j]
            cnt %= mod
        dp[i] = cnt
    print((dp[-1]))

if __name__ == "__main__":
    main()

# -*- coding: utf-8 -*-
import sys

def main():
    S = int(sys.stdin.readline())
    dp = [0] * (S + 1)
    dp[0] = 1
    mod = 10**9 + 7
    for i in range(3, S + 1):
        dp[i] = dp[i - 3] + dp[i - 1]
        dp[i] %= mod
    print((dp[-1]))

if __name__ == "__main__":
    main()

-        cnt = 0
-        for j in range(3, i + 1):
-            cnt += dp[i - j]
-            cnt %= mod
-        dp[i] = cnt
+        dp[i] = dp[i - 3] + dp[i - 1]
+        dp[i] %= mod


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

from collections import Counter

import numpy as np

N = int(eval(input()))

A = np.array(input().split(), dtype = np.int64)

c = Counter(A.cumsum())

c[0] += 1

answer = sum(x*(x-1)//2 for x in list(c.values()))

print(answer)

# optimized version of the same code:

import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

import itertools

from collections import defaultdict

N,*A = list(map(int,read().split()))

Acum = [0] + list(itertools.accumulate(A))

counter = defaultdict(int)

answer = 0

for x in Acum:

    answer += counter[x]

    counter[x] += 1

print(answer)

from collections import Counter
import numpy as np

N = int(eval(input()))
A = np.array(input().split(), dtype=np.int64)
c = Counter(A.cumsum())
c[0] += 1
answer = sum(x * (x - 1) // 2 for x in list(c.values()))
print(answer)

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import itertools
from collections import defaultdict

N, *A = list(map(int, read().split()))
Acum = [0] + list(itertools.accumulate(A))
counter = defaultdict(int)
answer = 0
for x in Acum:
    answer += counter[x]
    counter[x] += 1
print(answer)

-A = np.array(input().split(), dtype=np.int64)

-answer = sum(x * (x - 1) // 2 for x in list(c.values()))

+Acum = [0] + list(itertools.accumulate(A))


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

import numpy as np

L = np.array(int(eval(input())), dtype='float128')

ans = (L / 3)**3

print(ans)

# optimized version of the same code:

import numpy as np

L = int(eval(input()))

ans = (L / 3)**3

print(ans)

import numpy as np

L = np.array(int(eval(input())), dtype="float128")
ans = (L / 3) ** 3
print(ans)

import numpy as np

L = int(eval(input()))
ans = (L / 3) ** 3
print(ans)

-L = np.array(int(eval(input())), dtype="float128")


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

def solve():

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

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

  if K>=N:

    return 0

  H.sort()

  ans = sum(H[:N-K])

  return ans

print((solve()))

# optimized version of the same code:

def solve():

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

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

  H.sort()

  ans = sum(H[:max(N-K,0)])

  return ans

print((solve()))

def solve():
    N, K = list(map(int, input().split()))
    H = list(map(int, input().split()))
    if K >= N:
        return 0
    H.sort()
    ans = sum(H[: N - K])
    return ans

print((solve()))

def solve():
    N, K = list(map(int, input().split()))
    H = list(map(int, input().split()))
    H.sort()
    ans = sum(H[: max(N - K, 0)])
    return ans

print((solve()))

-    if K >= N:
-        return 0
-    ans = sum(H[: N - K])
+    ans = sum(H[: max(N - K, 0)])


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

k, s = list(map(int, input().split()))

ans = 0

for x in range(k+1):

  for y in range(k+1):

    if 0<=s-x-y<=k:

      ans += 1

print(ans)

# optimized version of the same code:

k,s=list(map(int,input().split()))

ans=0

for i in range(k+1):

  num=s-i

  for j in range(min(num+1,k+1)):

    if 0<=num-j<=k:

      ans+=1

print(ans)

k, s = list(map(int, input().split()))
ans = 0
for x in range(k + 1):
    for y in range(k + 1):
        if 0 <= s - x - y <= k:
            ans += 1
print(ans)

k, s = list(map(int, input().split()))
ans = 0
for i in range(k + 1):
    num = s - i
    for j in range(min(num + 1, k + 1)):
        if 0 <= num - j <= k:
            ans += 1
print(ans)

+    for j in range(min(num + 1, k + 1)):


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

import sys

N = int(eval(input()))

a = [int(eval(input())) for _ in range(N)]

l = 1

p = a[0] - 1

if a[0] == 2:

    print(l)

    sys.exit()

while l < int(1e6):

    l += 1

    if a[p] == 2:

        print(l)

        break

    else:

        p = a[p] - 1

else:

    print((-1))

# optimized version of the same code:

import sys

N = int(eval(input()))

a = [int(eval(input())) for _ in range(N)]

l = 1

p = a[0] - 1

if a[0] == 2:

    print(l)

    sys.exit()

while l < int(2e5):

    l += 1

    if a[p] == 2:

        print(l)

        break

    else:

        p = a[p] - 1

else:

    print((-1))

-while l < int(1e6):
+while l < int(2e5):


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

import sys, re

from collections import deque, defaultdict, Counter

from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians

from itertools import accumulate, permutations, combinations, product, groupby

from operator import itemgetter, mul

from copy import deepcopy

from string import ascii_lowercase, ascii_uppercase, digits

from bisect import bisect, bisect_left

from fractions import gcd

from heapq import heappush, heappop

from functools import reduce

def input(): return sys.stdin.readline().strip()

def INT(): return int(eval(input()))

def MAP(): return list(map(int, input().split()))

def LIST(): return list(map(int, input().split()))

def ZIP(n): return list(zip(*(MAP() for _ in range(n))))

sys.setrecursionlimit(10 ** 9)

INF = float('inf')

mod = 10 ** 9 + 7

import numpy as np

A1 = LIST()

A2 = LIST()

A3 = LIST()

N = INT()

B = np.ones(N)

for i in range(N):

  B[i] = INT()

B = list(B)

def bingo_array(A, B):

  for i in range(3):

    for x in B:

      if A[i] == x:

        A[i] *= 0

bingo_array(A1, B)

bingo_array(A2, B)

bingo_array(A3, B)

if sum(A1) == 0 or sum(A2) == 0 or sum(A3) == 0:

  print("Yes")

elif A1[0]+A2[0]+A3[0] == 0 or A1[1]+A2[1]+A3[1] == 0 or A1[2]+A2[2]+A3[2] == 0:

  print("Yes")

elif A1[0]+A2[1]+A3[2] == 0 or A1[2]+A2[1]+A3[0] == 0:

  print("Yes")

else:

  print("No")

# optimized version of the same code:

import sys, re

from collections import deque, defaultdict, Counter

from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians

from itertools import accumulate, permutations, combinations, product

from operator import itemgetter, mul

from copy import deepcopy

from string import ascii_lowercase, ascii_uppercase, digits

from bisect import bisect, bisect_left

from fractions import gcd

from heapq import heappush, heappop

from functools import reduce

def input(): return sys.stdin.readline().strip()

def INT(): return int(eval(input()))

def MAP(): return list(map(int, input().split()))

def LIST(): return list(map(int, input().split()))

sys.setrecursionlimit(10 ** 9)

INF = float('inf')

mod = 10 ** 9 + 7

A = [LIST() for _ in range(3)]

N = INT()

b = [INT() for _ in range(N)]

check = [[0]*3 for _ in range(3)]

for n in b:

  for i in range(3):

    for j in range(3):

      if A[i][j] == n:

        check[i][j] = 1

for i in range(3):

  if sum(check[i]) == 3:

    print("Yes")

    exit()

for i in range(3):

  if check[0][i] and check[1][i] and check[2][i]:

    print("Yes")

    exit()

if check[0][0] and check[1][1] and check[2][2]:

  print("Yes")

  exit()

if check[0][2] and check[1][1] and check[2][0]:

  print("Yes")

  exit()

print("No")

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce

def input():
    return sys.stdin.readline().strip()

def INT():
    return int(eval(input()))

def MAP():
    return list(map(int, input().split()))

def LIST():
    return list(map(int, input().split()))

def ZIP(n):
    return list(zip(*(MAP() for _ in range(n))))

sys.setrecursionlimit(10**9)
INF = float("inf")
mod = 10**9 + 7
import numpy as np

A1 = LIST()
A2 = LIST()
A3 = LIST()
N = INT()
B = np.ones(N)
for i in range(N):
    B[i] = INT()
B = list(B)

def bingo_array(A, B):
    for i in range(3):
        for x in B:
            if A[i] == x:
                A[i] *= 0

bingo_array(A1, B)
bingo_array(A2, B)
bingo_array(A3, B)
if sum(A1) == 0 or sum(A2) == 0 or sum(A3) == 0:
    print("Yes")
elif (
    A1[0] + A2[0] + A3[0] == 0
    or A1[1] + A2[1] + A3[1] == 0
    or A1[2] + A2[2] + A3[2] == 0
):
    print("Yes")
elif A1[0] + A2[1] + A3[2] == 0 or A1[2] + A2[1] + A3[0] == 0:
    print("Yes")
else:
    print("No")

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce

def input():
    return sys.stdin.readline().strip()

def INT():
    return int(eval(input()))

def MAP():
    return list(map(int, input().split()))

def LIST():
    return list(map(int, input().split()))

sys.setrecursionlimit(10**9)
INF = float("inf")
mod = 10**9 + 7
A = [LIST() for _ in range(3)]
N = INT()
b = [INT() for _ in range(N)]
check = [[0] * 3 for _ in range(3)]
for n in b:
    for i in range(3):
        for j in range(3):
            if A[i][j] == n:
                check[i][j] = 1
for i in range(3):
    if sum(check[i]) == 3:
        print("Yes")
        exit()
for i in range(3):
    if check[0][i] and check[1][i] and check[2][i]:
        print("Yes")
        exit()
if check[0][0] and check[1][1] and check[2][2]:
    print("Yes")
    exit()
if check[0][2] and check[1][1] and check[2][0]:
    print("Yes")
    exit()
print("No")

-from itertools import accumulate, permutations, combinations, product, groupby

+from itertools import accumulate, permutations, combinations, product

-    return list(zip(*(MAP() for _ in range(n))))

+    if check[0][i] and check[1][i] and check[2][i]:

+if check[0][0] and check[1][1] and check[2][2]:

+if check[0][2] and check[1][1] and check[2][0]:


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

import sys

input = sys.stdin.readline

input = sys.stdin.buffer.readline

def RD(): return sys.stdin.read()

def II(): return int(eval(input()))

def MI(): return list(map(int,input().split()))

def LI(): return list(map(int,input().split()))

def TI(): return tuple(map(int,input().split()))

# mod=10**9+7

# rstrip().decode('utf-8')

import numpy as np

from itertools import combinations

def main():

	n,k=MI()

	ans=10**18

	A=LI()

	A=[A[0]-1]+A

	A=np.array(A)

	for t in combinations(list(range(n)),k):

		B=A.copy()

		tmp=0

		for i in t:

			i+=1

			B[i]=max(B[:i].max()+1,A[i])

			tmp+=B[i]-A[i]

		ans=min(ans,tmp)

	print(ans)

if __name__ == "__main__":

	main()

# optimized version of the same code:

import sys

input = sys.stdin.readline

input = sys.stdin.buffer.readline

def RD(): return sys.stdin.read()

def II(): return int(eval(input()))

def MI(): return list(map(int,input().split()))

def LI(): return list(map(int,input().split()))

def TI(): return tuple(map(int,input().split()))

# mod=10**9+7

# rstrip().decode('utf-8')

#import numpy as np

from itertools import combinations

def main():

	n,k=MI()

	ans=10**18

	A=LI()

	A=[A[0]-1]+A

	for t in combinations(list(range(n)),k):

		B=A.copy()

		tmp=0

		for i in t:

			i+=1

			B[i]=max(max(B[:i])+1,A[i])

			tmp+=B[i]-A[i]

		ans=min(ans,tmp)

	print(ans)

if __name__ == "__main__":

	main()

import sys

input = sys.stdin.readline
input = sys.stdin.buffer.readline

def RD():
    return sys.stdin.read()

def II():
    return int(eval(input()))

def MI():
    return list(map(int, input().split()))

def LI():
    return list(map(int, input().split()))

def TI():
    return tuple(map(int, input().split()))

# mod=10**9+7
# rstrip().decode('utf-8')
import numpy as np
from itertools import combinations

def main():
    n, k = MI()
    ans = 10**18
    A = LI()
    A = [A[0] - 1] + A
    A = np.array(A)
    for t in combinations(list(range(n)), k):
        B = A.copy()
        tmp = 0
        for i in t:
            i += 1
            B[i] = max(B[:i].max() + 1, A[i])
            tmp += B[i] - A[i]
        ans = min(ans, tmp)
    print(ans)

if __name__ == "__main__":
    main()

import sys

input = sys.stdin.readline
input = sys.stdin.buffer.readline

def RD():
    return sys.stdin.read()

def II():
    return int(eval(input()))

def MI():
    return list(map(int, input().split()))

def LI():
    return list(map(int, input().split()))

def TI():
    return tuple(map(int, input().split()))

# mod=10**9+7
# rstrip().decode('utf-8')
# import numpy as np
from itertools import combinations

def main():
    n, k = MI()
    ans = 10**18
    A = LI()
    A = [A[0] - 1] + A
    for t in combinations(list(range(n)), k):
        B = A.copy()
        tmp = 0
        for i in t:
            i += 1
            B[i] = max(max(B[:i]) + 1, A[i])
            tmp += B[i] - A[i]
        ans = min(ans, tmp)
    print(ans)

if __name__ == "__main__":
    main()


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

import numpy as np

n = int(eval(input()))

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

alice_point = 0

bob_point = 0

for i in range(n):

    argmax_a = np.argmax(a_list)

    max_a = np.max(a_list)

    if i % 2 == 0: # If Alice takes a card

        alice_point += max_a

    else: # If Bob takes a card

        bob_point += max_a

    del a_list[argmax_a] # No confidence -> Review how to delete list element!

print((alice_point - bob_point))

# optimized version of the same code:

n = int(eval(input()))

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

a_list = sorted(a_list, reverse=True)

alice_point = 0

bob_point = 0

for i in range(n):

    if i % 2 == 0:

        alice_point += a_list[i]

    else:

        bob_point += a_list[i]

print((alice_point - bob_point))

-    if i % 2 == 0:  # If Alice takes a card

-    del a_list[argmax_a]  # No confidence -> Review how to delete list element!


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

import math

def main():

    N = int(eval(input()))

    power = math.factorial(N)

    print((power % (10 ** 9 + 7)))

if __name__ == "__main__":

    main()

# optimized version of the same code:

def main():

    N = int(eval(input()))

    power = 1

    for i in range(1, N + 1):

        power *= i

        power %= 10 ** 9 + 7

    print(power)

if __name__ == "__main__":

    main()

import math

def main():
    N = int(eval(input()))
    power = math.factorial(N)
    print((power % (10**9 + 7)))

if __name__ == "__main__":
    main()

def main():
    N = int(eval(input()))
    power = 1
    for i in range(1, N + 1):
        power *= i
        power %= 10**9 + 7
    print(power)

if __name__ == "__main__":
    main()

-import math
-    power = math.factorial(N)
-    print((power % (10**9 + 7)))
+    power = 1
+    for i in range(1, N + 1):
+        power *= i
+        power %= 10**9 + 7
+    print(power)


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

def post_from_pre_in(preorder_elements, inorder_elements):

    if preorder_elements:

        global cnt

        root = preorder_elements[0]

        root_index = inorder_elements.index(root)

        preorder_left = preorder_elements[1:root_index+1]

        inorder_left = inorder_elements[:root_index]

        preorder_right = preorder_elements[root_index+1:]

        inorder_right = inorder_elements[root_index+1:]

        post_from_pre_in(preorder_left, inorder_left)

        post_from_pre_in(preorder_right, inorder_right)

        if cnt:

            print(root, end = ' ')

            cnt -= 1

        else:

            print(root)

cnt = int(input()) - 1

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

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

post_from_pre_in(a, b)

# optimized version of the same code:

postorder_elements = []

def post_from_pre_in(preorder_elements, inorder_elements):

    if preorder_elements:

        root = preorder_elements[0]

        root_index = inorder_elements.index(root)

        preorder_left = preorder_elements[1:root_index+1]

        inorder_left = inorder_elements[:root_index]

        preorder_right = preorder_elements[root_index+1:]

        inorder_right = inorder_elements[root_index+1:]

        post_from_pre_in(preorder_left, inorder_left)

        post_from_pre_in(preorder_right, inorder_right)

        postorder_elements.append(root)

n = int(eval(input()))

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

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

post_from_pre_in(a, b)

print((*postorder_elements))

def post_from_pre_in(preorder_elements, inorder_elements):
    if preorder_elements:
        global cnt
        root = preorder_elements[0]
        root_index = inorder_elements.index(root)
        preorder_left = preorder_elements[1 : root_index + 1]
        inorder_left = inorder_elements[:root_index]
        preorder_right = preorder_elements[root_index + 1 :]
        inorder_right = inorder_elements[root_index + 1 :]
        post_from_pre_in(preorder_left, inorder_left)
        post_from_pre_in(preorder_right, inorder_right)
        if cnt:
            print(root, end=" ")
            cnt -= 1
        else:
            print(root)

cnt = int(input()) - 1
a = list(map(int, input().split()))
b = list(map(int, input().split()))
post_from_pre_in(a, b)

postorder_elements = []

def post_from_pre_in(preorder_elements, inorder_elements):
    if preorder_elements:
        root = preorder_elements[0]
        root_index = inorder_elements.index(root)
        preorder_left = preorder_elements[1 : root_index + 1]
        inorder_left = inorder_elements[:root_index]
        preorder_right = preorder_elements[root_index + 1 :]
        inorder_right = inorder_elements[root_index + 1 :]
        post_from_pre_in(preorder_left, inorder_left)
        post_from_pre_in(preorder_right, inorder_right)
        postorder_elements.append(root)

n = int(eval(input()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
post_from_pre_in(a, b)
print((*postorder_elements))

+        postorder_elements.append(root)


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

def main():

	x, y, z, k = list(map(int, input().split()))

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

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

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

	d = [0]*x*y

	for i in range(x):

		for j in range(y):

			d[i*y+j] = a[i]+b[j]

	d.sort(reverse=True)

	c.sort(reverse=True)

	c_len = min(k, z)

	d_len = min(k, x*y)

	e = [0]*d_len*c_len

	for i in range(d_len):

		for j in range(c_len):

			e[i*c_len+j] = d[i] + c[j]

	e.sort(reverse=True)

	for i in range(k):

		print((e[i]))

if __name__ == '__main__':

    main()

# optimized version of the same code:

def main():

	x, y, z, k = list(map(int, input().split()))

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

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

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

	solve(a, b, c, x, y, z, k)

def solve(a, b, c, x, y, z, k):

	a.sort(reverse=True)

	b.sort(reverse=True)

	c.sort(reverse=True)

	stack = list()

	for p in range(x):

		for q in range(y):

			if (p+1)*(q+1) > k:

				break

			for r in range(z):

				if (p+1)*(q+1)*(r+1) > k:

					break

				stack.append(a[p]+b[q]+c[r])

	stack.sort(reverse=True)

	for i in range(k):

		print((stack[i]))

if __name__ == '__main__':

    main()

def main():
    x, y, z, k = list(map(int, input().split()))
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    c = list(map(int, input().split()))
    d = [0] * x * y
    for i in range(x):
        for j in range(y):
            d[i * y + j] = a[i] + b[j]
    d.sort(reverse=True)
    c.sort(reverse=True)
    c_len = min(k, z)
    d_len = min(k, x * y)
    e = [0] * d_len * c_len
    for i in range(d_len):
        for j in range(c_len):
            e[i * c_len + j] = d[i] + c[j]
    e.sort(reverse=True)
    for i in range(k):
        print((e[i]))

if __name__ == "__main__":
    main()

def main():
    x, y, z, k = list(map(int, input().split()))
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    c = list(map(int, input().split()))
    solve(a, b, c, x, y, z, k)

def solve(a, b, c, x, y, z, k):
    a.sort(reverse=True)
    b.sort(reverse=True)
    c.sort(reverse=True)
    stack = list()
    for p in range(x):
        for q in range(y):
            if (p + 1) * (q + 1) > k:
                break
            for r in range(z):
                if (p + 1) * (q + 1) * (r + 1) > k:
                    break
                stack.append(a[p] + b[q] + c[r])
    stack.sort(reverse=True)
    for i in range(k):
        print((stack[i]))

if __name__ == "__main__":
    main()

+                stack.append(a[p] + b[q] + c[r])


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

from math import sqrt

from bisect import bisect_left

def circle_center(x1, y1, x2, y2):

    xd = x2 - x1; yd = y2 - y1

    d = xd**2 + yd**2

    k = sqrt((4.0 - d) / d) / 2.0

    xc = (x1 + x2) / 2.0

    yc = (y1 + y2) / 2.0

    return [[xc - k*yd, yc + k*xd], [xc + k*yd, yc - k*xd]]

while 1:

    n = int(input())

    if n==0: break

    p = [list(map(float, input().split())) for i in range(n)]

    p.sort()

    prev = 0

    ans = 1

    for i in range(n):

        bx, by = p[i]

        while bx - p[prev][0] >= 2.0: prev += 1

        for j in range(i+1, n):

            cx, cy = p[j]

            if cx - bx >= 2.0: break

            if (bx - cx)**2 + (by - cy)**2 <= 4.0:

                for ex, ey in circle_center(bx, by, cx, cy):

                    count = 2

                    for k in range(prev, n):

                        if k==i or k==j: continue

                        dx, dy = p[k]

                        if dx - bx >= 2.0: break

                        if (ex - dx)**2 + (ey - dy)**2 <= 1.0:

                            count += 1

                    ans = max(ans, count)

    print(ans)

# optimized version of the same code:

from math import sqrt

from bisect import bisect_left

def circle_center(x1, y1, x2, y2):

    xd = x2 - x1; yd = y2 - y1

    d = xd**2 + yd**2

    k = sqrt((4.0 - d) / d) / 2.0

    xc = (x1 + x2) / 2.0; yc = (y1 + y2) / 2.0

    xd *= k; yd *= k

    return [[xc - yd, yc + xd], [xc + yd, yc - xd]]

while 1:

    n = int(input())

    if n==0: break

    p = sorted(list(map(float, input().split())) for i in range(n))

    prev = 0

    ans = 1

    for i in range(n):

        bx, by = p[i]

        while bx - p[prev][0] >= 2.0: prev += 1

        for j in range(i+1, n):

            cx, cy = p[j]

            if cx - bx >= 2.0: break

            if (bx - cx)**2 + (by - cy)**2 <= 4.0:

                for ex, ey in circle_center(bx, by, cx, cy):

                    count = 2

                    for k in range(prev, n):

                        if k==i or k==j: continue

                        dx, dy = p[k]

                        if dx - ex >= 1.0: break

                        if (ex - dx)**2 + (ey - dy)**2 <= 1.0:

                            count += 1

                    ans = max(ans, count)

    print(ans)

from math import sqrt
from bisect import bisect_left

def circle_center(x1, y1, x2, y2):
    xd = x2 - x1
    yd = y2 - y1
    d = xd**2 + yd**2
    k = sqrt((4.0 - d) / d) / 2.0
    xc = (x1 + x2) / 2.0
    yc = (y1 + y2) / 2.0
    return [[xc - k * yd, yc + k * xd], [xc + k * yd, yc - k * xd]]

while 1:
    n = int(input())
    if n == 0:
        break
    p = [list(map(float, input().split())) for i in range(n)]
    p.sort()
    prev = 0
    ans = 1
    for i in range(n):
        bx, by = p[i]
        while bx - p[prev][0] >= 2.0:
            prev += 1
        for j in range(i + 1, n):
            cx, cy = p[j]
            if cx - bx >= 2.0:
                break
            if (bx - cx) ** 2 + (by - cy) ** 2 <= 4.0:
                for ex, ey in circle_center(bx, by, cx, cy):
                    count = 2
                    for k in range(prev, n):
                        if k == i or k == j:
                            continue
                        dx, dy = p[k]
                        if dx - bx >= 2.0:
                            break
                        if (ex - dx) ** 2 + (ey - dy) ** 2 <= 1.0:
                            count += 1
                    ans = max(ans, count)
    print(ans)

from math import sqrt
from bisect import bisect_left

def circle_center(x1, y1, x2, y2):
    xd = x2 - x1
    yd = y2 - y1
    d = xd**2 + yd**2
    k = sqrt((4.0 - d) / d) / 2.0
    xc = (x1 + x2) / 2.0
    yc = (y1 + y2) / 2.0
    xd *= k
    yd *= k
    return [[xc - yd, yc + xd], [xc + yd, yc - xd]]

while 1:
    n = int(input())
    if n == 0:
        break
    p = sorted(list(map(float, input().split())) for i in range(n))
    prev = 0
    ans = 1
    for i in range(n):
        bx, by = p[i]
        while bx - p[prev][0] >= 2.0:
            prev += 1
        for j in range(i + 1, n):
            cx, cy = p[j]
            if cx - bx >= 2.0:
                break
            if (bx - cx) ** 2 + (by - cy) ** 2 <= 4.0:
                for ex, ey in circle_center(bx, by, cx, cy):
                    count = 2
                    for k in range(prev, n):
                        if k == i or k == j:
                            continue
                        dx, dy = p[k]
                        if dx - ex >= 1.0:
                            break
                        if (ex - dx) ** 2 + (ey - dy) ** 2 <= 1.0:
                            count += 1
                    ans = max(ans, count)
    print(ans)

-    return [[xc - k * yd, yc + k * xd], [xc + k * yd, yc - k * xd]]

+    return [[xc - yd, yc + xd], [xc + yd, yc - xd]]

-    p = [list(map(float, input().split())) for i in range(n)]

+    p = sorted(list(map(float, input().split())) for i in range(n))


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

x = int(eval(input()))

for i in range(-200,200,1):

    for j in range(-200,200,1):

        if i**5-j**5==x:

          print((i,j))

          exit()

# optimized version of the same code:

import sys

x = int(eval(input()))

for i in range(-159,159,1):

    for j in range(-159,159,1):

        if i**5 - j**5 == x:

            print((str(i)+' '+str(j)))

            sys.exit()

x = int(eval(input()))
for i in range(-200, 200, 1):
    for j in range(-200, 200, 1):
        if i**5 - j**5 == x:
            print((i, j))
            exit()

import sys

x = int(eval(input()))
for i in range(-159, 159, 1):
    for j in range(-159, 159, 1):
        if i**5 - j**5 == x:
            print((str(i) + " " + str(j)))
            sys.exit()

+            print((str(i) + " " + str(j)))


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

# import numpy as np

# import numpypy as np

import sys

input = sys.stdin.readline

def eprint(*args, **kwargs):

    print(*args, file=sys.stderr, **kwargs)

    return

import math

import string

import fractions

from fractions import Fraction

from fractions import gcd

def lcm(n,m):

    return int(n*m/gcd(n,m))

import re

import array

import copy

import functools

import operator

import collections

import itertools

import bisect

import heapq

from heapq import heappush

from heapq import heappop

from heapq import heappushpop

from heapq import heapify

from heapq import heapreplace

from queue import PriorityQueue as pq

def reduce(p, q):

    common = fractions.gcd(p, q)

    return (p//common , q//common )

# from itertools import accumulate

# from collections import deque

import random

def main():

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

    ll=input().strip()

    l=[0 for i in range(4)]

    for i in range(len(l)):

        l[i]=int(ll[i])

    NUM_CASE=3

    for case in range(2**NUM_CASE):

        # eprint("case : " + str(case))

        sum=l[0]

        stack=[]

        S=""

        for index in range(NUM_CASE):

            if (case>>index) & 1 == 1:

                # eprint("l[%d] : %d" % (index+1,l[index+1]) )

                sum+=l[index+1]

                stack.append("+")

            else:

                # eprint("l[%d] : %d" % (index+1,l[index+1]) )

                sum-=l[index+1]

                stack.append("-")

        # eprint("sum : " + str(sum))

        if sum==7:

            for i in range(4):

                S+=str(l[i])

                if i!=3:

                    S+=str(stack[i])

            S+="=7"

            print(S)

            return

    return

if __name__ == '__main__':

    main()

# optimized version of the same code:

# import numpy as np

# import numpypy as np

import sys

input = sys.stdin.readline

def eprint(*args, **kwargs):

    print(*args, file=sys.stderr, **kwargs)

    return

# import math

# import string

# import fractions

# from fractions import Fraction

# from fractions import gcd

# def lcm(n,m):

#     return int(n*m/gcd(n,m))

# import re

# import array

# import copy

# import functools

# import operator

# import collections

# import itertools

# import bisect

# import heapq

# from heapq import heappush

# from heapq import heappop

# from heapq import heappushpop

# from heapq import heapify

# from heapq import heapreplace

# from queue import PriorityQueue as pq

# def reduce(p, q):

#     common = fractions.gcd(p, q)

#     return (p//common , q//common )

# # from itertools import accumulate

# # from collections import deque

# from operator import mul

# from functools import reduce

# def combinations_count(n, r):

#     r = min(r, n - r)

#     numer = reduce(mul, range(n, n - r, -1), 1)

#     denom = reduce(mul, range(1, r + 1), 1)

#     return numer // denom

# import random

def main():

    # a,b,c,d = map(int, input().strip().split())

    l_abcd = list(map(int,input().strip()))

    eprint("l_abcd ",end=": ")

    eprint(l_abcd)

    for case in range(2 ** 3):     # 場合ループ # nは人とかモノとかの個数

        l_op_bin = list(map(int,(format(case,'b').zfill(3))))

        # eprint("l_op_bin ",end=": ")

        # eprint(l_op_bin)

        #flag=0

        sum_x=l_abcd[0]

        l_op=[]

        for index_location in range(3):      # 人とかモノとかループ

            if l_op_bin[index_location]==1:                   # その桁がyesだと仮定している場合

               sum_x += l_abcd[1+index_location]

               l_op.append("+")

            else:                                 # その桁がnoだと仮定している場合

               sum_x -= l_abcd[1+index_location]

               l_op.append("-")

        if sum_x==7:

            print(l_abcd[0], end="")

            print(l_op[0],end="")

            print(l_abcd[1], end="")

            print(l_op[1],end="")

            print(l_abcd[2], end="")

            print(l_op[2],end="")

            print(l_abcd[3], end="=7\n")

            return

if __name__ == '__main__':

    main()

# import numpy as np
# import numpypy as np
import sys

input = sys.stdin.readline

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return

import math
import string
import fractions
from fractions import Fraction
from fractions import gcd

def lcm(n, m):
    return int(n * m / gcd(n, m))

import re
import array
import copy
import functools
import operator
import collections
import itertools
import bisect
import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq

def reduce(p, q):
    common = fractions.gcd(p, q)
    return (p // common, q // common)

# from itertools import accumulate
# from collections import deque
import random

def main():
    # l = list(map(int, input().split()))
    ll = input().strip()
    l = [0 for i in range(4)]
    for i in range(len(l)):
        l[i] = int(ll[i])
    NUM_CASE = 3
    for case in range(2**NUM_CASE):
        # eprint("case : " + str(case))
        sum = l[0]
        stack = []
        S = ""
        for index in range(NUM_CASE):
            if (case >> index) & 1 == 1:
                # eprint("l[%d] : %d" % (index+1,l[index+1]) )
                sum += l[index + 1]
                stack.append("+")
            else:
                # eprint("l[%d] : %d" % (index+1,l[index+1]) )
                sum -= l[index + 1]
                stack.append("-")
        # eprint("sum : " + str(sum))
        if sum == 7:
            for i in range(4):
                S += str(l[i])
                if i != 3:
                    S += str(stack[i])
            S += "=7"
            print(S)
            return
    return

if __name__ == "__main__":
    main()

# import numpy as np
# import numpypy as np
import sys

input = sys.stdin.readline

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return

# import math
# import string
# import fractions
# from fractions import Fraction
# from fractions import gcd
# def lcm(n,m):
#     return int(n*m/gcd(n,m))
# import re
# import array
# import copy
# import functools
# import operator
# import collections
# import itertools
# import bisect
# import heapq
# from heapq import heappush
# from heapq import heappop
# from heapq import heappushpop
# from heapq import heapify
# from heapq import heapreplace
# from queue import PriorityQueue as pq
# def reduce(p, q):
#     common = fractions.gcd(p, q)
#     return (p//common , q//common )
# # from itertools import accumulate
# # from collections import deque
# from operator import mul
# from functools import reduce
# def combinations_count(n, r):
#     r = min(r, n - r)
#     numer = reduce(mul, range(n, n - r, -1), 1)
#     denom = reduce(mul, range(1, r + 1), 1)
#     return numer // denom
# import random
def main():
    # a,b,c,d = map(int, input().strip().split())
    l_abcd = list(map(int, input().strip()))
    eprint("l_abcd ", end=": ")
    eprint(l_abcd)
    for case in range(2**3):  # 場合ループ # nは人とかモノとかの個数
        l_op_bin = list(map(int, (format(case, "b").zfill(3))))
        # eprint("l_op_bin ",end=": ")
        # eprint(l_op_bin)
        # flag=0
        sum_x = l_abcd[0]
        l_op = []
        for index_location in range(3):  # 人とかモノとかループ
            if l_op_bin[index_location] == 1:  # その桁がyesだと仮定している場合
                sum_x += l_abcd[1 + index_location]
                l_op.append("+")
            else:  # その桁がnoだと仮定している場合
                sum_x -= l_abcd[1 + index_location]
                l_op.append("-")
        if sum_x == 7:
            print(l_abcd[0], end="")
            print(l_op[0], end="")
            print(l_abcd[1], end="")
            print(l_op[1], end="")
            print(l_abcd[2], end="")
            print(l_op[2], end="")
            print(l_abcd[3], end="=7\n")
            return

if __name__ == "__main__":
    main()

+# from queue import PriorityQueue as pq

+#     numer = reduce(mul, range(n, n - r, -1), 1)

+#     denom = reduce(mul, range(1, r + 1), 1)

-    # l = list(map(int, input().split()))

-        # eprint("case : " + str(case))

-            if (case >> index) & 1 == 1:

+    # a,b,c,d = map(int, input().strip().split())

+    l_abcd = list(map(int, input().strip()))

+    for case in range(2**3):  # 場合ループ # nは人とかモノとかの個数

+        l_op_bin = list(map(int, (format(case, "b").zfill(3))))

+        for index_location in range(3):  # 人とかモノとかループ

+            if l_op_bin[index_location] == 1:  # その桁がyesだと仮定している場合

+                sum_x += l_abcd[1 + index_location]

+            else:  # その桁がnoだと仮定している場合

+                sum_x -= l_abcd[1 + index_location]

+            print(l_abcd[3], end="=7\n")


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

import sys

def input(): return sys.stdin.readline().strip()

def resolve():

    import math

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

    cmax=max(x,y)*2

    l=[]

    for i in range(cmax+1):

        amai = max(math.ceil(x - 0.5 * i),0)

        bmai = max(math.ceil(y - 0.5 * i),0)

        l.append(amai*a+bmai*b+i*c)

    print((min(l)))

resolve()

# optimized version of the same code:

import sys

def input(): return sys.stdin.readline().strip()

def resolve():

    import math

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

    # ABピザを奇数枚買っても1枚無駄になるから、ABピザは2枚を1枚だと考える

    # cの値段を2倍にして枚数を半分に

    cmax=max(x,y) # ABピザの最大枚数(2枚を1枚と考えたとき)

    c=2*c

    l=[]

    for i in range(cmax+1):

        amai = max(x - i,0)

        bmai = max(y - i,0)

        l.append(amai*a+bmai*b+i*c)

    print((min(l)))

resolve()

import sys

def input():
    return sys.stdin.readline().strip()

def resolve():
    import math

    a, b, c, x, y = list(map(int, input().split()))
    cmax = max(x, y) * 2
    l = []
    for i in range(cmax + 1):
        amai = max(math.ceil(x - 0.5 * i), 0)
        bmai = max(math.ceil(y - 0.5 * i), 0)
        l.append(amai * a + bmai * b + i * c)
    print((min(l)))

resolve()

import sys

def input():
    return sys.stdin.readline().strip()

def resolve():
    import math

    a, b, c, x, y = list(map(int, input().split()))
    # ABピザを奇数枚買っても1枚無駄になるから、ABピザは2枚を1枚だと考える
    # cの値段を2倍にして枚数を半分に
    cmax = max(x, y)  # ABピザの最大枚数(2枚を1枚と考えたとき)
    c = 2 * c
    l = []
    for i in range(cmax + 1):
        amai = max(x - i, 0)
        bmai = max(y - i, 0)
        l.append(amai * a + bmai * b + i * c)
    print((min(l)))

resolve()

+    # ABピザを奇数枚買っても1枚無駄になるから、ABピザは2枚を1枚だと考える

+    # cの値段を2倍にして枚数を半分に

+    cmax = max(x, y)  # ABピザの最大枚数(2枚を1枚と考えたとき)

-        amai = max(math.ceil(x - 0.5 * i), 0)

-        bmai = max(math.ceil(y - 0.5 * i), 0)


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

def solve():

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

  _S = eval(input())

  S = []

  b = _S[0]

  s = 0

  if b == '0': S.append(0)

  for _s in _S:

    if b == _s:

      s = s + 1

    else:

      b = _s

      S.append(s)

      s = 1

  S.append(s)

  if b == '0': S.append(0)

  num = min(len(S), 2 * K + 1)

  # n = sum(S[0:num if _S[0] == '1' else (num - 1)])

  n = sum(S[0:num])

  m = n

  # for i in range(0 if _S[0] == '1' else -1, len(S) - num, 2):

  for i in range(0, len(S) - num, 2):

    n = n - sum(S[i:i+2])

    n = n + sum(S[i + num:i + num + 2])

    m = max(m, n)

  return m

print((solve()))

# optimized version of the same code:

def solve():

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

  s = eval(input())

  S = []

  b = s[0]

  cnt = 0

  if s[0] == '0': S.append(0)

  for c in s:

    if b == c: cnt = cnt + 1

    else:

      b = c

      S.append(cnt)

      cnt = 1

  S.append(cnt)

  if s[-1] == '0': S.append(0)

  num = min(len(S), 2 * K + 1)

  part = sum(S[0:num])

  ans = part

  for i in range(0, len(S) - num, 2):

    part = part - sum(S[i:i+2]) + sum(S[i + num:i + num + 2])

    ans = max(ans, part)

  return ans

print((solve()))

def solve():
    N, K = list(map(int, input().split()))
    _S = eval(input())
    S = []
    b = _S[0]
    s = 0
    if b == "0":
        S.append(0)
    for _s in _S:
        if b == _s:
            s = s + 1
        else:
            b = _s
            S.append(s)
            s = 1
    S.append(s)
    if b == "0":
        S.append(0)
    num = min(len(S), 2 * K + 1)
    # n = sum(S[0:num if _S[0] == '1' else (num - 1)])
    n = sum(S[0:num])
    m = n
    # for i in range(0 if _S[0] == '1' else -1, len(S) - num, 2):
    for i in range(0, len(S) - num, 2):
        n = n - sum(S[i : i + 2])
        n = n + sum(S[i + num : i + num + 2])
        m = max(m, n)
    return m

print((solve()))

def solve():
    N, K = list(map(int, input().split()))
    s = eval(input())
    S = []
    b = s[0]
    cnt = 0
    if s[0] == "0":
        S.append(0)
    for c in s:
        if b == c:
            cnt = cnt + 1
        else:
            b = c
            S.append(cnt)
            cnt = 1
    S.append(cnt)
    if s[-1] == "0":
        S.append(0)
    num = min(len(S), 2 * K + 1)
    part = sum(S[0:num])
    ans = part
    for i in range(0, len(S) - num, 2):
        part = part - sum(S[i : i + 2]) + sum(S[i + num : i + num + 2])
        ans = max(ans, part)
    return ans

print((solve()))

-    # for i in range(0 if _S[0] == '1' else -1, len(S) - num, 2):

-        n = n + sum(S[i + num : i + num + 2])

+        part = part - sum(S[i : i + 2]) + sum(S[i + num : i + num + 2])


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

import math

N = int(eval(input()))

ans = math.factorial(N) % (10 ** 9 + 7)

print(ans)

# optimized version of the same code:

n = int(eval(input()))

from functools import reduce

print((reduce(lambda x,y:x*y%1000000007,list(range(1,n+1)))))

import math

N = int(eval(input()))
ans = math.factorial(N) % (10**9 + 7)
print(ans)

n = int(eval(input()))
from functools import reduce

print((reduce(lambda x, y: x * y % 1000000007, list(range(1, n + 1)))))

+print((reduce(lambda x, y: x * y % 1000000007, list(range(1, n + 1)))))


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

#python3

INF = int(1e9)

def main():

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

    ans = INF

    for i in range(2*10**5+100):

        t = 2*c*i + max(x-i, 0) * a + max(y-i, 0) * b

        ans = min(ans, t)

    print(ans)

main()

# optimized version of the same code:

INF = int(1e5)+5

def main():

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

    ans = INF*INF

    for i in range(INF):

        tmp = 2*i*c + a*max(x-i, 0) + b*max(y-i, 0)

        ans = min(tmp, ans)

    print(ans)

main()

# python3
INF = int(1e9)

def main():
    a, b, c, x, y = list(map(int, input().split()))
    ans = INF
    for i in range(2 * 10**5 + 100):
        t = 2 * c * i + max(x - i, 0) * a + max(y - i, 0) * b
        ans = min(ans, t)
    print(ans)

main()

INF = int(1e5) + 5

def main():
    a, b, c, x, y = list(map(int, input().split()))
    ans = INF * INF
    for i in range(INF):
        tmp = 2 * i * c + a * max(x - i, 0) + b * max(y - i, 0)
        ans = min(tmp, ans)
    print(ans)

main()


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

from functools import reduce

N = int(eval(input()))

prime_table = [1] * (N+1)

for x in range(2, N+1):

    for t in range(2, x+1):

        while x % t == 0:

            prime_table[t] += 1

            x //= t

print((reduce(lambda x, y: x * y % (int(1e9) + 7), prime_table)))

# optimized version of the same code:

def prime_factorize(n):

    while n % 2 == 0:

        a[2] += 1

        n //= 2

    f = 3

    while f * f <= n:

        if n % f == 0:

            a[f] += 1

            n //= f

        else:

            f += 2

    if n != 1:

        a[n] += 1

N = int(eval(input()))

a = [0]*(N+1)

for i in range(2, N+1):

    prime_factorize(i)

ans = 1

for i in a:

    if i > 0:

        ans *= (i+1)

big = 10**9 + 7

print((ans % big))

from functools import reduce

N = int(eval(input()))
prime_table = [1] * (N + 1)
for x in range(2, N + 1):
    for t in range(2, x + 1):
        while x % t == 0:
            prime_table[t] += 1
            x //= t
print((reduce(lambda x, y: x * y % (int(1e9) + 7), prime_table)))

def prime_factorize(n):
    while n % 2 == 0:
        a[2] += 1
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a[f] += 1
            n //= f
        else:
            f += 2
    if n != 1:
        a[n] += 1

N = int(eval(input()))
a = [0] * (N + 1)
for i in range(2, N + 1):
    prime_factorize(i)
ans = 1
for i in a:
    if i > 0:
        ans *= i + 1
big = 10**9 + 7
print((ans % big))

-print((reduce(lambda x, y: x * y % (int(1e9) + 7), prime_table)))


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

import numpy as np

n = int(eval(input()))

T = []

X = []

Y = []

t1 = 0

x1 = 0

y1 = 0

for i in range(n):

    m = input().split()

    T.append(int(m[0]) - t1)

    t1 = int(m[0])

    X.append(abs(int(m[1]) - x1))

    x1 = int(m[1])

    Y.append(abs(int(m[2]) - y1))

    y1 = int(m[2])

T = np.array(T)

X = np.array(X)

Y = np.array(Y)

for i in range(n):

    if X[i] + Y[i] > T[i] or (X[i] + Y[i] + T[i]) % 2 == 1:

        print('No')

        break

else:

    print('Yes')

# optimized version of the same code:

n = int(eval(input()))

t1 = 0

x1 = 0

y1 = 0

boolean = True

for __ in range(n):

    t, x, y = [int(_) for _ in input().split()]

    if boolean:

        temp1 = x

        temp2 = t

        x = abs(x - x1) + abs(y - y1)

        t -= t1

        x1 = temp1

        y1 = y

        t1 = temp2

        if x > t or (x + t) % 2 == 1:

            boolean = False

if boolean:

    print('Yes')

else:

    print('No')

import numpy as np

n = int(eval(input()))
T = []
X = []
Y = []
t1 = 0
x1 = 0
y1 = 0
for i in range(n):
    m = input().split()
    T.append(int(m[0]) - t1)
    t1 = int(m[0])
    X.append(abs(int(m[1]) - x1))
    x1 = int(m[1])
    Y.append(abs(int(m[2]) - y1))
    y1 = int(m[2])
T = np.array(T)
X = np.array(X)
Y = np.array(Y)
for i in range(n):
    if X[i] + Y[i] > T[i] or (X[i] + Y[i] + T[i]) % 2 == 1:
        print("No")
        break
else:
    print("Yes")

n = int(eval(input()))
t1 = 0
x1 = 0
y1 = 0
boolean = True
for __ in range(n):
    t, x, y = [int(_) for _ in input().split()]
    if boolean:
        temp1 = x
        temp2 = t
        x = abs(x - x1) + abs(y - y1)
        t -= t1
        x1 = temp1
        y1 = y
        t1 = temp2
        if x > t or (x + t) % 2 == 1:
            boolean = False
if boolean:
    print("Yes")
else:
    print("No")

+    t, x, y = [int(_) for _ in input().split()]


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

K,S = list(map(int,input().split(" ")))

ans = 0

for i in range(K+1):

	for j in range(K+1):

		if (S - i - j) <= K and (S-i-j) >= 0:

			ans += 1

print(ans)

# optimized version of the same code:

K, S = list(map(int,input().split(" ")))

ans = 0

for X in range(K+1):

    for Y in range(K+1):

        if 0 <= (S - X - Y) <= K:

            ans += 1

print(ans)

K, S = list(map(int, input().split(" ")))
ans = 0
for i in range(K + 1):
    for j in range(K + 1):
        if (S - i - j) <= K and (S - i - j) >= 0:
            ans += 1
print(ans)

K, S = list(map(int, input().split(" ")))
ans = 0
for X in range(K + 1):
    for Y in range(K + 1):
        if 0 <= (S - X - Y) <= K:
            ans += 1
print(ans)


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

while 1:

    ans=0

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

    if n:

        for i in range(1,n-1):

            for j in range(i+1,n):

                for k in range(j+1,n+1):

                    if i+j+k==x:ans+=1

    else:break

    print(ans)

# optimized version of the same code:

while 1:

    a=0

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

    if n==0:break

    for i in range(1,n-1):

        for j in range(i+1,n):

            c=x-i-j

            if c>j and c<=n:a+=1

    print(a)

while 1:
    ans = 0
    n, x = list(map(int, input().split()))
    if n:
        for i in range(1, n - 1):
            for j in range(i + 1, n):
                for k in range(j + 1, n + 1):
                    if i + j + k == x:
                        ans += 1
    else:
        break
    print(ans)

while 1:
    a = 0
    n, x = list(map(int, input().split()))
    if n == 0:
        break
    for i in range(1, n - 1):
        for j in range(i + 1, n):
            c = x - i - j
            if c > j and c <= n:
                a += 1
    print(a)

-                for k in range(j + 1, n + 1):


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

x = int(eval(input()))

a = 0

b = 0

for i in range(-200, 200):

    for j in range(-200, 200):

        if i ** 5 - j ** 5 == x:

            a = i

            b = j

print((a, b))

# optimized version of the same code:

x = int(eval(input()))

a = 0

b = 0

for i in range(-120, 120):

    for j in range(-120, 120):

        if i ** 5 - j ** 5 == x:

            a = i

            b = j

print((a, b))

x = int(eval(input()))
a = 0
b = 0
for i in range(-200, 200):
    for j in range(-200, 200):
        if i**5 - j**5 == x:
            a = i
            b = j
print((a, b))

x = int(eval(input()))
a = 0
b = 0
for i in range(-120, 120):
    for j in range(-120, 120):
        if i**5 - j**5 == x:
            a = i
            b = j
print((a, b))


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

def main():

  from statistics import mean

  from math import floor,ceil

  n = int(eval(input()))

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

  x_mean = mean(x)

  if x_mean == 0.5:

      greater_than_x = len([i for i in x if i > x_mean])

      if greater_than_x * 2 >= n:

          x_mean = ceil(x_mean)

      else:

          x_mean = floor(x_mean)

  elif x_mean % 1 > 0.5:

      x_mean = ceil(x_mean)

  else:

      x_mean = floor(x_mean)

  x2 = [(num - x_mean)**2 for num in x]

  print((sum(x2)))

main()

# optimized version of the same code:

import sys

read = sys.stdin.read

def main():

    n, *x = list(map(int, read().split()))

    r = float('inf')

    for i1 in range(1, 101):

        rt = 0

        for xe in x:

            rt += (xe - i1)**2

        r = min(r, rt)

    print(r)

if __name__ == '__main__':

    main()

def main():
    from statistics import mean
    from math import floor, ceil

    n = int(eval(input()))
    x = list(map(int, input().split()))
    x_mean = mean(x)
    if x_mean == 0.5:
        greater_than_x = len([i for i in x if i > x_mean])
        if greater_than_x * 2 >= n:
            x_mean = ceil(x_mean)
        else:
            x_mean = floor(x_mean)
    elif x_mean % 1 > 0.5:
        x_mean = ceil(x_mean)
    else:
        x_mean = floor(x_mean)
    x2 = [(num - x_mean) ** 2 for num in x]
    print((sum(x2)))

main()

import sys

read = sys.stdin.read

def main():
    n, *x = list(map(int, read().split()))
    r = float("inf")
    for i1 in range(1, 101):
        rt = 0
        for xe in x:
            rt += (xe - i1) ** 2
        r = min(r, rt)
    print(r)

if __name__ == "__main__":
    main()

-    x = list(map(int, input().split()))

-        greater_than_x = len([i for i in x if i > x_mean])

-    x2 = [(num - x_mean) ** 2 for num in x]

+    n, *x = list(map(int, read().split()))


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

import sys

sys.setrecursionlimit(10 ** 6)

def solve():

    S = eval(input())

    # print(S, len(S))

    words = {0: "dream", 1: "dreamer", 2: "erase", 3: "eraser"}

    TABLE = [[-1 for x in range(len(S) + 1)] for y in range(len(words) + 1)]

    def recur(i, w):

        if not TABLE[w][i] == -1:

            return TABLE[w][i]

        if i >= len(S):

            # print("jey", log)

            return True

        r1, r2, r3, r4 = False, False, False, False

        if S[i:i + 5] == words[0]:

            r1 = recur(i + 5, 0)

        if S[i:i + 7] == words[1]:

            r2 = recur(i + 7, 1)

        if S[i:i + 5] == words[2]:

            r3 = recur(i + 5, 2)

        if S[i:i + 6] == words[3]:

            r4 = recur(i + 6, 3)

        TABLE[w][i] = r1 or r2 or r3 or r4 or False

        return TABLE[w][i]

    ans = recur(0, 0)

    return ans

if __name__ == '__main__':

    res = solve()

    if res:

        print("YES")

    else:

        print("NO")

# optimized version of the same code:

import sys

sys.setrecursionlimit(10 ** 6)

def solve():

    S = eval(input())

    # print(S, len(S))

    S = S[::-1]

    words = ("dream"[::-1], "dreamer"[::-1], "erase"[::-1], "eraser"[::-1])

    def recur(i):

        if i >= len(S):

            return True

        for word in words:

            if S[i:i + len(word)] == word:

                if recur(i + len(word)):

                    return True

        return False

    ans = recur(0)

    return ans

if __name__ == '__main__':

    res = solve()

    if res:

        print("YES")

    else:

        print("NO")

import sys

sys.setrecursionlimit(10**6)

def solve():
    S = eval(input())
    # print(S, len(S))
    words = {0: "dream", 1: "dreamer", 2: "erase", 3: "eraser"}
    TABLE = [[-1 for x in range(len(S) + 1)] for y in range(len(words) + 1)]

    def recur(i, w):
        if not TABLE[w][i] == -1:
            return TABLE[w][i]
        if i >= len(S):
            # print("jey", log)
            return True
        r1, r2, r3, r4 = False, False, False, False
        if S[i : i + 5] == words[0]:
            r1 = recur(i + 5, 0)
        if S[i : i + 7] == words[1]:
            r2 = recur(i + 7, 1)
        if S[i : i + 5] == words[2]:
            r3 = recur(i + 5, 2)
        if S[i : i + 6] == words[3]:
            r4 = recur(i + 6, 3)
        TABLE[w][i] = r1 or r2 or r3 or r4 or False
        return TABLE[w][i]

    ans = recur(0, 0)
    return ans

if __name__ == "__main__":
    res = solve()
    if res:
        print("YES")
    else:
        print("NO")

import sys

sys.setrecursionlimit(10**6)

def solve():
    S = eval(input())
    # print(S, len(S))
    S = S[::-1]
    words = ("dream"[::-1], "dreamer"[::-1], "erase"[::-1], "eraser"[::-1])

    def recur(i):
        if i >= len(S):
            return True
        for word in words:
            if S[i : i + len(word)] == word:
                if recur(i + len(word)):
                    return True
        return False

    ans = recur(0)
    return ans

if __name__ == "__main__":
    res = solve()
    if res:
        print("YES")
    else:
        print("NO")

-    words = {0: "dream", 1: "dreamer", 2: "erase", 3: "eraser"}

-    TABLE = [[-1 for x in range(len(S) + 1)] for y in range(len(words) + 1)]

-        r1, r2, r3, r4 = False, False, False, False

-        TABLE[w][i] = r1 or r2 or r3 or r4 or False

+            if S[i : i + len(word)] == word:

+                if recur(i + len(word)):


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

import numpy as np

eval(input())

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

ans = 0

while(all(A%2==0)):

    A = A/2

    ans += 1

print(ans)

# optimized version of the same code:

eval(input())

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

ans = 0

while all(a%2==0 for a in A):

    A=[a/2 for a in A]

    ans += 1

print(ans)

import numpy as np

eval(input())
A = np.array(list(map(int, input().split())))
ans = 0
while all(A % 2 == 0):
    A = A / 2
    ans += 1
print(ans)

eval(input())
A = list(map(int, input().split()))
ans = 0
while all(a % 2 == 0 for a in A):
    A = [a / 2 for a in A]
    ans += 1
print(ans)

-A = np.array(list(map(int, input().split())))


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

from collections import defaultdict

N = int(eval(input()))

A = [eval(input()) for _ in range(N)]

A.sort()

d = defaultdict(int)

for a in A:

    d[a] += 1

l = sorted(d.items())

max_v = 0

for _, v in l:

    if v > max_v:

        max_v = v

for k, v in l:

    if v == max_v:

        print(k)

    else:

        continue

# optimized version of the same code:

from collections import defaultdict

def solve():

    N = int(eval(input()))

    d = defaultdict(int)

    for _ in range(N):

        a = eval(input())

        d[a] += 1

    m = 0

    for k, v in list(d.items()):

        m = max(m, v)

    l = []

    for k, v in list(d.items()):

        if m == v:

            l.append(k)

    l.sort()

    for ans in l:

        print(ans)

solve()

-N = int(eval(input()))
-A = [eval(input()) for _ in range(N)]
-A.sort()
-d = defaultdict(int)
-for a in A:
-    d[a] += 1
-l = sorted(d.items())
-max_v = 0
-for _, v in l:
-    if v > max_v:
-        max_v = v
-for k, v in l:
-    if v == max_v:
-        print(k)
-    else:
-        continue
+
+def solve():
+    N = int(eval(input()))
+    d = defaultdict(int)
+    for _ in range(N):
+        a = eval(input())
+        d[a] += 1
+    m = 0
+    for k, v in list(d.items()):
+        m = max(m, v)
+    l = []
+    for k, v in list(d.items()):
+        if m == v:
+            l.append(k)
+    l.sort()
+    for ans in l:
+        print(ans)
+
+
+solve()


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

import numpy as np

s = np.array(list(eval(input())))

t = np.array(list(eval(input())))

print((len(s[s==t])))

# optimized version of the same code:

s = eval(input())

t = eval(input())

ans = 0

for i in range(len(s)):

    if s[i] == t[i]:

        ans += 1

print(ans)

import numpy as np

s = np.array(list(eval(input())))
t = np.array(list(eval(input())))
print((len(s[s == t])))

-import numpy as np
-s = np.array(list(eval(input())))
-t = np.array(list(eval(input())))
-print((len(s[s == t])))
+s = eval(input())
+t = eval(input())
+ans = 0
+for i in range(len(s)):
+    if s[i] == t[i]:
+        ans += 1
+print(ans)


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

n = int(eval(input()))

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

a_index = []

for i in range(n):

    a_index.append((i, a[i]))

dic1 = {}

dic2 = {}

for i in range(n):

    one = a_index[i][0] + a_index[i][1]

    two = a_index[i][0] - a_index[i][1]

    if one not in dic1:

        dic1[one] = 1

    else:

        dic1[one] += 1

    if two not in dic2:

        dic2[two] = 1

    else:

        dic2[two] += 1

ans = 0

for i in list(dic1.keys()):

    if i in dic2:

        ans += dic2[i] * dic1[i]

for i in list(dic2.keys()):

    if i in dic1:

        ans += dic1[i] * dic2[i]

        #print(i)

print((ans // 2))

# optimized version of the same code:

n = int(eval(input()))

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

import collections

ans = 0

dic = collections.defaultdict(int)

for i in range(1, n + 1):

    ans += dic[i - a[i - 1]]

    dic[i + a[i - 1]] += 1

print(ans)

n = int(eval(input()))
a = list(map(int, input().split()))
a_index = []
for i in range(n):
    a_index.append((i, a[i]))
dic1 = {}
dic2 = {}
for i in range(n):
    one = a_index[i][0] + a_index[i][1]
    two = a_index[i][0] - a_index[i][1]
    if one not in dic1:
        dic1[one] = 1
    else:
        dic1[one] += 1
    if two not in dic2:
        dic2[two] = 1
    else:
        dic2[two] += 1
ans = 0
for i in list(dic1.keys()):
    if i in dic2:
        ans += dic2[i] * dic1[i]
for i in list(dic2.keys()):
    if i in dic1:
        ans += dic1[i] * dic2[i]
        # print(i)
print((ans // 2))

-    one = a_index[i][0] + a_index[i][1]

-    two = a_index[i][0] - a_index[i][1]


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

k,s=list(map(int,input().split()))

ans=chk=0

for i in range(k+1):

    for j in range(k+1):

        if (0<=s-i-j<=k): ans+=1

print(ans)

# optimized version of the same code:

k,s=list(map(int,input().split()))

ans=0

x=min(k+1,s+1)

y=max(0,s-k-k)

for i in range(y,x):

    for j in range(y,x):

        if i+j>s: break

        if 0<=s-i-j<=k:

            ans+=1

print(ans)

k, s = list(map(int, input().split()))
ans = chk = 0
for i in range(k + 1):
    for j in range(k + 1):
        if 0 <= s - i - j <= k:
            ans += 1
print(ans)

k, s = list(map(int, input().split()))
ans = 0
x = min(k + 1, s + 1)
y = max(0, s - k - k)
for i in range(y, x):
    for j in range(y, x):
        if i + j > s:
            break
        if 0 <= s - i - j <= k:
            ans += 1
print(ans)

-ans = chk = 0
-for i in range(k + 1):
-    for j in range(k + 1):
+ans = 0
+x = min(k + 1, s + 1)
+y = max(0, s - k - k)
+for i in range(y, x):
+    for j in range(y, x):
+        if i + j > s:
+            break


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

N,K = int(eval(input())), int(eval(input()))

now = 1

for i in range(N):

    if now*2 < now + K:

        now *= 2

    else:

        now += K

print(now)

# optimized version of the same code:

N = int(eval(input()))

K = int(eval(input()))

ans = 1

for i in range(N):

    if ans < K:

        ans *= 2

    else:

        ans += K

print(ans)

N, K = int(eval(input())), int(eval(input()))
now = 1
for i in range(N):
    if now * 2 < now + K:
        now *= 2
    else:
        now += K
print(now)

-N, K = int(eval(input())), int(eval(input()))


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

#d3と同一解法

n=int(eval(input()))

import sys

#再帰関数の再帰回数を変更

sys.setrecursionlimit(10**6)

s=[[] for _ in range(n)]

for i in range(n-1):

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

    s[a-1].append((b-1,i))

    s[b-1].append((a-1,i))

l=[0]*(n-1)

def dfs(node,pre_col,par):

    col=1

    for nei,i in s[node]:

        if nei==par:

            continue

        if col==pre_col:

            col+=1

        l[i]=col

        dfs(nei,col,node)

        col+=1

dfs(0,-1,-1)

print((max(l)))

for i in l:

    print(i)

# optimized version of the same code:

import sys

sys.setrecursionlimit(500000)

N = int(eval(input()))

E = [[] for _ in range(N+1)]

for i in range(N-1):

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

    E[a].append((b, i))

    E[b].append((a, i))

K = max(len(e) for e in E)

print(K)

Ans = [-1] * (N-1)

def dfs(v=1, p=0, p_col=-1):

    col = 1

    for u, idx in E[v]:

        if u!=p: #木構造の逆向きの矢印を除くための条件

            if col == p_col:

                col += 1

            Ans[idx] = col

            #print(p_col)

            dfs(u, v, col) #u;調べる頂点 v;直前に調べた辺で、調べる頂点と結ばれている頂点　col;直前に調べた辺の色番号

            col += 1 #最深部まで調べたら デフォルトの色=最後に調べた辺の色+1とする

            #最深部に繋がった辺の色+1してやれば、次の辺の色は必ず条件を満たしてくれる

dfs()

print(("\n".join(map(str, Ans))))

# d3と同一解法
n = int(eval(input()))
import sys

# 再帰関数の再帰回数を変更
sys.setrecursionlimit(10**6)
s = [[] for _ in range(n)]
for i in range(n - 1):
    a, b = list(map(int, input().split()))
    s[a - 1].append((b - 1, i))
    s[b - 1].append((a - 1, i))
l = [0] * (n - 1)

def dfs(node, pre_col, par):
    col = 1
    for nei, i in s[node]:
        if nei == par:
            continue
        if col == pre_col:
            col += 1
        l[i] = col
        dfs(nei, col, node)
        col += 1

dfs(0, -1, -1)
print((max(l)))
for i in l:
    print(i)

import sys

sys.setrecursionlimit(500000)
N = int(eval(input()))
E = [[] for _ in range(N + 1)]
for i in range(N - 1):
    a, b = list(map(int, input().split()))
    E[a].append((b, i))
    E[b].append((a, i))
K = max(len(e) for e in E)
print(K)
Ans = [-1] * (N - 1)

def dfs(v=1, p=0, p_col=-1):
    col = 1
    for u, idx in E[v]:
        if u != p:  # 木構造の逆向きの矢印を除くための条件
            if col == p_col:
                col += 1
            Ans[idx] = col
            # print(p_col)
            dfs(u, v, col)  # u;調べる頂点 v;直前に調べた辺で、調べる頂点と結ばれている頂点　col;直前に調べた辺の色番号
            col += 1  # 最深部まで調べたら デフォルトの色=最後に調べた辺の色+1とする
            # 最深部に繋がった辺の色+1してやれば、次の辺の色は必ず条件を満たしてくれる

dfs()
print(("\n".join(map(str, Ans))))

-# 再帰関数の再帰回数を変更

+        if u != p:  # 木構造の逆向きの矢印を除くための条件

+            dfs(u, v, col)  # u;調べる頂点 v;直前に調べた辺で、調べる頂点と結ばれている頂点　col;直前に調べた辺の色番号

+            col += 1  # 最深部まで調べたら デフォルトの色=最後に調べた辺の色+1とする

+            # 最深部に繋がった辺の色+1してやれば、次の辺の色は必ず条件を満たしてくれる


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

eval(input())

import numpy as np

A = np.array(list(map(int, input().split(" "))))

a = 0

while np.sum(A%2) == 0:

  A = A/2

  a = a + 1

print(a)

# optimized version of the same code:

eval(input())

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

B = 0

while all(a%2 == 0 for a in A):

  A = [a/2 for a in A]

  B += 1

print(B)

eval(input())
import numpy as np

A = np.array(list(map(int, input().split(" "))))
a = 0
while np.sum(A % 2) == 0:
    A = A / 2
    a = a + 1
print(a)

eval(input())
A = list(map(int, input().split(" ")))
B = 0
while all(a % 2 == 0 for a in A):
    A = [a / 2 for a in A]
    B += 1
print(B)

-A = np.array(list(map(int, input().split(" "))))


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

import math

n=int(eval(input()))

ans=n

i=1

while(i<=math.sqrt(n)):

    if n%i==0:

        d=i+n/i-2

        ans=min(ans,d)

    i+=1

print((int(ans)))

# optimized version of the same code:

from math import floor

from math import sqrt

n=int(eval(input()))

nn=floor(sqrt(n))

rest=n%nn

while rest!=0:

    nn-=1

    rest=n%nn

nnn=n/nn

print((int(nn+nnn-2)))

import math

n = int(eval(input()))
ans = n
i = 1
while i <= math.sqrt(n):
    if n % i == 0:
        d = i + n / i - 2
        ans = min(ans, d)
    i += 1
print((int(ans)))

from math import floor
from math import sqrt

n = int(eval(input()))
nn = floor(sqrt(n))
rest = n % nn
while rest != 0:
    nn -= 1
    rest = n % nn
nnn = n / nn
print((int(nn + nnn - 2)))

-import math
+from math import floor
+from math import sqrt
-ans = n
-i = 1
-while i <= math.sqrt(n):
-    if n % i == 0:
-        d = i + n / i - 2
-        ans = min(ans, d)
-    i += 1
-print((int(ans)))
+nn = floor(sqrt(n))
+rest = n % nn
+while rest != 0:
+    nn -= 1
+    rest = n % nn
+nnn = n / nn
+print((int(nn + nnn - 2)))


Input:
# slower version:

s = input()
for i in range(len(s)):
  if i%2 == 0:
    print(s[i], end = '')

# optimized version of the same code:

s = input()
ans = ''
for i in range(len(s)):
  if i % 2 == 0:
    ans += s[i]
print(ans)

# slower version:

import math

N = int(eval(input()))

power = math.factorial(N)

print((power % 1000000007))

# optimized version of the same code:

n=int(eval(input()))

ans=1

for i in range(n):

    ans=(ans*(i+1))%(10**9+7)

print(ans)

n = int(eval(input()))
ans = 1
for i in range(n):
    ans = (ans * (i + 1)) % (10**9 + 7)
print(ans)