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():

    import sys

    input = sys.stdin.buffer.readline

    N = int(input())

    TXY = [[int(i) for i in input().split()] for j in range(N)]

    time, px, py = 0, 0, 0

    for t, x, y in TXY:

        move = abs(x-px) + abs(y-py)

        # print(move, t-time)

        if (t - time) % 2 != move % 2 or t - time < move:

            return print("No")

        time, px, py = t, x, y

    print("Yes")

if __name__ == '__main__':

    main()

# optimized version of the same code:

def main():

    import sys

    input = sys.stdin.buffer.readline

    N = int(input())

    TXY = [[int(i) for i in input().split()] for j in range(N)]

    time = 0

    px = 0

    py = 0

    for t, x, y in TXY:

        move = abs(py-y) + abs(px - x)

        if (t-time) < move or (t - time) % 2 != move % 2:

            return print("No")

        time = t

        px = x

        py = y

    print("Yes")

if __name__ == '__main__':

    main()

def main():
    import sys

    input = sys.stdin.buffer.readline
    N = int(input())
    TXY = [[int(i) for i in input().split()] for j in range(N)]
    time, px, py = 0, 0, 0
    for t, x, y in TXY:
        move = abs(x - px) + abs(y - py)
        # print(move, t-time)
        if (t - time) % 2 != move % 2 or t - time < move:
            return print("No")
        time, px, py = t, x, y
    print("Yes")

if __name__ == "__main__":
    main()

def main():
    import sys

    input = sys.stdin.buffer.readline
    N = int(input())
    TXY = [[int(i) for i in input().split()] for j in range(N)]
    time = 0
    px = 0
    py = 0
    for t, x, y in TXY:
        move = abs(py - y) + abs(px - x)
        if (t - time) < move or (t - time) % 2 != move % 2:
            return print("No")
        time = t
        px = x
        py = y
    print("Yes")

if __name__ == "__main__":
    main()

-        move = abs(x - px) + abs(y - py)

-        if (t - time) % 2 != move % 2 or t - time < move:

+        move = abs(py - y) + abs(px - x)

+        if (t - time) < move or (t - time) % 2 != move % 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 sys

import numpy as np

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

def main(N):

    div = np.zeros(N+1, np.int64)

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

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

        div[m] += m

    return div.sum()

if sys.argv[-1] == 'ONLINE_JUDGE':

    import numba

    from numba.pycc import CC

    i8 = numba.int64

    cc = CC('my_module')

    def cc_export(f, signature):

        cc.export(f.__name__, signature)(f)

        return numba.njit(f)

    main = cc_export(main, (i8, ))

    cc.compile()

from my_module import main

N = int(read())

print((main(N)))

# optimized version of the same code:

import sys

import numpy as np

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

def main(N):

    x = 0

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

        for b in range(1, N//a+1):

            x += a*b

    return x

if sys.argv[-1] == 'ONLINE_JUDGE':

    import numba

    from numba.pycc import CC

    i8 = numba.int64

    cc = CC('my_module')

    def cc_export(f, signature):

        cc.export(f.__name__, signature)(f)

        return numba.njit(f)

    main = cc_export(main, (i8, ))

    cc.compile()

from my_module import main

N = int(read())

print((main(N)))

import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def main(N):
    div = np.zeros(N + 1, np.int64)
    for n in range(1, N + 1):
        for m in range(n, N + 1, n):
            div[m] += m
    return div.sum()

if sys.argv[-1] == "ONLINE_JUDGE":
    import numba
    from numba.pycc import CC

    i8 = numba.int64
    cc = CC("my_module")

    def cc_export(f, signature):
        cc.export(f.__name__, signature)(f)
        return numba.njit(f)

    main = cc_export(main, (i8,))
    cc.compile()
from my_module import main

N = int(read())
print((main(N)))

import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def main(N):
    x = 0
    for a in range(1, N + 1):
        for b in range(1, N // a + 1):
            x += a * b
    return x

if sys.argv[-1] == "ONLINE_JUDGE":
    import numba
    from numba.pycc import CC

    i8 = numba.int64
    cc = CC("my_module")

    def cc_export(f, signature):
        cc.export(f.__name__, signature)(f)
        return numba.njit(f)

    main = cc_export(main, (i8,))
    cc.compile()
from my_module import main

N = int(read())
print((main(N)))

-    div = np.zeros(N + 1, np.int64)
-    for n in range(1, N + 1):
-        for m in range(n, N + 1, n):
-            div[m] += m
-    return div.sum()
+    x = 0
+    for a in range(1, N + 1):
+        for b in range(1, N // a + 1):
+            x += a * b
+    return x


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()))

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

for i in range(n):

    al[i] -= i + 1

med = np.median(np.array(al))

ans = 0

for a in al:

    ans += abs(a-med)

print((int(ans)))

# optimized version of the same code:

import statistics

n = int(eval(input()))

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

for i in range(n):

    al[i] -= i + 1

median = statistics.median(al)

ans = 0

for a in al:

    ans += abs(median - a)

print((int(ans)))

import numpy as np

n = int(eval(input()))
al = list(map(int, input().split()))
for i in range(n):
    al[i] -= i + 1
med = np.median(np.array(al))
ans = 0
for a in al:
    ans += abs(a - med)
print((int(ans)))

import statistics

n = int(eval(input()))
al = list(map(int, input().split()))
for i in range(n):
    al[i] -= i + 1
median = statistics.median(al)
ans = 0
for a in al:
    ans += abs(median - a)
print((int(ans)))

-import numpy as np
+import statistics
-med = np.median(np.array(al))
+median = statistics.median(al)
-    ans += abs(a - med)
+    ans += abs(median - 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

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

a = np.array(list(map(int, input().split()))).astype("int64")

a = np.cumsum(a)

a %= m

count = np.sum(a == 0)

a.sort()

tc = 1

for i in range(1, n):

    if a[i - 1] == a[i]:

        tc += 1

    else:

        count += tc * (tc - 1) // 2

        tc = 1

else:

    count += tc * (tc - 1) // 2

print(count)

# optimized version of the same code:

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

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

unique_a = {a[0] % m: 1}

for i in range(1, n):

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

    a[i] %= m

    if a[i] in unique_a:

        unique_a[a[i]] += 1

    else:

        unique_a[a[i]] = 1

count = 0

if 0 in unique_a:

    count += unique_a[0]

for k in unique_a:

    count += unique_a[k] * (unique_a[k] - 1) // 2

print(count)

-a = np.array(list(map(int, input().split()))).astype("int64")

+    count += unique_a[k] * (unique_a[k] - 1) // 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 numpy as np

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

al = list(list(input()) for _ in range(h))

al_n = np.array(al)

row = [0]*w

col = [0]*h

for i in range(h):

    for j in range(w):

        if al_n[i][j] == '.':

            row[j] += 1

            col[i] += 1

row_ = []

col_ = []

for i in range(w):

    if row[i] == h:

        row_.append(i)

for j in range(h):

    if col[j] == w:

        col_.append(j)

if len(col_) > 0:

    al_n = np.delete(al_n, col_, axis=0)

if len(row_) > 0:

    al_n = np.delete(al_n, row_, axis=1)

for a in al_n:

    print(*a, sep='')

# optimized version of the same code:

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

al = list(list(input()) for _ in range(h))

row = [0]*w

col = [0]*h

for i in range(h):

    for j in range(w):

        if al[i][j] == '#':

            col[i] += 1

            row[j] += 1

ans = []

w_len = len(row) - row.count(0)

for i in range(h):

    tmp = ''

    if col[i] != 0:

        for j in range(w):

            if row[j] != 0:

                tmp += al[i][j]

        ans.append(tmp)

for a in ans:

    print(*a, sep='')

import numpy as np

h, w = map(int, input().split())
al = list(list(input()) for _ in range(h))
al_n = np.array(al)
row = [0] * w
col = [0] * h
for i in range(h):
    for j in range(w):
        if al_n[i][j] == ".":
            row[j] += 1
            col[i] += 1
row_ = []
col_ = []
for i in range(w):
    if row[i] == h:
        row_.append(i)
for j in range(h):
    if col[j] == w:
        col_.append(j)
if len(col_) > 0:
    al_n = np.delete(al_n, col_, axis=0)
if len(row_) > 0:
    al_n = np.delete(al_n, row_, axis=1)
for a in al_n:
    print(*a, sep="")

h, w = map(int, input().split())
al = list(list(input()) for _ in range(h))
row = [0] * w
col = [0] * h
for i in range(h):
    for j in range(w):
        if al[i][j] == "#":
            col[i] += 1
            row[j] += 1
ans = []
w_len = len(row) - row.count(0)
for i in range(h):
    tmp = ""
    if col[i] != 0:
        for j in range(w):
            if row[j] != 0:
                tmp += al[i][j]
        ans.append(tmp)
for a in ans:
    print(*a, sep="")

-    al_n = np.delete(al_n, col_, axis=0)

-    al_n = np.delete(al_n, row_, axis=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 math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)

inf = 10**20

eps = 1.0 / 10**15

mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]

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

def LF(): return [float(x) for x in sys.stdin.readline().split()]

def LS(): return sys.stdin.readline().split()

def I(): return int(sys.stdin.readline())

def F(): return float(sys.stdin.readline())

def S(): return input()

def pf(s): return print(s, flush=True)

def divisions(n):

    sq = int(math.sqrt(n)+1)

    d = collections.defaultdict(int)

    while n % 2 == 0:

        n //= 2

        d[2] += 1

    i = 3

    while n > 1 and sq >= i:

        if n % i == 0:

            n //= i

            d[i] += 1

        else:

            i += 2

    if n > 1:

        d[n] += 1

    r = [1]

    for k, v in d.items():

        for c in r[:]:

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

                r.append(c*(k**i))

    return sorted(r)

def main():

    n = I()

    a = LI()

    s = set()

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

        d = divisions(i)

        ld = len(d)

        for j in range(1,2**ld):

            c = []

            ff = True

            for k in range(ld):

                if j & (1<<k):

                    f = True

                    for e in c:

                        if d[k] % e == 0:

                            f = False

                            ff = False

                            break

                    if f:

                        c.append(d[k])

                if not ff:

                    break

            if ff:

                s.add(tuple(c + [n+1]))

    b = sorted(list(s), reverse=True)

    for c in b:

        t = 0

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

            f = False

            for e in c:

                if j%e == 0:

                    f = True

                    break

            if f:

                t += a[j-1]

        if t < 0:

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

                f = False

                for e in c:

                    if j%e == 0:

                        f = True

                        break

                if f:

                    a[j-1] = 0

    return sum(a)

print(main())

# optimized version of the same code:

import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools

import time,random

sys.setrecursionlimit(10**7)

inf = 10**20

eps = 1.0 / 10**10

mod = 10**9+7

mod2 = 998244353

dd = [(-1,0),(0,1),(1,0),(0,-1)]

ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

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

def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]

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

def LF(): return [float(x) for x in sys.stdin.readline().split()]

def LS(): return sys.stdin.readline().split()

def I(): return int(sys.stdin.readline())

def F(): return float(sys.stdin.readline())

def S(): return input()

def pf(s): return print(s, flush=True)

def pe(s): return print(str(s), file=sys.stderr)

def JA(a, sep): return sep.join(map(str, a))

def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)

class Flow():

    def __init__(self, e, N):

        self.E = e

        self.N = N

    def max_flow(self, s, t):

        r = 0

        e = self.E

        def f(c, cap):

            v = self.v

            v[c] = 1

            if c == t:

                return cap

            for i in range(self.N):

                if v[i] or e[c][i] <= 0:

                    continue

                cp = min(cap, e[c][i])

                k = f(i, cp)

                if k > 0:

                    e[c][i] -= k

                    e[i][c] += k

                    return k

            return 0

        while True:

            self.v = [None] * self.N

            fs = f(s, inf)

            if fs == 0:

                break

            r += fs

        return r

def main():

    n = I()

    a = LI()

    s = n

    t = n + 1

    e = [[0] * (n+2) for _ in range(n+2)]

    for i in range(n):

        c = a[i]

        if c < 0:

            e[s][i] = -c

            ii = i + 1

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

                e[i][j-1] = inf

        else:

            e[i][t] = c

    fl = Flow(e, n+2)

    r = fl.max_flow(s,t)

    return sum(map(lambda x: max(0,x), a)) - r

# start = time.time()

print(main())

# pe(time.time() - start)

import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**15
mod = 10**9 + 7

def LI():
    return [int(x) for x in sys.stdin.readline().split()]

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

def LF():
    return [float(x) for x in sys.stdin.readline().split()]

def LS():
    return sys.stdin.readline().split()

def I():
    return int(sys.stdin.readline())

def F():
    return float(sys.stdin.readline())

def S():
    return input()

def pf(s):
    return print(s, flush=True)

def divisions(n):
    sq = int(math.sqrt(n) + 1)
    d = collections.defaultdict(int)
    while n % 2 == 0:
        n //= 2
        d[2] += 1
    i = 3
    while n > 1 and sq >= i:
        if n % i == 0:
            n //= i
            d[i] += 1
        else:
            i += 2
    if n > 1:
        d[n] += 1
    r = [1]
    for k, v in d.items():
        for c in r[:]:
            for i in range(1, v + 1):
                r.append(c * (k**i))
    return sorted(r)

def main():
    n = I()
    a = LI()
    s = set()
    for i in range(n, 0, -1):
        d = divisions(i)
        ld = len(d)
        for j in range(1, 2**ld):
            c = []
            ff = True
            for k in range(ld):
                if j & (1 << k):
                    f = True
                    for e in c:
                        if d[k] % e == 0:
                            f = False
                            ff = False
                            break
                    if f:
                        c.append(d[k])
                if not ff:
                    break
            if ff:
                s.add(tuple(c + [n + 1]))
    b = sorted(list(s), reverse=True)
    for c in b:
        t = 0
        for j in range(1, n + 1):
            f = False
            for e in c:
                if j % e == 0:
                    f = True
                    break
            if f:
                t += a[j - 1]
        if t < 0:
            for j in range(1, n + 1):
                f = False
                for e in c:
                    if j % e == 0:
                        f = True
                        break
                if f:
                    a[j - 1] = 0
    return sum(a)

print(main())

import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
import time, random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9 + 7
mod2 = 998244353
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

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

def LLI():
    return [list(map(int, l.split())) for l in sys.stdin.readlines()]

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

def LF():
    return [float(x) for x in sys.stdin.readline().split()]

def LS():
    return sys.stdin.readline().split()

def I():
    return int(sys.stdin.readline())

def F():
    return float(sys.stdin.readline())

def S():
    return input()

def pf(s):
    return print(s, flush=True)

def pe(s):
    return print(str(s), file=sys.stderr)

def JA(a, sep):
    return sep.join(map(str, a))

def JAA(a, s, t):
    return s.join(t.join(map(str, b)) for b in a)

class Flow:
    def __init__(self, e, N):
        self.E = e
        self.N = N

    def max_flow(self, s, t):
        r = 0
        e = self.E

        def f(c, cap):
            v = self.v
            v[c] = 1
            if c == t:
                return cap
            for i in range(self.N):
                if v[i] or e[c][i] <= 0:
                    continue
                cp = min(cap, e[c][i])
                k = f(i, cp)
                if k > 0:
                    e[c][i] -= k
                    e[i][c] += k
                    return k
            return 0

        while True:
            self.v = [None] * self.N
            fs = f(s, inf)
            if fs == 0:
                break
            r += fs
        return r

def main():
    n = I()
    a = LI()
    s = n
    t = n + 1
    e = [[0] * (n + 2) for _ in range(n + 2)]
    for i in range(n):
        c = a[i]
        if c < 0:
            e[s][i] = -c
            ii = i + 1
            for j in range(ii * 2, n + 1, ii):
                e[i][j - 1] = inf
        else:
            e[i][t] = c
    fl = Flow(e, n + 2)
    r = fl.max_flow(s, t)
    return sum(map(lambda x: max(0, x), a)) - r

# start = time.time()
print(main())
# pe(time.time() - start)

-import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools

+import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools

-    return [int(x) for x in sys.stdin.readline().split()]

+    return list(map(int, sys.stdin.readline().split()))

+    return [list(map(int, l.split())) for l in sys.stdin.readlines()]

+    return print(str(s), file=sys.stderr)

+    return s.join(t.join(map(str, b)) for b in a)

-                s.add(tuple(c + [n + 1]))

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

+    return sum(map(lambda x: max(0, x), a)) - 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:

N = int(eval(input()))

ans = N - 1

p = 1

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

    if p % 2 == 1 and i > (N ** 0.5):

        break

    if N % i == 0:

        p = i

        j = N // i

        m = i + j - 2

        if m < ans:

            ans = m

        else:

            continue

    else:

        continue

print(ans)

# optimized version of the same code:

N = int(eval(input()))

ans = N - 1

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

    if N % i == 0:

        j = N // i

        m = i + j - 2

        ans = min(ans, m)

print(ans)

N = int(eval(input()))
ans = N - 1
p = 1
for i in range(2, int((N**0.5) + 1)):
    if p % 2 == 1 and i > (N**0.5):
        break
    if N % i == 0:
        p = i
        j = N // i
        m = i + j - 2
        if m < ans:
            ans = m
        else:
            continue
    else:
        continue
print(ans)

N = int(eval(input()))
ans = N - 1
for i in range(2, int((N**0.5) + 1)):
    if N % i == 0:
        j = N // i
        m = i + j - 2
        ans = min(ans, m)
print(ans)

-p = 1
-    if p % 2 == 1 and i > (N**0.5):
-        break
-        p = i
-        if m < ans:
-            ans = m
-        else:
-            continue
-    else:
-        continue
+        ans = min(ans, m)


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 heapq

# \n

def input():

    return sys.stdin.readline().rstrip()

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()))

    A.sort(reverse=True)

    B.sort(reverse=True)

    C.sort(reverse=True)

    Q = []

    S = set()

    heapq.heapify(Q)

    heapq.heappush(Q, (-A[0] - B[0] - C[0], 0, 0, 0))

    for i in range(K):

        m, a, b, c = heapq.heappop(Q)

        print((-m))

        if (a + 1, b, c) not in S and a + 1 < X:

            heapq.heappush(Q, (-A[a + 1] - B[b] - C[c], a + 1, b, c))

            S.add((a + 1, b, c))

        if (a, b + 1, c) not in S and b + 1 < Y:

            heapq.heappush(Q, (-A[a] - B[b + 1] - C[c], a, b + 1, c))

            S.add((a, b + 1, c))

        if (a, b, c + 1) not in S and c + 1 < Z:

            heapq.heappush(Q, (-A[a ] - B[b] - C[c+1], a, b, c + 1))

            S.add((a, b, c + 1))

if __name__ == "__main__":

    main()

# optimized version of the same code:

import sys

# \n

def input():

    return sys.stdin.readline().rstrip()

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()))

    A.sort(reverse=True)

    B.sort(reverse=True)

    C.sort(reverse=True)

    L = []

    for i in range(X):

        for j in range(min(Y, K // (i + 1) + 1)):

            for k in range(min(Z, K // (i + 1) // (j + 1) + 1)):

                L.append(A[i] + B[j] + C[k])

    L.sort(reverse=True)

    for i in range(K):

        print((L[i]))

if __name__ == "__main__":

    main()

import sys
import heapq

# \n
def input():
    return sys.stdin.readline().rstrip()

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()))
    A.sort(reverse=True)
    B.sort(reverse=True)
    C.sort(reverse=True)
    Q = []
    S = set()
    heapq.heapify(Q)
    heapq.heappush(Q, (-A[0] - B[0] - C[0], 0, 0, 0))
    for i in range(K):
        m, a, b, c = heapq.heappop(Q)
        print((-m))
        if (a + 1, b, c) not in S and a + 1 < X:
            heapq.heappush(Q, (-A[a + 1] - B[b] - C[c], a + 1, b, c))
            S.add((a + 1, b, c))
        if (a, b + 1, c) not in S and b + 1 < Y:
            heapq.heappush(Q, (-A[a] - B[b + 1] - C[c], a, b + 1, c))
            S.add((a, b + 1, c))
        if (a, b, c + 1) not in S and c + 1 < Z:
            heapq.heappush(Q, (-A[a] - B[b] - C[c + 1], a, b, c + 1))
            S.add((a, b, c + 1))

if __name__ == "__main__":
    main()

+        for j in range(min(Y, K // (i + 1) + 1)):

+                L.append(A[i] + B[j] + C[k])

-        if (a + 1, b, c) not in S and a + 1 < X:

-            heapq.heappush(Q, (-A[a + 1] - B[b] - C[c], a + 1, b, c))

-        if (a, b + 1, c) not in S and b + 1 < Y:

-            heapq.heappush(Q, (-A[a] - B[b + 1] - C[c], a, b + 1, c))

-        if (a, b, c + 1) not in S and c + 1 < Z:

-            heapq.heappush(Q, (-A[a] - B[b] - C[c + 1], a, b, c + 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:

def two_count(x):

	if int(str(x)[-1]) % 2 == 0:

		return 1 + two_count(x//2)

	else:

		return 0

n = int(eval(input()))

n_list = [int(n) for n in input().split(" ")]

n_two_count_list = [two_count(n) for n in n_list]

print((min(n_two_count_list)))

# optimized version of the same code:

def two_count(x):

	if x % 2 == 0:

		return 1 + two_count(x//2)

	else:

		return 0

n = int(eval(input()))

n_list = [int(n) for n in input().split(" ")]

n_two_count_list = [two_count(n) for n in n_list]

print((min(n_two_count_list)))

def two_count(x):
    if int(str(x)[-1]) % 2 == 0:
        return 1 + two_count(x // 2)
    else:
        return 0

n = int(eval(input()))
n_list = [int(n) for n in input().split(" ")]
n_two_count_list = [two_count(n) for n in n_list]
print((min(n_two_count_list)))

def two_count(x):
    if x % 2 == 0:
        return 1 + two_count(x // 2)
    else:
        return 0

n = int(eval(input()))
n_list = [int(n) for n in input().split(" ")]
n_two_count_list = [two_count(n) for n in n_list]
print((min(n_two_count_list)))


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

import fractions

import numpy as np

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

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

a = a // 2

def lcm_base(x, y):

    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):

    return reduce(lcm_base, numbers, 1)

l = lcm(*a)

exist = not 0 in ((l//a)%2)

if exist:

    print(((M // l + 1 ) // 2))

else:

    print((0))

# optimized version of the same code:

import sys, fractions, functools

input = lambda: sys.stdin.readline().rstrip()

sys.setrecursionlimit(10**7)

INF = 10**20

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

def F(): return float(eval(input()))

def S(): return eval(input())

def LI(): return [int(x) for x in input().split()]

def LI_(): return [int(x)-1 for x in input().split()]

def LF(): return [float(x) for x in input().split()]

def LS(): return input().split()

def lcm_base(x, y):

    return (x * y) // fractions.gcd(x, y)

def lcm_list(numbers):

    return functools.reduce(lcm_base, numbers, 1)

def resolve():

    N, M = LI()

    a = LI()

    a_half = [i//2 for i in a]

    a_half_lcm = lcm_list(a_half)

    has_scm = not 0 in [a_half_lcm//i%2 for i in a_half]

    if has_scm:

        print(((M-a_half_lcm)//(2*a_half_lcm)+1))

    else:

        print((0))

if __name__ == '__main__':

    resolve()

from functools import reduce
import fractions
import numpy as np

N, M = list(map(int, input().split()))
a = np.array(list(map(int, input().split())))
a = a // 2

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

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

l = lcm(*a)
exist = not 0 in ((l // a) % 2)
if exist:
    print(((M // l + 1) // 2))
else:
    print((0))

import sys, fractions, functools

input = lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**7)
INF = 10**20

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

def F():
    return float(eval(input()))

def S():
    return eval(input())

def LI():
    return [int(x) for x in input().split()]

def LI_():
    return [int(x) - 1 for x in input().split()]

def LF():
    return [float(x) for x in input().split()]

def LS():
    return input().split()

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

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

def resolve():
    N, M = LI()
    a = LI()
    a_half = [i // 2 for i in a]
    a_half_lcm = lcm_list(a_half)
    has_scm = not 0 in [a_half_lcm // i % 2 for i in a_half]
    if has_scm:
        print(((M - a_half_lcm) // (2 * a_half_lcm) + 1))
    else:
        print((0))

if __name__ == "__main__":
    resolve()

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

+input = lambda: sys.stdin.readline().rstrip()

+    return [int(x) for x in input().split()]

+    return [int(x) - 1 for x in input().split()]

+    return [float(x) for x in input().split()]

-    return reduce(lcm_base, numbers, 1)

+    return functools.reduce(lcm_base, numbers, 1)

+    has_scm = not 0 in [a_half_lcm // i % 2 for i in a_half]

+        print(((M - a_half_lcm) // (2 * a_half_lcm) + 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 numpy as np

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

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

F=[int(i) for i in input().split()]

A=np.array(sorted(A, reverse=True))

F=np.array(sorted(F))

lower_bound=0

upper_bound=np.max(A*F)

K_tmp=0

while upper_bound>=lower_bound:

    mid=(lower_bound+upper_bound)//2

    K_tmp=np.sum(np.maximum(A-mid//F, 0))

    if K_tmp<=K:

        upper_bound=mid-1

    else:

        lower_bound=mid+1

print(lower_bound)

# optimized version of the same code:

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

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

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

a=sorted(a)

f=sorted(f, reverse=True)

def is_ok(arg):

    cnt=0

    for i in range(n):

        cnt+=max(a[i]-arg//f[i], 0)

    return cnt<=k

def meguru_bisect(ng, ok):

    while (abs(ok - ng) > 1):

        mid = (ok + ng) // 2

        if is_ok(mid):

            ok = mid

        else:

            ng = mid

    return ok

print((meguru_bisect(-1, 10**12)))

import numpy as np

N, K = list(map(int, input().split()))
A = [int(i) for i in input().split()]
F = [int(i) for i in input().split()]
A = np.array(sorted(A, reverse=True))
F = np.array(sorted(F))
lower_bound = 0
upper_bound = np.max(A * F)
K_tmp = 0
while upper_bound >= lower_bound:
    mid = (lower_bound + upper_bound) // 2
    K_tmp = np.sum(np.maximum(A - mid // F, 0))
    if K_tmp <= K:
        upper_bound = mid - 1
    else:
        lower_bound = mid + 1
print(lower_bound)

n, k = list(map(int, input().split()))
(*a,) = list(map(int, input().split()))
(*f,) = list(map(int, input().split()))
a = sorted(a)
f = sorted(f, reverse=True)

def is_ok(arg):
    cnt = 0
    for i in range(n):
        cnt += max(a[i] - arg // f[i], 0)
    return cnt <= k

def meguru_bisect(ng, ok):
    while abs(ok - ng) > 1:
        mid = (ok + ng) // 2
        if is_ok(mid):
            ok = mid
        else:
            ng = mid
    return ok

print((meguru_bisect(-1, 10**12)))

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

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

-    mid = (lower_bound + upper_bound) // 2

-    K_tmp = np.sum(np.maximum(A - mid // F, 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 main():

    mod = 998244353

    s, k = input().split()

    k = int(k)

    n = len(s)

    one = s.count("1")

    cnt = 0

    zero_list = []

    for i in range(n):

        if s[i] == "0":

            zero_list.append(cnt)

            cnt = 0

        else:

            cnt += 1

    z = 0

    mm = min(one, k)

    dp = [[0]*(one+1) for _ in [0]*(one+1)]

    dp[0][0] = 1

    for i in range(len(zero_list)):

        dp2 = [[0]*(mm+1) for _ in [0]*(one+1)]

        base = zero_list[i]

        # j:何個今までに入れたか

        for j in range(one+1):

            # l:何個入れるか

            for l in range(one+1-j):

                if l < z+base-j:

                    continue

                ml = max(l-base, 0)

                # p:これまでのペナルティ

                for p in range(min(one, k)+1):

                    q = p+ml

                    if q <= mm:

                        dp2[j+l][q] = (dp2[j+l][q]+dp[j][p]) % mod

                    else:

                        break

        z += base

        dp = dp2

    print((sum([sum(i) for i in dp]) % mod))

main()

# optimized version of the same code:

def main():

    mod = 998244353

    s, k = input().split()

    k, n, one, cnt, z, zero_list = int(k), len(s), s.count("1")+1, 0, 0, []

    for i in range(n):

        if s[i] == "0":

            zero_list.append(cnt)

            cnt = 0

        else:

            cnt += 1

    mm = min(one-1, k)

    dp = [[0]*(mm+1) for _ in [0]*one]

    dp[0][0] = 1

    for i in zero_list:

        dp2 = [[0]*(mm+1) for _ in [0]*one]

        for j in range(one):

            for l in range(max(z+i-j, 0), one-j):

                ml = max(l-i, 0)

                for p in range(min(j, mm-ml)+1):

                    dp2[j+l][p+ml] = (dp2[j+l][p+ml]+dp[j][p]) % mod

        z += i

        dp = dp2

    print((sum([sum(i) for i in dp]) % mod))

main()

def main():
    mod = 998244353
    s, k = input().split()
    k = int(k)
    n = len(s)
    one = s.count("1")
    cnt = 0
    zero_list = []
    for i in range(n):
        if s[i] == "0":
            zero_list.append(cnt)
            cnt = 0
        else:
            cnt += 1
    z = 0
    mm = min(one, k)
    dp = [[0] * (one + 1) for _ in [0] * (one + 1)]
    dp[0][0] = 1
    for i in range(len(zero_list)):
        dp2 = [[0] * (mm + 1) for _ in [0] * (one + 1)]
        base = zero_list[i]
        # j:何個今までに入れたか
        for j in range(one + 1):
            # l:何個入れるか
            for l in range(one + 1 - j):
                if l < z + base - j:
                    continue
                ml = max(l - base, 0)
                # p:これまでのペナルティ
                for p in range(min(one, k) + 1):
                    q = p + ml
                    if q <= mm:
                        dp2[j + l][q] = (dp2[j + l][q] + dp[j][p]) % mod
                    else:
                        break
        z += base
        dp = dp2
    print((sum([sum(i) for i in dp]) % mod))

main()

def main():
    mod = 998244353
    s, k = input().split()
    k, n, one, cnt, z, zero_list = int(k), len(s), s.count("1") + 1, 0, 0, []
    for i in range(n):
        if s[i] == "0":
            zero_list.append(cnt)
            cnt = 0
        else:
            cnt += 1
    mm = min(one - 1, k)
    dp = [[0] * (mm + 1) for _ in [0] * one]
    dp[0][0] = 1
    for i in zero_list:
        dp2 = [[0] * (mm + 1) for _ in [0] * one]
        for j in range(one):
            for l in range(max(z + i - j, 0), one - j):
                ml = max(l - i, 0)
                for p in range(min(j, mm - ml) + 1):
                    dp2[j + l][p + ml] = (dp2[j + l][p + ml] + dp[j][p]) % mod
        z += i
        dp = dp2
    print((sum([sum(i) for i in dp]) % mod))

main()

+    k, n, one, cnt, z, zero_list = int(k), len(s), s.count("1") + 1, 0, 0, []

-        # j:何個今までに入れたか

-            # l:何個入れるか

-            for l in range(one + 1 - j):

-                # p:これまでのペナルティ

-                for p in range(min(one, k) + 1):

+            for l in range(max(z + i - j, 0), one - j):

+                for p in range(min(j, mm - ml) + 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:

n=int(eval(input()))

a=[list(map(int,input().split()))for _ in range(n)]

def f():

 for i in range(n-1):

  d=a[i][:];d[3],d[4]=d[4],d[3]

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

   e=a[j][:];e[3],e[4]=e[4],e[3]

   for p in('012345','152043','215304','302541','410352','514320'):

    f=[d[int(k)]for k in p]

    g=f[1:5]*2

    for k in range(4):

     if(g[k:k+4]==e[1:5])*(f[0]==e[0])*(f[5]==e[5]):return 'No'

 return 'Yes'

print((f()))

# optimized version of the same code:

+                                return "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:

from fractions import gcd

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

a = [int(i) // 2 for i in input().split()]

x = 1

for i in range(n):

    x *= a[i] // gcd(x, a[i])

for i in a:

    if x // i % 2 == 0:

        print((0))

        exit()

print(((m // x + 1) // 2))

# optimized version of the same code:

from math import gcd, ceil

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

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

a = [i // 2 for i in a]

l = 1

for i in a:

    l *= i // gcd(l, i)

for i in a:

    if l // i % 2 == 0:

        print((0))

        exit()

print((ceil((m // l) / 2)))

-a = [int(i) // 2 for i 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:

import sys

input = lambda: sys.stdin.readline()[:-1]

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

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

data=[list(map(int,input().split())) for i in range(m)]

for i in a0:

	data.append([1,i])

data.sort(key=lambda tup:-tup[1])

ans=0

for num,val in data:

	if n>=num:

		n-=num

		ans+=val*num

	else:

		ans+=val*n

		break

print(ans)

# optimized version of the same code:

#!/usr/bin/env python3

import sys

from collections import Counter

input = lambda: sys.stdin.readline()[:-1]

sys.setrecursionlimit(10**8)

ans=0

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

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

bc=[]

for i in range(m):

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

    bc.append((c,b))

C=Counter(A)

bc+=list(C.items())

bc.sort(key=lambda tup:-tup[0])

# print(bc)

for c,b in bc:

    if n>=b:

        n-=b

        ans+=c*b

    else:

        ans+=c*n

        break

print(ans)

import sys

input = lambda: sys.stdin.readline()[:-1]
n, m = list(map(int, input().split()))
a0 = list(map(int, input().split()))
data = [list(map(int, input().split())) for i in range(m)]
for i in a0:
    data.append([1, i])
data.sort(key=lambda tup: -tup[1])
ans = 0
for num, val in data:
    if n >= num:
        n -= num
        ans += val * num
    else:
        ans += val * n
        break
print(ans)

#!/usr/bin/env python3
import sys
from collections import Counter

input = lambda: sys.stdin.readline()[:-1]
sys.setrecursionlimit(10**8)
ans = 0
n, m = list(map(int, input().split()))
A = list(map(int, input().split()))
bc = []
for i in range(m):
    b, c = list(map(int, input().split()))
    bc.append((c, b))
C = Counter(A)
bc += list(C.items())
bc.sort(key=lambda tup: -tup[0])
# print(bc)
for c, b in bc:
    if n >= b:
        n -= b
        ans += c * b
    else:
        ans += c * n
        break
print(ans)

-data = [list(map(int, input().split())) for i in range(m)]

+    b, c = 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 numpy as np

N = int(eval(input()))

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

a.sort()

a = a[::-1]

print((a[0::2].sum() - a[1::2].sum()))

# optimized version of the same code:

n = int(eval(input()))

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

arr.sort(reverse=True)

print((sum(arr[0::2]) - sum(arr[1::2])))

-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 sys

sys.setrecursionlimit(10**6)

if sys.platform in (['ios','darwin','win32']):

	sys.stdin=open('Untitled.txt')

input = sys.stdin.readline

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

def MAP(): return [int(s) for s in input().split()]

def main():

	S = input().rstrip()

	bcnt = 0

	A = []

	for i in range(len(S)):

		if S[i] == 'B': bcnt += 1

		if S[i] == 'W': A.append(bcnt)

	print((sum(A)))

if __name__ == '__main__':

	main()

# optimized version of the same code:

import sys

sys.setrecursionlimit(10**6)

if sys.platform in (['ios','darwin','win32']):

	sys.stdin=open('Untitled.txt')

input = sys.stdin.readline

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

def MAP(): return [int(s) for s in input().split()]

def main():

	S = input().rstrip()

	bcnt = 0

	ans = 0

	for i in range(len(S)):

		if S[i] == 'B': bcnt += 1

		if S[i] == 'W': ans += bcnt

	print(ans)

if __name__ == '__main__':

	main()

import sys

sys.setrecursionlimit(10**6)
if sys.platform in (["ios", "darwin", "win32"]):
    sys.stdin = open("Untitled.txt")
input = sys.stdin.readline

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

def MAP():
    return [int(s) for s in input().split()]

def main():
    S = input().rstrip()
    bcnt = 0
    A = []
    for i in range(len(S)):
        if S[i] == "B":
            bcnt += 1
        if S[i] == "W":
            A.append(bcnt)
    print((sum(A)))

if __name__ == "__main__":
    main()

import sys

sys.setrecursionlimit(10**6)
if sys.platform in (["ios", "darwin", "win32"]):
    sys.stdin = open("Untitled.txt")
input = sys.stdin.readline

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

def MAP():
    return [int(s) for s in input().split()]

def main():
    S = input().rstrip()
    bcnt = 0
    ans = 0
    for i in range(len(S)):
        if S[i] == "B":
            bcnt += 1
        if S[i] == "W":
            ans += bcnt
    print(ans)

if __name__ == "__main__":
    main()

-    A = []
+    ans = 0
-            A.append(bcnt)
-    print((sum(A)))
+            ans += bcnt
+    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:

import numpy as np

S = list(eval(input()))

S_len = len(S)

num_lst = np.zeros(S_len + 1)

for i in range(S_len):

    if S[i] == "<":

        num_lst[i + 1] = max(num_lst[i] + 1, num_lst[i + 1])

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

    if S[i] == ">":

        num_lst[i] = max(num_lst[i], num_lst[i + 1] + 1)

print((int(np.sum(num_lst))))

# optimized version of the same code:

S = list(eval(input()))

numList = [0] * (len(S) + 1)

for i in range(len(S)):

    if S[i] == '<':

        numList[i + 1] = numList[i] + 1

for i in range(len(S) - 1 , -1 , -1):

    if S[i] == '>':

        numList[i] = max(numList[i + 1] + 1 ,numList[i])

print((sum(numList)))

import numpy as np

S = list(eval(input()))
S_len = len(S)
num_lst = np.zeros(S_len + 1)
for i in range(S_len):
    if S[i] == "<":
        num_lst[i + 1] = max(num_lst[i] + 1, num_lst[i + 1])
for i in range(S_len - 1, -1, -1):
    if S[i] == ">":
        num_lst[i] = max(num_lst[i], num_lst[i + 1] + 1)
print((int(np.sum(num_lst))))

S = list(eval(input()))
numList = [0] * (len(S) + 1)
for i in range(len(S)):
    if S[i] == "<":
        numList[i + 1] = numList[i] + 1
for i in range(len(S) - 1, -1, -1):
    if S[i] == ">":
        numList[i] = max(numList[i + 1] + 1, numList[i])
print((sum(numList)))

-        num_lst[i + 1] = max(num_lst[i] + 1, num_lst[i + 1])

+        numList[i + 1] = numList[i] + 1

-        num_lst[i] = max(num_lst[i], num_lst[i + 1] + 1)

+        numList[i] = max(numList[i + 1] + 1, numList[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:

class SegmentTree:

    seg_len = 1

    node = []

    def __init__(self, n):

        while self.seg_len < n:

            self.seg_len <<= 1

        self.node = [ 0 for _ in range(self.seg_len*2) ]

    def add(self, idx, v):

        idx += self.seg_len

        self.node[idx] += v

        while True:

            idx //= 2

            if idx == 0:

                break

            self.node[idx] = self.node[idx*2] + self.node[idx*2+1]

    def sum(self, l, r):

        l += self.seg_len

        r += self.seg_len

        ret = 0

        while l < r:

            if l & 1 == 1:

                ret += self.node[l]

                l += 1

            if r & 1 == 1:

                ret += self.node[r-1]

                r -= 1

            l //= 2; r //= 2;

        return ret

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

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

seg_tree = SegmentTree(n)

for i in range(n):

    seg_tree.add(i, (1+p[i])/2)

ans = 0

for i in range(n-k+1):

    ans = max(ans, seg_tree.sum(i, i+k))

print(ans)

# optimized version of the same code:

class SegmentTree:

    seg_len = 1

    node = []

    def __init__(self, n):

        while self.seg_len < n:

            self.seg_len <<= 1

        self.node = [ 0 for _ in range(self.seg_len*2) ]

    def add(self, idx, v):

        idx += self.seg_len

        self.node[idx] += v

        while True:

            idx >>= 1

            if idx == 0:

                break

            self.node[idx] = self.node[idx*2] + self.node[idx*2+1]

    def sum(self, l, r):

        l += self.seg_len

        r += self.seg_len

        ret = 0

        while l < r:

            if l & 1 == 1:

                ret += self.node[l]

                l += 1

            if r & 1 == 1:

                ret += self.node[r-1]

                r -= 1

            l >>= 1; r >>= 1;

        return ret

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

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

seg_tree = SegmentTree(n)

for i in range(n):

    seg_tree.add(i, (1+p[i])/2)

ans = 0

for i in range(n-k+1):

    ans = max(ans, seg_tree.sum(i, i+k))

print(ans)

class SegmentTree:
    seg_len = 1
    node = []

    def __init__(self, n):
        while self.seg_len < n:
            self.seg_len <<= 1
        self.node = [0 for _ in range(self.seg_len * 2)]

    def add(self, idx, v):
        idx += self.seg_len
        self.node[idx] += v
        while True:
            idx //= 2
            if idx == 0:
                break
            self.node[idx] = self.node[idx * 2] + self.node[idx * 2 + 1]

    def sum(self, l, r):
        l += self.seg_len
        r += self.seg_len
        ret = 0
        while l < r:
            if l & 1 == 1:
                ret += self.node[l]
                l += 1
            if r & 1 == 1:
                ret += self.node[r - 1]
                r -= 1
            l //= 2
            r //= 2
        return ret

n, k = list(map(int, input().split()))
p = [int(x) for x in input().split()]
seg_tree = SegmentTree(n)
for i in range(n):
    seg_tree.add(i, (1 + p[i]) / 2)
ans = 0
for i in range(n - k + 1):
    ans = max(ans, seg_tree.sum(i, i + k))
print(ans)

class SegmentTree:
    seg_len = 1
    node = []

    def __init__(self, n):
        while self.seg_len < n:
            self.seg_len <<= 1
        self.node = [0 for _ in range(self.seg_len * 2)]

    def add(self, idx, v):
        idx += self.seg_len
        self.node[idx] += v
        while True:
            idx >>= 1
            if idx == 0:
                break
            self.node[idx] = self.node[idx * 2] + self.node[idx * 2 + 1]

    def sum(self, l, r):
        l += self.seg_len
        r += self.seg_len
        ret = 0
        while l < r:
            if l & 1 == 1:
                ret += self.node[l]
                l += 1
            if r & 1 == 1:
                ret += self.node[r - 1]
                r -= 1
            l >>= 1
            r >>= 1
        return ret

n, k = list(map(int, input().split()))
p = [int(x) for x in input().split()]
seg_tree = SegmentTree(n)
for i in range(n):
    seg_tree.add(i, (1 + p[i]) / 2)
ans = 0
for i in range(n - k + 1):
    ans = max(ans, seg_tree.sum(i, i + k))
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:

import time

t=time.time()

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

cnt=0

while(A%2==B%2==C%2==0):

    a,b,c=A,B,C

    A=b//2+c//2;B=a//2+c//2;C=a//2+b//2

    cnt+=1

    if(time.time()-t>=1):

        print((-1))

        exit()

print(cnt)

# optimized version of the same code:

import time

t = time.time()
A, B, C = list(map(int, input().split()))
cnt = 0
while A % 2 == B % 2 == C % 2 == 0:
    a, b, c = A, B, C
    A = b // 2 + c // 2
    B = a // 2 + c // 2
    C = a // 2 + b // 2
    cnt += 1
    if time.time() - t >= 1:
        print((-1))
        exit()
print(cnt)

-import time
-t = time.time()
+if A == B == C:
+    if A % 2 != 0:
+        print((0))
+    else:
+        print((-1))
+    exit()
-    if time.time() - t >= 1:
-        print((-1))
-        exit()


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:

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

n = 0

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

    f = True

    s = str(i)

    l = len(s)

    for j in range(l//2 + 1):

        if s[j] != s[- j - 1]:

            f = False

            break

    if f:

        n += 1

print(n)

# optimized version of the same code:

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

n = 0

for i in range(1, 10):

    for j in range(10):

        for k in range(10):

            s = 10000 * i + 1000 * j + 100 * k + 10 * j + i

            if a <= s <= b:

                n += 1

print(n)

a, b = list(map(int, input().split()))
n = 0
for i in range(a, b + 1):
    f = True
    s = str(i)
    l = len(s)
    for j in range(l // 2 + 1):
        if s[j] != s[-j - 1]:
            f = False
            break
    if f:
        n += 1
print(n)

a, b = list(map(int, input().split()))
n = 0
for i in range(1, 10):
    for j in range(10):
        for k in range(10):
            s = 10000 * i + 1000 * j + 100 * k + 10 * j + i
            if a <= s <= b:
                n += 1
print(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 numpy as np

cookies = np.array([int(x) for x in input().split()])

if any(cookies%2):

  ans = 0

elif cookies[0] == cookies[1] == cookies[2]:

  ans = -1

else:

  ans = 0

  while True:

    if not any(cookies%2):

      cookies = cookies//2

      ans += 1

      continue

    if all(cookies%2):

      ans += 1

    break

print(ans)

# optimized version of the same code:

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

if a == b == c and a%2 == 0:

  print((-1))

elif a%2 or b%2 or c%2:

  print((0))

else:

  ans = 0

  while a%2 == b%2 == c%2 == 0:

    a, b, c = (b+c)//2, (a+c)//2, (a+b)//2

    ans += 1

  print(ans)

import numpy as np

cookies = np.array([int(x) for x in input().split()])
if any(cookies % 2):
    ans = 0
elif cookies[0] == cookies[1] == cookies[2]:
    ans = -1
else:
    ans = 0
    while True:
        if not any(cookies % 2):
            cookies = cookies // 2
            ans += 1
            continue
        if all(cookies % 2):
            ans += 1
        break
print(ans)

a, b, c = list(map(int, input().split()))
if a == b == c and a % 2 == 0:
    print((-1))
elif a % 2 or b % 2 or c % 2:
    print((0))
else:
    ans = 0
    while a % 2 == b % 2 == c % 2 == 0:
        a, b, c = (b + c) // 2, (a + c) // 2, (a + b) // 2
        ans += 1
    print(ans)

-cookies = np.array([int(x) for x in input().split()])

-elif cookies[0] == cookies[1] == cookies[2]:

+a, b, c = 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 sys

read = sys.stdin.read

readline = sys.stdin.readline

readlines = sys.stdin.readlines

sys.setrecursionlimit(10 ** 9)

INF = 1 << 60

def main():

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

    ans = INF

    for bit in range(1 << N):

        if (not (bit & 1)) or bin(bit).count('1') != K:

            continue

        total = 0

        max_height = A[0]

        for i, a in enumerate(A[1:], 1):

            if a <= max_height:

                if bit & (1 << i):

                    total += max_height - a + 1

                    max_height += 1

            else:

                max_height = a

        if ans > total:

            ans = total

    print(ans)

    return

if __name__ == '__main__':

    main()

# optimized version of the same code:

import sys

from itertools import combinations

read = sys.stdin.read

readline = sys.stdin.readline

readlines = sys.stdin.readlines

sys.setrecursionlimit(10 ** 9)

INF = 1 << 60

def main():

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

    ans = INF

    for comb in combinations(list(range(1, N)), K - 1):

        included = [False] * N

        for i in comb:

            included[i] = True

        total = 0

        max_height = A[0]

        for i, a in enumerate(A[1:], 1):

            if a <= max_height:

                if included[i]:

                    total += max_height - a + 1

                    max_height += 1

            else:

                max_height = a

        if ans > total:

            ans = total

    print(ans)

    return

if __name__ == '__main__':

    main()

import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10**9)
INF = 1 << 60

def main():
    N, K, *A = list(map(int, read().split()))
    ans = INF
    for bit in range(1 << N):
        if (not (bit & 1)) or bin(bit).count("1") != K:
            continue
        total = 0
        max_height = A[0]
        for i, a in enumerate(A[1:], 1):
            if a <= max_height:
                if bit & (1 << i):
                    total += max_height - a + 1
                    max_height += 1
            else:
                max_height = a
        if ans > total:
            ans = total
    print(ans)
    return

if __name__ == "__main__":
    main()

import sys
from itertools import combinations

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10**9)
INF = 1 << 60

def main():
    N, K, *A = list(map(int, read().split()))
    ans = INF
    for comb in combinations(list(range(1, N)), K - 1):
        included = [False] * N
        for i in comb:
            included[i] = True
        total = 0
        max_height = A[0]
        for i, a in enumerate(A[1:], 1):
            if a <= max_height:
                if included[i]:
                    total += max_height - a + 1
                    max_height += 1
            else:
                max_height = a
        if ans > total:
            ans = total
    print(ans)
    return

if __name__ == "__main__":
    main()

-        if (not (bit & 1)) or bin(bit).count("1") != K:

+    for comb in combinations(list(range(1, N)), 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 math

n = int(eval(input()))

cnt = 0

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

    if math.floor(math.log10(i) + 1) % 2:

        cnt += 1

print(cnt)

# optimized version of the same code:

n = int(eval(input()))

cnt = 0

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

    if len(str(i)) % 2:

        cnt += 1

print(cnt)

-    if math.floor(math.log10(i) + 1) % 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:

from collections import defaultdict

n = int(eval(input()))

d = defaultdict(int)

for _ in range(n):

    key = eval(input())

    d[key] += 1

dict = sorted(list(d.items()), key=lambda x:x[1], reverse=True)

max_v = max(d.values())

dict_li = []

for a in dict:

    if a[1]==max_v:

        dict_li.append(a[0])

dict_li.sort()

for s in dict_li:

    print(s)

# optimized version of the same code:

from collections import defaultdict

n = int(input())

d = defaultdict(int)

for _ in range(n):

    key = input()

    d[key] += 1

dict = sorted(d.items(), key=lambda x:x[1], reverse=True)

max_v = max(d.values())

dict_li = []

for a in dict:

    if a[1]==max_v:

        dict_li.append(a[0])

dict_li.sort()

print(*dict_li, sep='\n')

from collections import defaultdict

n = int(eval(input()))
d = defaultdict(int)
for _ in range(n):
    key = eval(input())
    d[key] += 1
dict = sorted(list(d.items()), key=lambda x: x[1], reverse=True)
max_v = max(d.values())
dict_li = []
for a in dict:
    if a[1] == max_v:
        dict_li.append(a[0])
dict_li.sort()
for s in dict_li:
    print(s)

from collections import defaultdict

n = int(input())
d = defaultdict(int)
for _ in range(n):
    key = input()
    d[key] += 1
dict = sorted(d.items(), key=lambda x: x[1], reverse=True)
max_v = max(d.values())
dict_li = []
for a in dict:
    if a[1] == max_v:
        dict_li.append(a[0])
dict_li.sort()
print(*dict_li, sep="\n")

-dict = sorted(list(d.items()), key=lambda x: x[1], reverse=True)

+dict = sorted(d.items(), key=lambda x: x[1], reverse=True)


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:

# Use numpy if you use column operation

import numpy as np

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

# Get grid colors

gird_colors = np.array([])

for _ in range(h):

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

    if "#" in tmp_row: # If the row includes black

        gird_colors = np.concatenate((gird_colors, tmp_row))

gird_colors = gird_colors.reshape(-1, w)

# Search and delete white line

del_count = 0

for wi in range(w):

    if "#" not in gird_colors[:, wi - del_count]:

        gird_colors = np.delete(gird_colors, wi - del_count, 1)

        del_count += 1

# Print result

for line_val in gird_colors:

    print(("".join(line_val)))

# optimized version of the same code:

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

grid = [list(eval(input())) for _ in range(h)]

# Filtering the data if any "#" are existed in the each row or col

# Usage: filter(lambda row: <filtering condition>, grid or zip(*grid))

# If true, the row is not be deleted

# (Do not use if statement!)

row_compressed_grid = list([row for row in grid if any(x == "#" for x in row)])

compressed_grid = list([col for col in zip(*row_compressed_grid) if any(x == "#" for x in col)])

# list -> string and out

for row in zip(*compressed_grid):

    print(("".join(row)))

h, w = list(map(int, input().split()))
grid = [list(eval(input())) for _ in range(h)]
# Filtering the data if any "#" are existed in the each row or col
# Usage: filter(lambda row: <filtering condition>, grid or zip(*grid))
# If true, the row is not be deleted
# (Do not use if statement!)
row_compressed_grid = list([row for row in grid if any(x == "#" for x in row)])
compressed_grid = list(
    [col for col in zip(*row_compressed_grid) if any(x == "#" for x in col)]
)
# list -> string and out
for row in zip(*compressed_grid):
    print(("".join(row)))

-# Use numpy if you use column operation

-    tmp_row = np.array(list(eval(input())))

-    if "#" in tmp_row:  # If the row includes black

-        gird_colors = np.concatenate((gird_colors, tmp_row))

-gird_colors = gird_colors.reshape(-1, w)

-    if "#" not in gird_colors[:, wi - del_count]:

-        gird_colors = np.delete(gird_colors, wi - del_count, 1)

+grid = [list(eval(input())) for _ in range(h)]

+# Filtering the data if any "#" are existed in the each row or col

+# Usage: filter(lambda row: <filtering condition>, grid or zip(*grid))

+row_compressed_grid = list([row for row in grid if any(x == "#" for x in row)])

+    [col for col in zip(*row_compressed_grid) if any(x == "#" for x in col)]


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 = list(map(int,input().split()))

l = [0]*(10**5+1)

for i in range(n):

    ai,bi = list(map(int,input().split()))

    l[ai]+=bi

for index,i in enumerate(l):

    if i:

        k-=i

        if k<=0:

            break

print(index)

# optimized version of the same code:

from collections import defaultdict

from sys import stdin

input = stdin.readline

d = defaultdict(int)

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

for _ in range(n):

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

    d[a]+=b

for key in sorted(d.keys()):

    v = d[key]

    k-=v

    if k <= 0:

        break

print(key)

n, k = list(map(int, input().split()))
l = [0] * (10**5 + 1)
for i in range(n):
    ai, bi = list(map(int, input().split()))
    l[ai] += bi
for index, i in enumerate(l):
    if i:
        k -= i
        if k <= 0:
            break
print(index)

from collections import defaultdict
from sys import stdin

input = stdin.readline
d = defaultdict(int)
n, k = list(map(int, input().split()))
for _ in range(n):
    a, b = list(map(int, input().split()))
    d[a] += b
for key in sorted(d.keys()):
    v = d[key]
    k -= v
    if k <= 0:
        break
print(key)

-    ai, bi = list(map(int, input().split()))

+    a, b = 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:

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

cnt = 0

for i in range(A, B+1):

    l = list(str(i))

    if l == list(reversed(l)):

        cnt += 1

print(cnt)

# optimized version of the same code:

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

cnt = 0

for i in range(A, B+1):

    l = str(i)

    if l == l[::-1]:

        cnt += 1

print(cnt)

A, B = list(map(int, input().split()))
cnt = 0
for i in range(A, B + 1):
    l = list(str(i))
    if l == list(reversed(l)):
        cnt += 1
print(cnt)

A, B = list(map(int, input().split()))
cnt = 0
for i in range(A, B + 1):
    l = str(i)
    if l == l[::-1]:
        cnt += 1
print(cnt)

-    l = list(str(i))
-    if l == list(reversed(l)):
+    l = str(i)
+    if l == l[::-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:

n = int(eval(input()))

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

#print(n,ary)

ary_2 = [ary[0]]

for i in range(1, n):

    ary_2.append(ary[i] + ary_2[i-1])

ary_2 = [0] + ary_2

#print(ary_2)

from collections import Counter

c = Counter(ary_2)

v = (list(c.values()))

#print(v)

from math import factorial

def combinations_count(n, r):

    return factorial(n) // (factorial(n - r) * factorial(r))

ans = 0

for j in v:

    if j >1:

        ans += combinations_count(j,2)

print(ans)

# optimized version of the same code:

n = int(eval(input()))

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

#print(n,ary)

ary_2 = [ary[0]]

for i in range(1, n):

    ary_2.append(ary[i] + ary_2[i-1])

ary_2 = [0] + ary_2

#print(ary_2)

from collections import Counter

c = Counter(ary_2)

v = (list(c.values()))

#print(v)

ans = 0

for j in v:

    if j >1:

        ans += j * (j-1) // 2

print(ans)

n = int(eval(input()))
ary = list(map(int, input().split()))
# print(n,ary)
ary_2 = [ary[0]]
for i in range(1, n):
    ary_2.append(ary[i] + ary_2[i - 1])
ary_2 = [0] + ary_2
# print(ary_2)
from collections import Counter

c = Counter(ary_2)
v = list(c.values())
# print(v)
from math import factorial

def combinations_count(n, r):
    return factorial(n) // (factorial(n - r) * factorial(r))

ans = 0
for j in v:
    if j > 1:
        ans += combinations_count(j, 2)
print(ans)

n = int(eval(input()))
ary = list(map(int, input().split()))
# print(n,ary)
ary_2 = [ary[0]]
for i in range(1, n):
    ary_2.append(ary[i] + ary_2[i - 1])
ary_2 = [0] + ary_2
# print(ary_2)
from collections import Counter

c = Counter(ary_2)
v = list(c.values())
# print(v)
ans = 0
for j in v:
    if j > 1:
        ans += j * (j - 1) // 2
print(ans)

-    return factorial(n) // (factorial(n - r) * factorial(r))

-        ans += combinations_count(j, 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 numpy as np

def ABC133C(l, r):

    Min = np.inf

    for i in range(l, r):

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

            a = (i * j) % 2019

            if a < Min:

                Min = a

                if a == 0: # ここに注目

                    print(Min)

                    return

    print(Min)

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

ABC133C(l, r)

# optimized version of the same code:

def ABC133C(l, r):

    Min = 1e10

    for i in range(l, r):

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

            a = (i * j) % 2019

            if a < Min:

                Min = a

                if a == 0: # ここに注目

                    print(Min)

                    return

    print(Min)

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

ABC133C(l, r)

import numpy as np

def ABC133C(l, r):
    Min = np.inf
    for i in range(l, r):
        for j in range(i + 1, r + 1):
            a = (i * j) % 2019
            if a < Min:
                Min = a
                if a == 0:  # ここに注目
                    print(Min)
                    return
    print(Min)

l, r = list(map(int, input().split()))
ABC133C(l, r)

def ABC133C(l, r):
    Min = 1e10
    for i in range(l, r):
        for j in range(i + 1, r + 1):
            a = (i * j) % 2019
            if a < Min:
                Min = a
                if a == 0:  # ここに注目
                    print(Min)
                    return
    print(Min)

l, r = list(map(int, input().split()))
ABC133C(l, r)

-import numpy as np
-    Min = np.inf
+    Min = 1e10


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()))

mem = [[0]*10 for i in range(10)]

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

    a = int(str(i)[0])

    b = int(str(i)[-1])

    mem[a][b] += 1

ans = 0

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

    a = int(str(i)[0])

    b = int(str(i)[-1])

    ans += mem[b][a]

print(ans)

# optimized version of the same code:

N = int(eval(input()))

d = [[0]*10 for i in range(10)]

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

    s = str(n)

    d[int(s[0])][int(s[-1])] += 1

ans = 0

for i in range(10):

    for j in range(10):

        ans += d[i][j] * d[j][i]

print(ans)

N = int(eval(input()))
mem = [[0] * 10 for i in range(10)]
for i in range(1, N + 1):
    a = int(str(i)[0])
    b = int(str(i)[-1])
    mem[a][b] += 1
ans = 0
for i in range(1, N + 1):
    a = int(str(i)[0])
    b = int(str(i)[-1])
    ans += mem[b][a]
print(ans)

N = int(eval(input()))
d = [[0] * 10 for i in range(10)]
for n in range(1, N + 1):
    s = str(n)
    d[int(s[0])][int(s[-1])] += 1
ans = 0
for i in range(10):
    for j in range(10):
        ans += d[i][j] * d[j][i]
print(ans)

-mem = [[0] * 10 for i in range(10)]
-for i in range(1, N + 1):
-    a = int(str(i)[0])
-    b = int(str(i)[-1])
-    mem[a][b] += 1
+d = [[0] * 10 for i in range(10)]
+for n in range(1, N + 1):
+    s = str(n)
+    d[int(s[0])][int(s[-1])] += 1
-for i in range(1, N + 1):
-    a = int(str(i)[0])
-    b = int(str(i)[-1])
-    ans += mem[b][a]
+for i in range(10):
+    for j in range(10):
+        ans += d[i][j] * d[j][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:

N = int(eval(input()))

p = 1

for i in range(N):

    p *= (i + 1)

    p %= (1e9 + 7)

print((int(p)))

# optimized version of the same code:

N = int(eval(input()))

p = 1

for i in range(N):

    p = p * (i + 1) % (1e9 + 7)

print((int(p)))

N = int(eval(input()))
p = 1
for i in range(N):
    p *= i + 1
    p %= 1e9 + 7
print((int(p)))


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, n = list(map(int, input().split()))

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

diff = []

for i in range(n - 1):

    diff.append(a[i + 1] - a[i])

diff.append(k - a[-1] + a[0])

print((k - max(diff)))

# optimized version of the same code:

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

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

a.append(k + a[0])

diff = [a1 - a0 for a0, a1 in zip(a, a[1:])]

print((k - max(diff)))

+diff = [a1 - a0 for a0, a1 in zip(a, a[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:

class Calc:

    def __init__(self, max_value, mod):

        """combination(max_value, all)"""

        fact = [-1] * (max_value + 1)

        fact[0] = 1

        fact[1] = 1

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

            fact[x] = x * fact[x - 1] % mod

        invs = [1] * (max_value + 1)

        invs[max_value] = pow(fact[max_value], mod - 2, mod)

        for x in range(max_value - 1, 0, -1):

            invs[x] = invs[x + 1] * (x + 1) % mod

        self.fact = fact

        self.invs = invs

        self.mod = mod

    def combination(self, n, r):

        if n - r < r:

            return self.combination(n, n - r)

        if r < 0:

            return 0

        if r == 0:

            return 1

        if r == 1:

            return n

        return self.fact[n] * self.invs[r] * self.invs[n - r] % self.mod

def gen(n):

    x = n

    d = 2

    cnt = 0

    while x % d == 0:

        x //= d

        cnt += 1

    yield cnt

    d = 3

    ma = d * d

    while ma <= n:

        cnt = 0

        while x % d == 0:

            x //= d

            cnt += 1

        yield cnt

        ma += d * 4 + 4

        d += 2

    if x > 1:

        yield 1

def main():

    MOD = 10 ** 9 + 7

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

    cal = Calc(max_value=N + 30, mod=MOD)

    ans = 1

    for cnt in gen(M):

        ans = (ans * cal.combination(N + cnt - 1, cnt)) % MOD

    print(ans)

if __name__ == '__main__':

    main()

# optimized version of the same code:

def gen(n):

    x = n

    d = 2

    cnt = 0

    while x % d == 0:

        x //= d

        cnt += 1

    yield cnt

    d = 3

    while d * d <= n:

        cnt = 0

        while x % d == 0:

            x //= d

            cnt += 1

        yield cnt

        d += 2

    if x > 1:

        yield 1

def main():

    MOD = 10 ** 9 + 7

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

    ans = 1

    for cnt in gen(M):

        for d in range(cnt):

            ans = (ans * (N - 1 + cnt - d) % MOD) * pow(d + 1, MOD - 2, MOD) % MOD

    print(ans)

if __name__ == '__main__':

    main()

class Calc:
    def __init__(self, max_value, mod):
        """combination(max_value, all)"""
        fact = [-1] * (max_value + 1)
        fact[0] = 1
        fact[1] = 1
        for x in range(2, max_value + 1):
            fact[x] = x * fact[x - 1] % mod
        invs = [1] * (max_value + 1)
        invs[max_value] = pow(fact[max_value], mod - 2, mod)
        for x in range(max_value - 1, 0, -1):
            invs[x] = invs[x + 1] * (x + 1) % mod
        self.fact = fact
        self.invs = invs
        self.mod = mod

    def combination(self, n, r):
        if n - r < r:
            return self.combination(n, n - r)
        if r < 0:
            return 0
        if r == 0:
            return 1
        if r == 1:
            return n
        return self.fact[n] * self.invs[r] * self.invs[n - r] % self.mod

def gen(n):
    x = n
    d = 2
    cnt = 0
    while x % d == 0:
        x //= d
        cnt += 1
    yield cnt
    d = 3
    ma = d * d
    while ma <= n:
        cnt = 0
        while x % d == 0:
            x //= d
            cnt += 1
        yield cnt
        ma += d * 4 + 4
        d += 2
    if x > 1:
        yield 1

def main():
    MOD = 10**9 + 7
    N, M = list(map(int, input().split()))
    cal = Calc(max_value=N + 30, mod=MOD)
    ans = 1
    for cnt in gen(M):
        ans = (ans * cal.combination(N + cnt - 1, cnt)) % MOD
    print(ans)

if __name__ == "__main__":
    main()

def gen(n):
    x = n
    d = 2
    cnt = 0
    while x % d == 0:
        x //= d
        cnt += 1
    yield cnt
    d = 3
    while d * d <= n:
        cnt = 0
        while x % d == 0:
            x //= d
            cnt += 1
        yield cnt
        d += 2
    if x > 1:
        yield 1

def main():
    MOD = 10**9 + 7
    N, M = list(map(int, input().split()))
    ans = 1
    for cnt in gen(M):
        for d in range(cnt):
            ans = (ans * (N - 1 + cnt - d) % MOD) * pow(d + 1, MOD - 2, MOD) % MOD
    print(ans)

if __name__ == "__main__":
    main()

-    def __init__(self, max_value, mod):

-        """combination(max_value, all)"""

-        for x in range(2, max_value + 1):

-            fact[x] = x * fact[x - 1] % mod

-        invs[max_value] = pow(fact[max_value], mod - 2, mod)

-        for x in range(max_value - 1, 0, -1):

-            invs[x] = invs[x + 1] * (x + 1) % mod

-            return self.combination(n, n - r)

-        return self.fact[n] * self.invs[r] * self.invs[n - r] % self.mod

-    cal = Calc(max_value=N + 30, mod=MOD)

-        ans = (ans * cal.combination(N + cnt - 1, cnt)) % MOD

+            ans = (ans * (N - 1 + cnt - d) % MOD) * pow(d + 1, MOD - 2, MOD) % 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:

def c_remainder_minimization_2019(L, R):

    ans = float('inf')

    for i in range(L, min(R, L + 2019)):

        for j in range(i + 1, min(R + 1, L + 2020)):

            ans = min(ans, (i * j) % 2019)

    return ans

L, R = [int(i) for i in input().split()]

print((c_remainder_minimization_2019(L, R)))

# optimized version of the same code:

def c_remainder_minimization_2019(L, R):

    ans = float('inf')

    for i in range(L, min(R, L + 2019)):

        for j in range(i + 1, min(R + 1, L + 2020)):

            ans = min(ans, (i * j) % 2019)

            if ans == 0:

                return 0

    return ans

L, R = [int(i) for i in input().split()]

print((c_remainder_minimization_2019(L, R)))

def c_remainder_minimization_2019(L, R):
    ans = float("inf")
    for i in range(L, min(R, L + 2019)):
        for j in range(i + 1, min(R + 1, L + 2020)):
            ans = min(ans, (i * j) % 2019)
    return ans

L, R = [int(i) for i in input().split()]
print((c_remainder_minimization_2019(L, R)))

def c_remainder_minimization_2019(L, R):
    ans = float("inf")
    for i in range(L, min(R, L + 2019)):
        for j in range(i + 1, min(R + 1, L + 2020)):
            ans = min(ans, (i * j) % 2019)
            if ans == 0:
                return 0
    return ans

L, R = [int(i) for i in input().split()]
print((c_remainder_minimization_2019(L, R)))

+            if ans == 0:
+                return 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:

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

val = float('inf')

for k in range(10 ** 5 + 1):

    val = min(val, 2 * c * k + max(x - k, 0) * a + max(y - k, 0) * b)

print(val)

# optimized version of the same code:

A, B, C, X, Y = list(map(int, input().split()))

ans = 0

ans += min(A + B, 2 * C) * min(X, Y)

if X > Y:

    ans += min(A, 2 * C) * (X - Y)

elif X < Y:

    ans += min(B, 2 * C) * (Y - X)

print(ans)

a, b, c, x, y = list(map(int, input().split()))
val = float("inf")
for k in range(10**5 + 1):
    val = min(val, 2 * c * k + max(x - k, 0) * a + max(y - k, 0) * b)
print(val)

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

-    val = min(val, 2 * c * k + max(x - k, 0) * a + max(y - k, 0) * b)

+A, B, C, X, Y = 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:

x=int(eval(input()))

dic={}

for i in range(10**5):

  dic[i**5]=i

  dic[(-i)**5]=-i

for i in range(10**5):

    if i**5+x in dic:

      print((dic[i**5+x],i))

      break

    if (-i)**5+x in dic:

      print((dic[(-i)**5+x],-i))

      break

# optimized version of the same code:

x=int(eval(input()))

for a in range(-118,120):

  for b in range(-119,119):

    if a**5-b**5==x:

      print((a,b))

      exit()

x = int(eval(input()))
dic = {}
for i in range(10**5):
    dic[i**5] = i
    dic[(-i) ** 5] = -i
for i in range(10**5):
    if i**5 + x in dic:
        print((dic[i**5 + x], i))
        break
    if (-i) ** 5 + x in dic:
        print((dic[(-i) ** 5 + x], -i))
        break

x = int(eval(input()))
for a in range(-118, 120):
    for b in range(-119, 119):
        if a**5 - b**5 == x:
            print((a, b))
            exit()


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 as f

n = int(eval(input()))

print((f(n) % (10 ** 9 + 7)))

# optimized version of the same code:

n = int(eval(input()))

p = 1

for i in range(n):

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

print(p)

from math import factorial as f

n = int(eval(input()))
print((f(n) % (10**9 + 7)))

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

-from math import factorial as f
-print((f(n) % (10**9 + 7)))
+p = 1
+for i in range(n):
+    p = (p * (i + 1)) % (10**9 + 7)
+print(p)


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 numpy as np

from numba import njit

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

@njit('(i4[::1],i4,i8[::1])', cache=True)

def main(A, B, C):

    counts = np.zeros(1 << 18, np.int32)

    popcount = np.zeros(1 << B, np.int32)

    for i in range(B):

        popcount[1 << i:1 << i + 1] = popcount[:1 << i] + 1

    answer = 0

    for i in range(1 << B):

        k = popcount[i]

        t = 0

        for x in A & i:

            n = counts[x]

            counts[x] += 1

            t -= C[n]

            t += C[n + 1]

        for x in A & i:

            counts[x] = 0

        if k & 1:

            t = -t

        answer += t

    return answer

N, K, S, T = list(map(int, readline().split()))

A = np.array(readline().split(), np.int32)

def convert_problem(S, T, A):

    ng = np.zeros(len(A), np.bool)

    B = np.zeros_like(A)

    n = 0

    for i in range(18):

        s, t = (S >> i) & 1, (T >> i) & 1

        if (s, t) == (0, 0):

            ng |= ((A >> i) & 1) == 1

        elif (s, t) == (1, 1):

            ng |= ((A >> i) & 1) == 0

        elif (s, t) == (1, 0):

            print((0))

            exit()

        else:

            B += ((A >> i) & 1) << n

            n += 1

    return B[~ng], n

A, B = convert_problem(S, T, A)

C = np.zeros((100, 100), np.int64)

C[0, 0] = 1

for n in range(1, 100):

    C[n, :-1] += C[n - 1, :-1]

    C[n, 1:] += C[n - 1, :-1]

C = C[:, 1:K + 1].sum(axis=1)

print((main(A, B, C)))

# optimized version of the same code:

import sys

import numpy as np

from numba import njit

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

@njit('(i4[::1],i4,i8[::1])', cache=True)

def main(A, B, C):

    counts = np.zeros(1 << 18, np.int32)

    popcount = np.zeros(1 << B, np.int32)

    for i in range(B):

        popcount[1 << i:1 << i + 1] = popcount[:1 << i] + 1

    answer = 0

    for i in range(1 << B):

        k = popcount[i]

        t = 0

        for x in A & i:

            n = counts[x]

            counts[x] += 1

            t -= C[n]

            t += C[n + 1]

        for x in A & i:

            counts[x] = 0

        if k & 1:

            t = -t

        answer += t

    return answer

if sys.argv[-1] == 'ONLINE_JUDGE':

    from numba.pycc import CC

    cc = CC('my_module')

    cc.export('main', '(i4[::1],i4,i8[::1])')(main)

    cc.compile()

    exit()

from my_module import main

N, K, S, T = list(map(int, readline().split()))

A = np.array(readline().split(), np.int32)

def convert_problem(S, T, A):

    ng = np.zeros(len(A), np.bool)

    B = np.zeros_like(A)

    n = 0

    for i in range(18):

        s, t = (S >> i) & 1, (T >> i) & 1

        if (s, t) == (0, 0):

            ng |= ((A >> i) & 1) == 1

        elif (s, t) == (1, 1):

            ng |= ((A >> i) & 1) == 0

        elif (s, t) == (1, 0):

            print((0))

            exit()

        else:

            B += ((A >> i) & 1) << n

            n += 1

    return B[~ng], n

A, B = convert_problem(S, T, A)

C = np.zeros((100, 100), np.int64)

C[0, 0] = 1

for n in range(1, 100):

    C[n, :-1] += C[n - 1, :-1]

    C[n, 1:] += C[n - 1, :-1]

C = C[:, 1:K + 1].sum(axis=1)

print((main(A, B, C)))

import sys
import numpy as np
from numba import njit

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

@njit("(i4[::1],i4,i8[::1])", cache=True)
def main(A, B, C):
    counts = np.zeros(1 << 18, np.int32)
    popcount = np.zeros(1 << B, np.int32)
    for i in range(B):
        popcount[1 << i : 1 << i + 1] = popcount[: 1 << i] + 1
    answer = 0
    for i in range(1 << B):
        k = popcount[i]
        t = 0
        for x in A & i:
            n = counts[x]
            counts[x] += 1
            t -= C[n]
            t += C[n + 1]
        for x in A & i:
            counts[x] = 0
        if k & 1:
            t = -t
        answer += t
    return answer

N, K, S, T = list(map(int, readline().split()))
A = np.array(readline().split(), np.int32)

def convert_problem(S, T, A):
    ng = np.zeros(len(A), np.bool)
    B = np.zeros_like(A)
    n = 0
    for i in range(18):
        s, t = (S >> i) & 1, (T >> i) & 1
        if (s, t) == (0, 0):
            ng |= ((A >> i) & 1) == 1
        elif (s, t) == (1, 1):
            ng |= ((A >> i) & 1) == 0
        elif (s, t) == (1, 0):
            print((0))
            exit()
        else:
            B += ((A >> i) & 1) << n
            n += 1
    return B[~ng], n

A, B = convert_problem(S, T, A)
C = np.zeros((100, 100), np.int64)
C[0, 0] = 1
for n in range(1, 100):
    C[n, :-1] += C[n - 1, :-1]
    C[n, 1:] += C[n - 1, :-1]
C = C[:, 1 : K + 1].sum(axis=1)
print((main(A, B, C)))

import sys
import numpy as np
from numba import njit

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

@njit("(i4[::1],i4,i8[::1])", cache=True)
def main(A, B, C):
    counts = np.zeros(1 << 18, np.int32)
    popcount = np.zeros(1 << B, np.int32)
    for i in range(B):
        popcount[1 << i : 1 << i + 1] = popcount[: 1 << i] + 1
    answer = 0
    for i in range(1 << B):
        k = popcount[i]
        t = 0
        for x in A & i:
            n = counts[x]
            counts[x] += 1
            t -= C[n]
            t += C[n + 1]
        for x in A & i:
            counts[x] = 0
        if k & 1:
            t = -t
        answer += t
    return answer

if sys.argv[-1] == "ONLINE_JUDGE":
    from numba.pycc import CC

    cc = CC("my_module")
    cc.export("main", "(i4[::1],i4,i8[::1])")(main)
    cc.compile()
    exit()
from my_module import main

N, K, S, T = list(map(int, readline().split()))
A = np.array(readline().split(), np.int32)

def convert_problem(S, T, A):
    ng = np.zeros(len(A), np.bool)
    B = np.zeros_like(A)
    n = 0
    for i in range(18):
        s, t = (S >> i) & 1, (T >> i) & 1
        if (s, t) == (0, 0):
            ng |= ((A >> i) & 1) == 1
        elif (s, t) == (1, 1):
            ng |= ((A >> i) & 1) == 0
        elif (s, t) == (1, 0):
            print((0))
            exit()
        else:
            B += ((A >> i) & 1) << n
            n += 1
    return B[~ng], n

A, B = convert_problem(S, T, A)
C = np.zeros((100, 100), np.int64)
C[0, 0] = 1
for n in range(1, 100):
    C[n, :-1] += C[n - 1, :-1]
    C[n, 1:] += C[n - 1, :-1]
C = C[:, 1 : K + 1].sum(axis=1)
print((main(A, B, C)))


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,k=list(map(int,input().split()))

mod=10**9+7

f=[1]

for i in range(2*10**5+7):f+=[f[-1]*(i+1)%mod]

def comb(a,b):return f[a]*pow(f[b],mod-2,mod)*pow(f[a-b],mod-2,mod)%mod

ans=0

for i in range(1,n):

  ans+=(i*(n-i)*m**2)*(comb(n*m-2,k-2))

  ans%=mod

for i in range(1,m):

  ans+=(i*(m-i)*n**2)*(comb(n*m-2,k-2))

  ans%=mod

print(ans)

# optimized version of the same code:

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

mod = 10**9+7

f = [1]

for i in range(n*m):

  f += [f[-1]*(i+1) % mod]

def comb(a, b):

  return f[a]*pow(f[b], mod-2, mod)*pow(f[a-b], mod-2, mod) % mod

ans=0

for dist in range(1,n):

  c=n-dist

  p=(c*m*m)%mod

  ans+=p*dist

for dist in range(1,m):

  c=m-dist

  p=(c*n*n)%mod

  ans+=p*dist

ans%=mod

print((ans*comb(n*m-2,k-2)%mod))

n, m, k = list(map(int, input().split()))
mod = 10**9 + 7
f = [1]
for i in range(2 * 10**5 + 7):
    f += [f[-1] * (i + 1) % mod]

def comb(a, b):
    return f[a] * pow(f[b], mod - 2, mod) * pow(f[a - b], mod - 2, mod) % mod

ans = 0
for i in range(1, n):
    ans += (i * (n - i) * m**2) * (comb(n * m - 2, k - 2))
    ans %= mod
for i in range(1, m):
    ans += (i * (m - i) * n**2) * (comb(n * m - 2, k - 2))
    ans %= mod
print(ans)

n, m, k = list(map(int, input().split()))
mod = 10**9 + 7
f = [1]
for i in range(n * m):
    f += [f[-1] * (i + 1) % mod]

def comb(a, b):
    return f[a] * pow(f[b], mod - 2, mod) * pow(f[a - b], mod - 2, mod) % mod

ans = 0
for dist in range(1, n):
    c = n - dist
    p = (c * m * m) % mod
    ans += p * dist
for dist in range(1, m):
    c = m - dist
    p = (c * n * n) % mod
    ans += p * dist
ans %= mod
print((ans * comb(n * m - 2, k - 2) % mod))

+print((ans * comb(n * m - 2, k - 2) % 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 sys import stdin

import numpy as np

h,w= [int(x) for x in stdin.readline().rstrip().split()]

li = [["" for i in range(w)]for j in range(h)]

for i in range(h):

    s = stdin.readline().rstrip()

    for j in range(w):

        li[i][j] = s[j]

li = np.asarray([s for s in li if s != ['.']*w]).T.tolist()

li = np.asarray([s for s in li if s != ['.']*len(li[0])]).T.tolist()

for i in li:

    s = ""

    for j in range(len(li[0])):

        s += i[j]

    print(s)

# optimized version of the same code:

from sys import stdin,setrecursionlimit

setrecursionlimit(10 ** 7)

h,w = list(map(int,stdin.readline().rstrip().split()))

li = [["" for i in range(w)]for j in range(h)]

for i in range(h):

    s = stdin.readline().rstrip()

    for j in range(w):

        li[i][j] = s[j]

lin = []

for i in li:

    if i != ["."]*w:

        lin.append(i)

out = []

for i in range(w):

    flag = True

    for j in range(len(lin)):

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

            flag = False

    if flag:

        out.append(i)

lis = []

for i in lin:

    case = []

    for j,k in enumerate(i):

        if j in out:

            continue

        case.append(k)

    lis.append(case)

for i in lis:

    print(("".join(i)))

from sys import stdin
import numpy as np

h, w = [int(x) for x in stdin.readline().rstrip().split()]
li = [["" for i in range(w)] for j in range(h)]
for i in range(h):
    s = stdin.readline().rstrip()
    for j in range(w):
        li[i][j] = s[j]
li = np.asarray([s for s in li if s != ["."] * w]).T.tolist()
li = np.asarray([s for s in li if s != ["."] * len(li[0])]).T.tolist()
for i in li:
    s = ""
    for j in range(len(li[0])):
        s += i[j]
    print(s)

from sys import stdin, setrecursionlimit

setrecursionlimit(10**7)
h, w = list(map(int, stdin.readline().rstrip().split()))
li = [["" for i in range(w)] for j in range(h)]
for i in range(h):
    s = stdin.readline().rstrip()
    for j in range(w):
        li[i][j] = s[j]
lin = []
for i in li:
    if i != ["."] * w:
        lin.append(i)
out = []
for i in range(w):
    flag = True
    for j in range(len(lin)):
        if lin[j][i] == "#":
            flag = False
    if flag:
        out.append(i)
lis = []
for i in lin:
    case = []
    for j, k in enumerate(i):
        if j in out:
            continue
        case.append(k)
    lis.append(case)
for i in lis:
    print(("".join(i)))

+from sys import stdin, setrecursionlimit

-h, w = [int(x) for x in stdin.readline().rstrip().split()]

+h, w = list(map(int, stdin.readline().rstrip().split()))

-li = np.asarray([s for s in li if s != ["."] * w]).T.tolist()

-li = np.asarray([s for s in li if s != ["."] * len(li[0])]).T.tolist()


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

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

# optimized version of the same code:

ans=1

n=int(eval(input()))

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

  ans*=i

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

print(ans)

import math

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

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

-print((math.factorial(int(eval(input()))) % (10**9 + 7)))


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:

A, B, C, X, Y = [int(_) for _ in input().split()]

ans = A * X + B * Y

for i in range(max(X, Y) + 1):

    cost = 2 * C * i

    if X > i:

        cost += A * (X - i)

    if Y > i:

        cost += B * (Y - i)

    ans = min(ans, cost)

print(ans)

# optimized version of the same code:

A, B, C, X, Y = [int(_) for _ in input().split()]

M = max(X, Y)

print((min(2 * C * M, 2 * C * (X + Y - M) + A *

          (M - Y) + B * (M - X), A * X + B * Y)))


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

N = int(input())

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

inds = numpy.argsort(A)

inds+=1

for ind in inds:

  print(ind, end=' ')

# optimized version of the same code:

N = int(eval(input()))

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

ans = [0]*N

for i,a in enumerate(A):

  ans[a-1] = i+1

print((*ans))

import numpy

N = int(input())
A = list(map(int, input().split()))
inds = numpy.argsort(A)
inds += 1
for ind in inds:
    print(ind, end=" ")

N = int(eval(input()))
A = list(map(int, input().split()))
ans = [0] * N
for i, a in enumerate(A):
    ans[a - 1] = i + 1
print((*ans))

-import numpy
-N = int(input())
+N = int(eval(input()))
-inds = numpy.argsort(A)
-inds += 1
-for ind in inds:
-    print(ind, end=" ")
+ans = [0] * N
+for i, a in enumerate(A):
+    ans[a - 1] = i + 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:

s = eval(input())

len_s = len(s)

cnt = [0, 0]

for i in range(1, len(s)):

    memo_0 = s[i - 1]

    memo_1 = s[len_s - i]

    if s[i] != memo_0:

        cnt[0] += 1

    if s[len_s - i - 1] != memo_1:

        cnt[1] += 1

print((min(cnt)))

# optimized version of the same code:

s = eval(input())

len_s = len(s)

cnt = 0

for i in range(1, len(s)):

    memo_0 = s[i - 1]

    if s[i] != memo_0:

        cnt += 1

print(cnt)


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

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

# cを全探索？

res = float('inf')

for i in range(max(x,y)*2+1):

    money = i * c

    if i/2<x:

        money += math.ceil(x-i/2) * a

    if i/2<y:

        money += math.ceil(y-i/2) * b

    res = min(res,money)

print(res)

# optimized version of the same code:

res = 10**30

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

for i in range(0,max(x,y)+1):

    # ABを2*iまい買う

    tmp = 2 * i * c

    xx,yy = x - i, y - i

    tmp += max(0,xx) * a

    tmp += max(0,yy) * b

    res = min(res, tmp)

print(res)

import math

a, b, c, x, y = list(map(int, input().split()))
# cを全探索？
res = float("inf")
for i in range(max(x, y) * 2 + 1):
    money = i * c
    if i / 2 < x:
        money += math.ceil(x - i / 2) * a
    if i / 2 < y:
        money += math.ceil(y - i / 2) * b
    res = min(res, money)
print(res)

res = 10**30
a, b, c, x, y = list(map(int, input().split()))
for i in range(0, max(x, y) + 1):
    # ABを2*iまい買う
    tmp = 2 * i * c
    xx, yy = x - i, y - i
    tmp += max(0, xx) * a
    tmp += max(0, yy) * b
    res = min(res, tmp)
print(res)

-        money += math.ceil(x - i / 2) * a

-        money += math.ceil(y - i / 2) * b