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

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

dp = ["Second"] * (k + 1)

for i in range(k + 1):

    if dp[i] == "Second":

        for a in a_s:

            ii = i + a

            if ii <= k:

                dp[ii] = "First"

print((dp[-1]))

# optimized version of the same code:

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

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

dp = ["Second"] * (k + 1)

for i in range(k + 1):

    if dp[i] == "Second":

        for a in a_s:

            ii = i + a

            if ii > k:break

            dp[ii] = "First"

print((dp[-1]))

n, k = list(map(int, input().split()))
a_s = list(map(int, input().split()))
dp = ["Second"] * (k + 1)
for i in range(k + 1):
    if dp[i] == "Second":
        for a in a_s:
            ii = i + a
            if ii > k:
                break
            dp[ii] = "First"
print((dp[-1]))

-            if ii <= k:
-                dp[ii] = "First"
+            if ii > k:
+                break
+            dp[ii] = "First"


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, T = [list(eval(input())) for _ in range(2)]

cnt = 0

for i in range(len(S)):

    if S[i] != T[i]:

        cnt += 1

print(cnt)

# optimized version of the same code:

s, t = [eval(input()) for i in range(2)]

ans = 0

for i in range(len(s)):

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

    ans += 1

print(ans)

-S, T = [list(eval(input())) for _ in range(2)]

+s, t = [eval(input()) for i in range(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:

N = int(eval(input()))

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

cnt = 0

for i in range(N-1):

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

        cnt += D[i]*D[j]

print(cnt)

# optimized version of the same code:

N = int(eval(input()))

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

cnt = 0

for i in range(N):

    cnt += D[i]**2

tot = 0

for i in range(N):

    tot += D[i]

tot = tot**2

tot -= cnt

print((tot//2))

N = int(eval(input()))
D = list(map(int, input().split()))
cnt = 0
for i in range(N - 1):
    for j in range(i + 1, N):
        cnt += D[i] * D[j]
print(cnt)

N = int(eval(input()))
D = list(map(int, input().split()))
cnt = 0
for i in range(N):
    cnt += D[i] ** 2
tot = 0
for i in range(N):
    tot += D[i]
tot = tot**2
tot -= cnt
print((tot // 2))

-for i in range(N - 1):
-    for j in range(i + 1, N):
-        cnt += D[i] * D[j]
-print(cnt)
+for i in range(N):
+    cnt += D[i] ** 2
+tot = 0
+for i in range(N):
+    tot += D[i]
+tot = tot**2
+tot -= cnt
+print((tot // 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 deque

from itertools import product

import sys

import math

import numpy as np

import bisect

sys.setrecursionlimit(200000)

input = sys.stdin.readline

def read():

    N = int(input().strip())

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

    return N, A

def argsort(seq):

    return sorted(list(range(len(seq))), key=seq.__getitem__)

def solve(N, A):

    # x: i-A[i]の列

    X = np.array([i-A[i] for i in range(N)], dtype=np.int)

    # y: i+A[i]の列

    Y = np.array([i+A[i] for i in range(N)], dtype=np.int)

    keys = np.argsort(X)

    X = X[keys]  # x[i] <= x[i+1]

    Y = Y[keys]

    ans = 0

    for y in Y:

        l = bisect.bisect_left(X, y)

        r = bisect.bisect_left(X, y+1)

        ans += r - l

    return ans

if __name__ == '__main__':

    inputs = read()

    outputs = solve(*inputs)

    print(("{}".format(outputs)))

# optimized version of the same code:

from collections import defaultdict

from itertools import product

import sys

import math

import bisect

sys.setrecursionlimit(200000)

input = sys.stdin.readline

def read():

    N = int(input().strip())

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

    return N, A

def solve(N, A):

    # x: i-A[i]の列

    X = [i-A[i] for i in range(N)]

    # y: i+A[i]の列

    Y = [i+A[i] for i in range(N)]

    z = defaultdict(int)

    for y in Y:

        z[y] += 1

    return sum([z[x] for x in X])

if __name__ == '__main__':

    inputs = read()

    outputs = solve(*inputs)

    print(("{}".format(outputs)))

from collections import deque
from itertools import product
import sys
import math
import numpy as np
import bisect

sys.setrecursionlimit(200000)
input = sys.stdin.readline

def read():
    N = int(input().strip())
    A = list(map(int, input().strip().split()))
    return N, A

def argsort(seq):
    return sorted(list(range(len(seq))), key=seq.__getitem__)

def solve(N, A):
    # x: i-A[i]の列
    X = np.array([i - A[i] for i in range(N)], dtype=np.int)
    # y: i+A[i]の列
    Y = np.array([i + A[i] for i in range(N)], dtype=np.int)
    keys = np.argsort(X)
    X = X[keys]  # x[i] <= x[i+1]
    Y = Y[keys]
    ans = 0
    for y in Y:
        l = bisect.bisect_left(X, y)
        r = bisect.bisect_left(X, y + 1)
        ans += r - l
    return ans

if __name__ == "__main__":
    inputs = read()
    outputs = solve(*inputs)
    print(("{}".format(outputs)))

from collections import defaultdict
from itertools import product
import sys
import math
import bisect

sys.setrecursionlimit(200000)
input = sys.stdin.readline

def read():
    N = int(input().strip())
    A = list(map(int, input().strip().split()))
    return N, A

def solve(N, A):
    # x: i-A[i]の列
    X = [i - A[i] for i in range(N)]
    # y: i+A[i]の列
    Y = [i + A[i] for i in range(N)]
    z = defaultdict(int)
    for y in Y:
        z[y] += 1
    return sum([z[x] for x in X])

if __name__ == "__main__":
    inputs = read()
    outputs = solve(*inputs)
    print(("{}".format(outputs)))

-    return sorted(list(range(len(seq))), key=seq.__getitem__)

-    X = np.array([i - A[i] for i in range(N)], dtype=np.int)

-    Y = np.array([i + A[i] for i in range(N)], dtype=np.int)

-        r = bisect.bisect_left(X, y + 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=int(eval(input()))

s=np.argsort(np.array(list(map(int,input().split()))))+1

print((*s))

# optimized version of the same code:

n=int(eval(input()))

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

l=sorted([[inx+1,j] for inx,j in enumerate(a)],key=lambda x:x[1])

ans=[i for i,j in l]

print((*ans))

import numpy as np

n = int(eval(input()))
s = np.argsort(np.array(list(map(int, input().split())))) + 1
print((*s))

n = int(eval(input()))
a = list(map(int, input().split()))
l = sorted([[inx + 1, j] for inx, j in enumerate(a)], key=lambda x: x[1])
ans = [i for i, j in l]
print((*ans))

-s = np.argsort(np.array(list(map(int, input().split())))) + 1

+l = sorted([[inx + 1, j] for inx, j in enumerate(a)], key=lambda x: x[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

import itertools

X, Y, Z, K = tuple([int(x) for x in str(eval(input())).split(' ')])

A = np.array(sorted([int(x) for x in str(eval(input())).split(' ')], reverse=True))

B = np.array(sorted([int(x) for x in str(eval(input())).split(' ')], reverse=True))

C = np.array(sorted([int(x) for x in str(eval(input())).split(' ')], reverse=True))

tmp = {(0, 0, 0) : A[0] + B[0] + C[0]}

tmp_keys = [(0, 0 ,0)]

out = []

for i in range(K):

    (a, b, c),  p = max(list(tmp.items()), key=lambda x : x[1])

    out.append(tmp.pop((a, b, c)))

    keys = []

    if a < X - 1:

        keys.append((a+1, b, c))

    if b < Y - 1:

        keys.append((a, b+1, c))

    if c < Z - 1:

        keys.append((a, b, c+1))

    for key in keys:

        if key not in tmp_keys:

            tmp[key] = A[key[0]] + B[key[1]] + C[key[2]]

            tmp_keys.append(key)

for x in out:

    print(x)

# optimized version of the same code:

import itertools

X, Y, Z, K = tuple([int(x) for x in str(eval(input())).split(' ')])

A = sorted([int(x) for x in str(eval(input())).split(' ')], reverse=True)

B = sorted([int(x) for x in str(eval(input())).split(' ')], reverse=True)

C = sorted([int(x) for x in str(eval(input())).split(' ')], reverse=True)

tmp = {(0, 0, 0) : A[0] + B[0] + C[0]}

tmp_keys = [(0, 0 ,0)]

out = []

for i in range(K):

    (a, b, c),  p = max(list(tmp.items()), key=lambda x : x[1])

    out.append(tmp.pop((a, b, c)))

    keys = []

    if a < X - 1:

        keys.append((a+1, b, c))

    if b < Y - 1:

        keys.append((a, b+1, c))

    if c < Z - 1:

        keys.append((a, b, c+1))

    for key in keys:

        if key not in tmp_keys:

            tmp[key] = A[key[0]] + B[key[1]] + C[key[2]]

            tmp_keys.append(key)

for x in out:

    print(x)

import numpy as np
import itertools

X, Y, Z, K = tuple([int(x) for x in str(eval(input())).split(" ")])
A = np.array(sorted([int(x) for x in str(eval(input())).split(" ")], reverse=True))
B = np.array(sorted([int(x) for x in str(eval(input())).split(" ")], reverse=True))
C = np.array(sorted([int(x) for x in str(eval(input())).split(" ")], reverse=True))
tmp = {(0, 0, 0): A[0] + B[0] + C[0]}
tmp_keys = [(0, 0, 0)]
out = []
for i in range(K):
    (a, b, c), p = max(list(tmp.items()), key=lambda x: x[1])
    out.append(tmp.pop((a, b, c)))
    keys = []
    if a < X - 1:
        keys.append((a + 1, b, c))
    if b < Y - 1:
        keys.append((a, b + 1, c))
    if c < Z - 1:
        keys.append((a, b, c + 1))
    for key in keys:
        if key not in tmp_keys:
            tmp[key] = A[key[0]] + B[key[1]] + C[key[2]]
            tmp_keys.append(key)
for x in out:
    print(x)

import itertools

X, Y, Z, K = tuple([int(x) for x in str(eval(input())).split(" ")])
A = sorted([int(x) for x in str(eval(input())).split(" ")], reverse=True)
B = sorted([int(x) for x in str(eval(input())).split(" ")], reverse=True)
C = sorted([int(x) for x in str(eval(input())).split(" ")], reverse=True)
tmp = {(0, 0, 0): A[0] + B[0] + C[0]}
tmp_keys = [(0, 0, 0)]
out = []
for i in range(K):
    (a, b, c), p = max(list(tmp.items()), key=lambda x: x[1])
    out.append(tmp.pop((a, b, c)))
    keys = []
    if a < X - 1:
        keys.append((a + 1, b, c))
    if b < Y - 1:
        keys.append((a, b + 1, c))
    if c < Z - 1:
        keys.append((a, b, c + 1))
    for key in keys:
        if key not in tmp_keys:
            tmp[key] = A[key[0]] + B[key[1]] + C[key[2]]
            tmp_keys.append(key)
for x in out:
    print(x)

-A = np.array(sorted([int(x) for x in str(eval(input())).split(" ")], reverse=True))

-B = np.array(sorted([int(x) for x in str(eval(input())).split(" ")], reverse=True))

-C = np.array(sorted([int(x) for x in str(eval(input())).split(" ")], reverse=True))

+A = sorted([int(x) for x in str(eval(input())).split(" ")], reverse=True)

+B = sorted([int(x) for x in str(eval(input())).split(" ")], reverse=True)

+C = sorted([int(x) for x in str(eval(input())).split(" ")], 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:

import sys

input = sys.stdin.readline

N = int(eval(input()))

keta = len(str(N))

if keta == 1:

    print(N)

    sys.exit()

ans = {}

for i in [1,2,3,4,5,6,7,8,9]:

    for j in [1,2,3,4,5,6,7,8,9]:

        ans[(i, j)] = 0

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

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

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

    if mindigit != 0:

        ans[(maxdigit, mindigit)] += 1

cnt = 0

for i in range(1, 10):

    for j in range(1, 10):

        if i == j:

            cnt += ans[(i, i)] ** 2

        else:

            cnt += ans[(i, j)] * ans[(j, i)] * 2

            ans[(i, j)] = 0

            ans[(j, i)] = 0

print(cnt)

# optimized version of the same code:

import sys

input = sys.stdin.readline

n = int(eval(input()))

from collections import defaultdict

d = defaultdict(int) # d[(a, b)] : 先頭a, 末尾b

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

    i_str = str(i)

    d[(i_str[0], i_str[-1])] += 1

ans = 0

for i in range(1, 10):

    for j in range(10):

        ans += d[(str(i), str(j))] * d[(str(j), str(i))]

print(ans)

import sys

input = sys.stdin.readline
N = int(eval(input()))
keta = len(str(N))
if keta == 1:
    print(N)
    sys.exit()
ans = {}
for i in [1, 2, 3, 4, 5, 6, 7, 8, 9]:
    for j in [1, 2, 3, 4, 5, 6, 7, 8, 9]:
        ans[(i, j)] = 0
for i in range(1, N + 1):
    maxdigit = int(str(i)[0])
    mindigit = int(str(i)[-1])
    if mindigit != 0:
        ans[(maxdigit, mindigit)] += 1
cnt = 0
for i in range(1, 10):
    for j in range(1, 10):
        if i == j:
            cnt += ans[(i, i)] ** 2
        else:
            cnt += ans[(i, j)] * ans[(j, i)] * 2
            ans[(i, j)] = 0
            ans[(j, i)] = 0
print(cnt)

+d = defaultdict(int)  # d[(a, b)] : 先頭a, 末尾b


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

from math import factorial

s = int(eval(input()))

mod = pow(10, 9) + 7

def nCr(n, r):

    return int(factorial(n) // factorial(r) // factorial (n - r) % mod)

ans = 0

seq_len = s // 3

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

    ans += nCr(s - 3 * i + (i - 1), i - 1)

print((ans % mod))

# optimized version of the same code:

# 動的計画法による解法

s = int(eval(input()))

mod = pow(10, 9) + 7

A = [0] * (s + 1)

if s >= 3:

    A[3] = 1

for i in range(4, s + 1):

    A[i] = (A[i - 3] + A[i - 1]) % mod

print((A[s]))

from math import factorial

s = int(eval(input()))
mod = pow(10, 9) + 7

def nCr(n, r):
    return int(factorial(n) // factorial(r) // factorial(n - r) % mod)

ans = 0
seq_len = s // 3
for i in range(1, seq_len + 1):
    ans += nCr(s - 3 * i + (i - 1), i - 1)
print((ans % mod))

+# 動的計画法による解法

-    return int(factorial(n) // factorial(r) // factorial(n - r) % 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:

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

mn = [0]*N

for i in range(N):

  mn[i] = int(eval(input()))

ans = N

x = X - sum(mn)

while(x >= min(mn)):

  if x // min(mn) == 0:

    mn[mn.index(min(mn))] = 1000000

  else:

    if x >= min(mn):

      x -= min(mn)

      ans += 1

print(ans)

# optimized version of the same code:

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

mn = [0]*N

for i in range(N):

  mn[i] = int(eval(input()))

ans = N

x = X - sum(mn)

while(x >= min(mn)):

  if x // min(mn) == 0:

    mn[mn.index(min(mn))] = 1000000

  else:

    x -= min(mn)

    ans += 1

print(ans)

N, X = list(map(int, input().split()))
mn = [0] * N
for i in range(N):
    mn[i] = int(eval(input()))
ans = N
x = X - sum(mn)
while x >= min(mn):
    if x // min(mn) == 0:
        mn[mn.index(min(mn))] = 1000000
    else:
        if x >= min(mn):
            x -= min(mn)
            ans += 1
print(ans)

N, X = list(map(int, input().split()))
mn = [0] * N
for i in range(N):
    mn[i] = int(eval(input()))
ans = N
x = X - sum(mn)
while x >= min(mn):
    if x // min(mn) == 0:
        mn[mn.index(min(mn))] = 1000000
    else:
        x -= min(mn)
        ans += 1
print(ans)

-        if x >= min(mn):
-            x -= min(mn)
-            ans += 1
+        x -= min(mn)
+        ans += 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=int(eval(input()))

print((2**int(np.log2(N))))

# optimized version of the same code:

import math

N=int(eval(input()))

print((2**int(math.log2(N))))

import numpy as np

N = int(eval(input()))
print((2 ** int(np.log2(N))))

import math

N = int(eval(input()))
print((2 ** int(math.log2(N))))

-import numpy as np
+import math
-print((2 ** int(np.log2(N))))
+print((2 ** int(math.log2(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:

#! /usr/bin/env python3

import sys

int1 = lambda x: int(x) - 1

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

sys.setrecursionlimit(500000)

def isMultiple(s, m):

    tmp = 0

    for i in range(len(s)):

        tmp = (tmp * 10 + int(s[i])) % m

        if tmp == 0:

            return i

    return -1

k = int(readline())

acc = "7" * 50000000

if k % 2 == 0:

    ans = -1

else:

    ans = isMultiple(acc, k)

    if ans != -1:

        ans += 1

print(ans)

# optimized version of the same code:

#! /usr/bin/env python3

import sys

int1 = lambda x: int(x) - 1

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

sys.setrecursionlimit(500000)

k = int(readline())

ans = -1

acc = 7 % k

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

    if acc == 0:

        ans = n

        break

    acc = (10 * acc + 7) % 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:

from math import floor, sqrt

from collections import Counter

MOD = 10 ** 9 + 7

# xを素因数分解する

def getPrimeFactor(x):

    ans = []

    for d in range(2, floor(sqrt(x)) + 1):

        while x % d == 0:

            ans.append(d)

            x //= d

    if x != 1:

        ans.append(x)

    return ans

# xのn乗（二分累乗法）

def power(x, n):

    ans = 1

    while n:

        if n % 2 == 1:

            ans = (ans * x) % MOD

        x = (x * x) % MOD

        n //= 2

    return ans

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

PFs = getPrimeFactor(M)

cnt = Counter(PFs)

N2 = N

if len(cnt):

    N2 += max(cnt.values())

# facts[x]: xの階乗

facts = [1] + [0] * N2

for x in range(1, N2 + 1):

    facts[x] = (facts[x - 1] * x) % MOD

# invFs[x]: xの階乗の逆元

invFs = [0] * N2 + [power(facts[N2], MOD - 2)]

for x in reversed(list(range(N2))):

    invFs[x] = (invFs[x + 1] * (x + 1)) % MOD

def comb(n, k):

    return ((facts[n] * invFs[k]) % MOD * invFs[n - k]) % MOD

ans = 1

for num in list(cnt.values()):

    ans = (ans * comb(N + num - 1, num)) % MOD

print(ans)

# optimized version of the same code:

from math import floor, sqrt

from collections import Counter

MOD = 10 ** 9 + 7

# xを素因数分解する

def getPrimeFactor(x):

    ans = []

    for d in range(2, floor(sqrt(x)) + 1):

        while x % d == 0:

            ans.append(d)

            x //= d

    if x != 1:

        ans.append(x)

    return ans

def comb(n, k):

    k = min(k, n - k)

    ans = 1

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

        ans *= i

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

        ans //= i

    return ans

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

PFs = getPrimeFactor(M)

cnt = Counter(PFs)

ans = 1

for num in list(cnt.values()):

    ans *= comb(N + num - 1, num)

print((ans % MOD))

from math import floor, sqrt
from collections import Counter

MOD = 10**9 + 7
# xを素因数分解する
def getPrimeFactor(x):
    ans = []
    for d in range(2, floor(sqrt(x)) + 1):
        while x % d == 0:
            ans.append(d)
            x //= d
    if x != 1:
        ans.append(x)
    return ans

# xのn乗（二分累乗法）
def power(x, n):
    ans = 1
    while n:
        if n % 2 == 1:
            ans = (ans * x) % MOD
        x = (x * x) % MOD
        n //= 2
    return ans

N, M = list(map(int, input().split()))
PFs = getPrimeFactor(M)
cnt = Counter(PFs)
N2 = N
if len(cnt):
    N2 += max(cnt.values())
# facts[x]: xの階乗
facts = [1] + [0] * N2
for x in range(1, N2 + 1):
    facts[x] = (facts[x - 1] * x) % MOD
# invFs[x]: xの階乗の逆元
invFs = [0] * N2 + [power(facts[N2], MOD - 2)]
for x in reversed(list(range(N2))):
    invFs[x] = (invFs[x + 1] * (x + 1)) % MOD

def comb(n, k):
    return ((facts[n] * invFs[k]) % MOD * invFs[n - k]) % MOD

ans = 1
for num in list(cnt.values()):
    ans = (ans * comb(N + num - 1, num)) % MOD
print(ans)

from math import floor, sqrt
from collections import Counter

MOD = 10**9 + 7
# xを素因数分解する
def getPrimeFactor(x):
    ans = []
    for d in range(2, floor(sqrt(x)) + 1):
        while x % d == 0:
            ans.append(d)
            x //= d
    if x != 1:
        ans.append(x)
    return ans

def comb(n, k):
    k = min(k, n - k)
    ans = 1
    for i in range(n, n - k, -1):
        ans *= i
    for i in range(1, k + 1):
        ans //= i
    return ans

N, M = list(map(int, input().split()))
PFs = getPrimeFactor(M)
cnt = Counter(PFs)
ans = 1
for num in list(cnt.values()):
    ans *= comb(N + num - 1, num)
print((ans % MOD))

-# xのn乗（二分累乗法）

-    facts[x] = (facts[x - 1] * x) % MOD

-invFs = [0] * N2 + [power(facts[N2], MOD - 2)]

-    invFs[x] = (invFs[x + 1] * (x + 1)) % MOD

-    return ((facts[n] * invFs[k]) % MOD * invFs[n - k]) % MOD

-    ans = (ans * comb(N + num - 1, num)) % 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:

import sys

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

def main():

    x=int(eval(input()))

    for i in range(-300,300):

        for j in range(-300,300):

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

                print((i,j))

                sys.exit()

if __name__=='__main__':

    main()

# optimized version of the same code:

import sys

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

def main():

    x=int(eval(input()))

    for a in range(-118,120):

        for diff in range(238):

            if a**5-(a-diff)**5>10**9:

                break

            if a**5-(a-diff)**5==x:

                print((a,a-diff))

                sys.exit()

if __name__=='__main__':

    main()

import sys

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

def main():
    x = int(eval(input()))
    for i in range(-300, 300):
        for j in range(-300, 300):
            if i**5 - j**5 == x:
                print((i, j))
                sys.exit()

if __name__ == "__main__":
    main()

import sys

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

def main():
    x = int(eval(input()))
    for a in range(-118, 120):
        for diff in range(238):
            if a**5 - (a - diff) ** 5 > 10**9:
                break
            if a**5 - (a - diff) ** 5 == x:
                print((a, a - diff))
                sys.exit()

if __name__ == "__main__":
    main()


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

n,*l=list(map(int,open(0).read().split()));print((sum(sorted(l*2)[-2:~n:-1])))

# optimized version of the same code:

n,*l=list(map(int,open(0).read().split()))

l.sort(reverse=1)

print((sum(l[i//2] for i in range(1,n))))

n, *l = list(map(int, open(0).read().split()))
print((sum(sorted(l * 2)[-2:~n:-1])))

n, *l = list(map(int, open(0).read().split()))
l.sort(reverse=1)
print((sum(l[i // 2] for i in range(1, n))))

+print((sum(l[i // 2] for i in range(1, 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

mod=10**9+7

d=np.zeros(100100,dtype=np.int64)

d[0]=1

for i in range(1,10**5+1):

  d[i]=d[i-1]*i%mod

print((d[int(eval(input()))]))

# optimized version of the same code:

import numpy as np

mod = 10**9 + 7
d = np.zeros(100100, dtype=np.int64)
d[0] = 1
for i in range(1, 10**5 + 1):
    d[i] = d[i - 1] * i % mod
print((d[int(eval(input()))]))


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

import math

N = int(eval(input()))

for i in range(int(math.sqrt(N))):

    if N % (int(math.sqrt(N))-i) == 0:

        print((int(N/(int(math.sqrt(N))-i)+int(math.sqrt(N))-i-2)))

        break

# optimized version of the same code:

import math

N = int(eval(input()))

M = int(math.sqrt(N))

for i in range(M):

    if N % (M-i) == 0:

        print((int(N/(M-i)+M-i-2)))

        break

import math

N = int(eval(input()))
for i in range(int(math.sqrt(N))):
    if N % (int(math.sqrt(N)) - i) == 0:
        print((int(N / (int(math.sqrt(N)) - i) + int(math.sqrt(N)) - i - 2)))
        break

import math

N = int(eval(input()))
M = int(math.sqrt(N))
for i in range(M):
    if N % (M - i) == 0:
        print((int(N / (M - i) + M - i - 2)))
        break

-    if N % (int(math.sqrt(N)) - i) == 0:

-        print((int(N / (int(math.sqrt(N)) - i) + int(math.sqrt(N)) - i - 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:

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

import sys

X = int(input().strip())

#-----

for a in range(-118,120):

    for b in range(-118,120):

        if (a**5 - b**5) == X:

            print((a,b))

            sys.exit()

# optimized version of the same code:

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

import sys

X = int(input().strip())

#-----

calc = {}

for i in range(-118,120):

    calc[i] = i**5

for a in range(-118,120):

    for b in range(-118,120):

        if (calc[a] - calc[b]) == X:

            print((a,b))

            sys.exit()

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

X = int(input().strip())
# -----
for a in range(-118, 120):
    for b in range(-118, 120):
        if (a**5 - b**5) == X:
            print((a, b))
            sys.exit()

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

X = int(input().strip())
# -----
calc = {}
for i in range(-118, 120):
    calc[i] = i**5
for a in range(-118, 120):
    for b in range(-118, 120):
        if (calc[a] - calc[b]) == X:
            print((a, b))
            sys.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:

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

min_ = L

max_ = L + N -1

def eat_apple():

    if max_<0:

        return max_

    if L < 0:

        return 0

    return L

print(((min_+max_)*(max_-min_+1)//2 - eat_apple()))

# optimized version of the same code:

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

min_ = L

max_ = L + N -1

def eat_apple(N, L, max_):

    if max_<0:

        return max_

    if L < 0:

        return 0

    return L

print(((min_+max_)*(max_-min_+1)//2 - eat_apple(N, L, max_)))

N, L = [int(i) for i in input().split()]
min_ = L
max_ = L + N - 1

def eat_apple():
    if max_ < 0:
        return max_
    if L < 0:
        return 0
    return L

print(((min_ + max_) * (max_ - min_ + 1) // 2 - eat_apple()))

N, L = [int(i) for i in input().split()]
min_ = L
max_ = L + N - 1

def eat_apple(N, L, max_):
    if max_ < 0:
        return max_
    if L < 0:
        return 0
    return L

print(((min_ + max_) * (max_ - min_ + 1) // 2 - eat_apple(N, L, max_)))

-print(((min_ + max_) * (max_ - min_ + 1) // 2 - eat_apple()))

+print(((min_ + max_) * (max_ - min_ + 1) // 2 - eat_apple(N, L, max_)))


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

from collections import Counter

N = int(eval(input()))

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

ans = 0

ruisekiwa = [0] * (N+1)

for i in range(N):

    ruisekiwa[i+1] = ruisekiwa[i] + inputs[i]

ruisekiwa = ruisekiwa[1:]

ruisekiwa.sort()

counter_ruiseki = Counter(ruisekiwa)

for key, value in list(counter_ruiseki.items()):

    if key == 0 and value == 1:

        ans += value

        continue

    elif key == 0 and value > 1:

        ans += value

    if value > 1:

        ans += sum(list(range(value)))

print(ans)

# optimized version of the same code:

from collections import Counter

from itertools import accumulate

N = int(eval(input()))

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

ans = 0

ruisekiwa = list(accumulate(inputs))

ruisekiwa.sort()

counter_ruiseki = Counter(ruisekiwa)

for key, value in list(counter_ruiseki.items()):

    if key == 0 and value == 1:

        ans += value

        continue

    elif key == 0 and value > 1:

        ans += value

    if value > 1:

        ans += sum(list(range(value)))

print(ans)

from collections import Counter

N = int(eval(input()))
inputs = [int(i) for i in input().split()]
ans = 0
ruisekiwa = [0] * (N + 1)
for i in range(N):
    ruisekiwa[i + 1] = ruisekiwa[i] + inputs[i]
ruisekiwa = ruisekiwa[1:]
ruisekiwa.sort()
counter_ruiseki = Counter(ruisekiwa)
for key, value in list(counter_ruiseki.items()):
    if key == 0 and value == 1:
        ans += value
        continue
    elif key == 0 and value > 1:
        ans += value
    if value > 1:
        ans += sum(list(range(value)))
print(ans)

-    ruisekiwa[i + 1] = ruisekiwa[i] + inputs[i]


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

import sys

_input = sys.stdin.readline

def resolve():

    N = int(_input())

    T = [list(map(int, _input().split())) for _ in range(N)]

    t, x, y = 0, 0, 0

    for next_t, next_x, next_y in T:

        diff_xy = abs(x - next_x) + abs(y - next_y)

        diff_t = next_t - t

        if diff_xy > diff_t or (diff_xy % 2 != diff_t % 2):

            print('No')

            exit(0)

    print('Yes')

if __name__ == '__main__':

    resolve()

# optimized version of the same code:

import sys

_input = sys.stdin.readline

def resolve():

    N = int(_input())

    t, x, y = 0, 0, 0

    for _ in range(N):

        next_t, next_x, next_y = list(map(int, _input().split()))

        diff_xy = abs(x - next_x) + abs(y - next_y)

        diff_t = next_t - t

        if diff_xy > diff_t or (diff_xy % 2 != diff_t % 2):

            print('No')

            exit(0)

    print('Yes')

if __name__ == '__main__':

    resolve()

import sys

_input = sys.stdin.readline

def resolve():
    N = int(_input())
    T = [list(map(int, _input().split())) for _ in range(N)]
    t, x, y = 0, 0, 0
    for next_t, next_x, next_y in T:
        diff_xy = abs(x - next_x) + abs(y - next_y)
        diff_t = next_t - t
        if diff_xy > diff_t or (diff_xy % 2 != diff_t % 2):
            print("No")
            exit(0)
    print("Yes")

if __name__ == "__main__":
    resolve()

import sys

_input = sys.stdin.readline

def resolve():
    N = int(_input())
    t, x, y = 0, 0, 0
    for _ in range(N):
        next_t, next_x, next_y = list(map(int, _input().split()))
        diff_xy = abs(x - next_x) + abs(y - next_y)
        diff_t = next_t - t
        if diff_xy > diff_t or (diff_xy % 2 != diff_t % 2):
            print("No")
            exit(0)
    print("Yes")

if __name__ == "__main__":
    resolve()

-    T = [list(map(int, _input().split())) for _ in range(N)]

+        next_t, next_x, next_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:

S = [int(_) for _ in eval(input())]

length = len(S)

temp = [S[0]]

for x in S[1:]:

    if(len(temp) == 0):

        temp.append(x)

    elif( temp[-1] == x):

        temp.append(x)

    else:

        temp.pop(-1)

print((length-len(temp)))

# optimized version of the same code:

def main():

    A = eval(input())

    print((2*min(A.count("0"),A.count("1"))))

if __name__ == "__main__":

    main()

S = [int(_) for _ in eval(input())]
length = len(S)
temp = [S[0]]
for x in S[1:]:
    if len(temp) == 0:
        temp.append(x)
    elif temp[-1] == x:
        temp.append(x)
    else:
        temp.pop(-1)
print((length - len(temp)))

def main():
    A = eval(input())
    print((2 * min(A.count("0"), A.count("1"))))

if __name__ == "__main__":
    main()


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

K = int(eval(input()))

flg = [False]*K

tmp = 7 % K

cnt = 1

if tmp == 0:

    print(cnt)

    exit()

while True:

    tmp = (tmp*10+7)%K

    if flg[tmp]:

        print((-1))

        break

    else:

        cnt += 1

        if tmp == 0:

            print(cnt)

            break

        flg[tmp] = True

# optimized version of the same code:

K = int(eval(input()))

t = 7

t %= K

for i in range(K+1):

    if t == 0:

        print((i+1))

        exit()

    t = (t*10+7)%K

print((-1))

K = int(eval(input()))
flg = [False] * K
tmp = 7 % K
cnt = 1
if tmp == 0:
    print(cnt)
    exit()
while True:
    tmp = (tmp * 10 + 7) % K
    if flg[tmp]:
        print((-1))
        break
    else:
        cnt += 1
        if tmp == 0:
            print(cnt)
            break
        flg[tmp] = True

K = int(eval(input()))
t = 7
t %= K
for i in range(K + 1):
    if t == 0:
        print((i + 1))
        exit()
    t = (t * 10 + 7) % K
print((-1))

-flg = [False] * K
-tmp = 7 % K
-cnt = 1
-if tmp == 0:
-    print(cnt)
-    exit()
-while True:
-    tmp = (tmp * 10 + 7) % K
-    if flg[tmp]:
-        print((-1))
-        break
-    else:
-        cnt += 1
-        if tmp == 0:
-            print(cnt)
-            break
-        flg[tmp] = True
+t = 7
+t %= K
+for i in range(K + 1):
+    if t == 0:
+        print((i + 1))
+        exit()
+    t = (t * 10 + 7) % K
+print((-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:

from math import factorial

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

# optimized version of the same code:

ans = 1

for k in range(1, int(eval(input()))+1):

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

print(ans)

from math import factorial

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

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

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

+for k in range(1, int(eval(input())) + 1):


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

import sys

sys.setrecursionlimit(202020)

N = int(eval(input()))

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

for i in range(1,N):

    a = int(eval(input())) - 1

    won[a].append(i)

def height(v):

    if not won[v]: return 0

    hs = [height(op) for op in won[v]]

    ret = 0

    for i,h in enumerate(sorted(hs)):

        ret = max(ret, h + len(hs) - i)

    return ret

print((height(0)))

# optimized version of the same code:

import sys

sys.setrecursionlimit(10**8)

N = int(eval(input()))

A = [int(eval(input()))-1 for i in range(N-1)]

wins = [[] for _ in range(N)]

for i,a in enumerate(A):

    wins[a].append(i+1)

depth = [-1] * N

def dep(v):

    if len(wins[v])==0: return 0

    if depth[v] >= 0:

        return depth[v]

    ds = []

    for w in wins[v]:

        ds.append(dep(w))

    ds.sort(reverse=True)

    ret = 0

    for i,d in enumerate(ds):

        ret = max(ret, i+d+1)

    depth[v] = ret

    return ret

print((dep(0)))

import sys

sys.setrecursionlimit(202020)
N = int(eval(input()))
won = [[] for i in range(N)]
for i in range(1, N):
    a = int(eval(input())) - 1
    won[a].append(i)

def height(v):
    if not won[v]:
        return 0
    hs = [height(op) for op in won[v]]
    ret = 0
    for i, h in enumerate(sorted(hs)):
        ret = max(ret, h + len(hs) - i)
    return ret

print((height(0)))

import sys

sys.setrecursionlimit(10**8)
N = int(eval(input()))
A = [int(eval(input())) - 1 for i in range(N - 1)]
wins = [[] for _ in range(N)]
for i, a in enumerate(A):
    wins[a].append(i + 1)
depth = [-1] * N

def dep(v):
    if len(wins[v]) == 0:
        return 0
    if depth[v] >= 0:
        return depth[v]
    ds = []
    for w in wins[v]:
        ds.append(dep(w))
    ds.sort(reverse=True)
    ret = 0
    for i, d in enumerate(ds):
        ret = max(ret, i + d + 1)
    depth[v] = ret
    return ret

print((dep(0)))

+A = [int(eval(input())) - 1 for i in range(N - 1)]

-        ret = max(ret, h + len(hs) - 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, D = list(map(int, input().split()))

count = 0

for i in range(N):

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

    if (a**2 + b**2) <= D**2:

        count += 1

print(count)

# optimized version of the same code:

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

count = 0

for i in range(N):

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

    if (a*a + b*b) <= D*D:

        count += 1

print(count)

N, D = list(map(int, input().split()))
count = 0
for i in range(N):
    a, b = list(map(int, input().split()))
    if (a * a + b * b) <= D * D:
        count += 1
print(count)


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:

# ABC102C - Linear Approximation (ARC100C)

from statistics import median

def main():

    n = int(eval(input()))

    A = tuple(map(int, input().rstrip().split()))

    A = tuple(j - i for i, j in enumerate(A, start=1))

    b = median(A)

    ans = sum(abs(a - b) for a in A)

    print((int(ans)))

if __name__ == "__main__":

    main()

# optimized version of the same code:

# ABC102C - Linear Approximation (ARC100C)

def main():

    n = int(eval(input()))

    A = tuple(map(int, input().rstrip().split()))

    A = sorted(j - i for i, j in enumerate(A, start=1))

    b = A[n // 2]

    ans = sum(abs(a - b) for a in A)

    print(ans)

if __name__ == "__main__":

    main()

-    A = tuple(j - i for i, j in enumerate(A, start=1))

+    A = sorted(j - i for i, j in enumerate(A, start=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:

a=65280; b=61680; c=52428; d=43690; e=65535

L = {el: 1 for el in [a, b, c, d, e, 0]}

for i in range(6):

    R = sorted(L.items(), key=lambda x: x[1])

    for p, l in R:

        if l < 16:

            L[p ^ e] = min(L.get(p ^ e, 16), l+1)

            if l+3 < 16:

                for q, r in R:

                    if l+r+3 <= 16:

                        L[p & q] = min(L.get(p & q, 16), l+r+3)

                        L[p ^ q] = min(L.get(p ^ q, 16), l+r+3)

                    else: break

        else: break

print(*(L[e & eval(s)] for s in open(0).read().replace(*"-~").replace(*"*&").replace(*"1e").split()[:-1]),sep='\n')

# optimized version of the same code:

a=65280; b=61680; c=52428; d=43690; e=65535

from heapq import heappush, heappop

base = [a, b, c, d, e, 0]

Q = [(1, el) for el in base]

L = {el: 1 for el in base}

H = []

while Q:

    l, p = heappop(Q)

    if L[p] < l: continue

    if l+1 < L.get(p ^ e, 17):

        L[p^e] = l+1

        if l+1 < 16: heappush(Q, (l+1, p^e))

    if l+3 < 16:

        for q, r in H:

            if l+r+3 <= 16:

                if l+r+3 < L.get(p & q, 17):

                    L[p & q] = l+r+3

                    if l+r+3 < 16: heappush(Q, (l+r+3, p & q))

                if l+r+3 < L.get(p ^ q, 17):

                    L[p ^ q] = l+r+3

                    if l+r+3 < 16: heappush(Q, (l+r+3, p ^ q))

            else: break

    if l < 7: H.append((p, l))

print(*(L[e & eval(s)] for s in open(0).read().replace(*"-~").replace(*"*&").replace(*"1e").split()[:-1]),sep='\n')

a = 65280
b = 61680
c = 52428
d = 43690
e = 65535
L = {el: 1 for el in [a, b, c, d, e, 0]}
for i in range(6):
    R = sorted(L.items(), key=lambda x: x[1])
    for p, l in R:
        if l < 16:
            L[p ^ e] = min(L.get(p ^ e, 16), l + 1)
            if l + 3 < 16:
                for q, r in R:
                    if l + r + 3 <= 16:
                        L[p & q] = min(L.get(p & q, 16), l + r + 3)
                        L[p ^ q] = min(L.get(p ^ q, 16), l + r + 3)
                    else:
                        break
        else:
            break
print(
    *(
        L[e & eval(s)]
        for s in open(0)
        .read()
        .replace(*"-~")
        .replace(*"*&")
        .replace(*"1e")
        .split()[:-1]
    ),
    sep="\n"
)

a = 65280
b = 61680
c = 52428
d = 43690
e = 65535
from heapq import heappush, heappop

base = [a, b, c, d, e, 0]
Q = [(1, el) for el in base]
L = {el: 1 for el in base}
H = []
while Q:
    l, p = heappop(Q)
    if L[p] < l:
        continue
    if l + 1 < L.get(p ^ e, 17):
        L[p ^ e] = l + 1
        if l + 1 < 16:
            heappush(Q, (l + 1, p ^ e))
    if l + 3 < 16:
        for q, r in H:
            if l + r + 3 <= 16:
                if l + r + 3 < L.get(p & q, 17):
                    L[p & q] = l + r + 3
                    if l + r + 3 < 16:
                        heappush(Q, (l + r + 3, p & q))
                if l + r + 3 < L.get(p ^ q, 17):
                    L[p ^ q] = l + r + 3
                    if l + r + 3 < 16:
                        heappush(Q, (l + r + 3, p ^ q))
            else:
                break
    if l < 7:
        H.append((p, l))
print(
    *(
        L[e & eval(s)]
        for s in open(0)
        .read()
        .replace(*"-~")
        .replace(*"*&")
        .replace(*"1e")
        .split()[:-1]
    ),
    sep="\n"
)

-L = {el: 1 for el in [a, b, c, d, e, 0]}

-    R = sorted(L.items(), key=lambda x: x[1])

+            heappush(Q, (l + 1, p ^ e))

+                        heappush(Q, (l + r + 3, p & q))

+                        heappush(Q, (l + r + 3, p ^ q))


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

#python3

from collections import defaultdict

from collections import namedtuple

P = namedtuple('P', ['front', 'end'])

def f(x):

    return P(str(x)[0], str(x)[-1])

def main():

    n = int(eval(input()))

    freq = defaultdict(int)

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

        p = f(i)

        freq[p]+=1

    ans = 0

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

        p = f(i)

        q = (p.end, p.front)

        ans += freq[q]

    print(ans)

main()

# optimized version of the same code:

import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

from collections import defaultdict

def f(x):

    return (int(str(x)[0]), int(str(x)[-1]))

def main():

    N = int(readline())

    df = defaultdict(int)

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

        df[f(i)] += 1

    ans = 0

    for i in range(1, 10):

        for j in range(1, 10):

            ans +=  df[(i, j)]*df[(j, i)]

    print(ans)

if __name__ == '__main__':

    main()

# python3
from collections import defaultdict
from collections import namedtuple

P = namedtuple("P", ["front", "end"])

def f(x):
    return P(str(x)[0], str(x)[-1])

def main():
    n = int(eval(input()))
    freq = defaultdict(int)
    for i in range(1, n + 1):
        p = f(i)
        freq[p] += 1
    ans = 0
    for i in range(1, n + 1):
        p = f(i)
        q = (p.end, p.front)
        ans += freq[q]
    print(ans)

main()

import sys

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

def f(x):
    return (int(str(x)[0]), int(str(x)[-1]))

def main():
    N = int(readline())
    df = defaultdict(int)
    for i in range(1, N + 1):
        df[f(i)] += 1
    ans = 0
    for i in range(1, 10):
        for j in range(1, 10):
            ans += df[(i, j)] * df[(j, i)]
    print(ans)

if __name__ == "__main__":
    main()

+    return (int(str(x)[0]), int(str(x)[-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, m = list(map(int, input().split()))

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

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

bc.sort(key=lambda x: x[1], reverse=True)

a.sort()

i = 0

for b, c in bc:

    for _ in range(b):

        if i < n and a[i] < c:

            a[i] = c

            i += 1

        else:

            break

ans = sum(a)

print(ans)

# optimized version of the same code:

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

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

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

bc.sort(reverse=True, key=lambda x: x[1])

li = []

l = 0

i = 0

while i < m and l < n:

    b, c = bc[i]

    li += [c] * b

    i += 1

    l += b

a += li

a.sort(reverse=True)

ans = sum(a[:n])

print(ans)

-bc.sort(key=lambda x: x[1], reverse=True)

+bc.sort(reverse=True, key=lambda x: x[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 itertools

import numpy as np

N = int(eval(input()))

stl = []

for i in range(N):

    a = int(eval(input()))

    for _ in range(a):

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

        stl.append((i, x-1, y))

dl = np.array(list(itertools.product([0, 1], repeat=N)), np.bool)

for i, x, y in stl:

    bl = (dl[:, i] == False) | (dl[:, x] == bool(y))

    dl = dl[bl]

res = dl.sum(axis=1).max()

print(res)

# optimized version of the same code:

import sys

import itertools

import collections

def solve():

    readline = sys.stdin.buffer.readline

    mod = 10 ** 9 + 7

    n = int(readline())

    xy = []

    for i in range(n):

        a = int(readline())

        for j in range(a):

            x, y = list(map(int, readline().split()))

            xy.append([i, x-1, y])

    ls = collections.deque([v for v in itertools.product([True, False], repeat=n)])

    for i, x, y in xy:

        for j in range(len(ls)):

            lsv = ls.pop()

            if not lsv[i] or lsv[x] == bool(y):

                ls.appendleft(lsv)

    t = 0

    for i in range(len(ls)):

        t = max(t, ls[i].count(True))

    print(t)

if __name__ == '__main__':

    solve()

import itertools
import numpy as np

N = int(eval(input()))
stl = []
for i in range(N):
    a = int(eval(input()))
    for _ in range(a):
        x, y = list(map(int, input().split()))
        stl.append((i, x - 1, y))
dl = np.array(list(itertools.product([0, 1], repeat=N)), np.bool)
for i, x, y in stl:
    bl = (dl[:, i] == False) | (dl[:, x] == bool(y))
    dl = dl[bl]
res = dl.sum(axis=1).max()
print(res)

import sys
import itertools
import collections

def solve():
    readline = sys.stdin.buffer.readline
    mod = 10**9 + 7
    n = int(readline())
    xy = []
    for i in range(n):
        a = int(readline())
        for j in range(a):
            x, y = list(map(int, readline().split()))
            xy.append([i, x - 1, y])
    ls = collections.deque([v for v in itertools.product([True, False], repeat=n)])
    for i, x, y in xy:
        for j in range(len(ls)):
            lsv = ls.pop()
            if not lsv[i] or lsv[x] == bool(y):
                ls.appendleft(lsv)
    t = 0
    for i in range(len(ls)):
        t = max(t, ls[i].count(True))
    print(t)

if __name__ == "__main__":
    solve()

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

-dl = np.array(list(itertools.product([0, 1], repeat=N)), np.bool)

+    readline = sys.stdin.buffer.readline

+            x, y = list(map(int, readline().split()))

+    ls = collections.deque([v for v in itertools.product([True, False], repeat=n)])

+            if not lsv[i] or lsv[x] == bool(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:

INF = 10**10

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

costs = []

keys = []

for _ in range(M):

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

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

    costs.append(A)

    # 鍵を2進数化する

    key = 0

    for c in cs:

        key |= 1<<(c-1)

    keys.append(key)

# [1]の個数で分類する

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

num1s = [0] * (2**N)

for S in range(2**N):

    num = bin(S).count('1')

    maskss[num].append(S)

    num1s[S] = num

dpAll = [INF] * (2**N)

for S in range(2**N):

    for cost, key in zip(costs, keys):

        if S & key == S:

            if cost < dpAll[S]:

                dpAll[S] = cost

dp = [INF] * (2**N)

for S in range(2**N):

    cost = dpAll[S]

    num1 = num1s[S]

    for k in range(1, (num1+1)//2+1):

        for mask in maskss[k]:

            if mask & S == mask:

                m2 = S^mask

                c2 = dp[mask] + dp[m2]

                if c2 < cost:

                    cost = c2

    dp[S] = cost

if dp[2**N-1] == INF:

    print((-1))

else:

    print((dp[2**N-1]))

# optimized version of the same code:

import sys

input = sys.stdin.readline

def solve():

    INF = 10**10

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

    keys = []

    costs = []

    for _ in range(M):

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

        costs.append(a)

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

        key = 0

        for c in cs:

            key |= 1<<(c-1)

        keys.append(key)

    dp = [INF] * (1<<N)

    dp[0] = 0

    for S in range(1<<N):

        for key, cost in zip(keys, costs):

            S2 = S | key

            c2 = dp[S] + cost

            if c2 < dp[S2]:

                dp[S2] = c2

    if dp[-1] == INF:

        print((-1))

    else:

        print((dp[-1]))

solve()

INF = 10**10
N, M = list(map(int, input().split()))
costs = []
keys = []
for _ in range(M):
    A, B = list(map(int, input().split()))
    cs = list(map(int, input().split()))
    costs.append(A)
    # 鍵を2進数化する
    key = 0
    for c in cs:
        key |= 1 << (c - 1)
    keys.append(key)
# [1]の個数で分類する
maskss = [[] for _ in range(N + 1)]
num1s = [0] * (2**N)
for S in range(2**N):
    num = bin(S).count("1")
    maskss[num].append(S)
    num1s[S] = num
dpAll = [INF] * (2**N)
for S in range(2**N):
    for cost, key in zip(costs, keys):
        if S & key == S:
            if cost < dpAll[S]:
                dpAll[S] = cost
dp = [INF] * (2**N)
for S in range(2**N):
    cost = dpAll[S]
    num1 = num1s[S]
    for k in range(1, (num1 + 1) // 2 + 1):
        for mask in maskss[k]:
            if mask & S == mask:
                m2 = S ^ mask
                c2 = dp[mask] + dp[m2]
                if c2 < cost:
                    cost = c2
    dp[S] = cost
if dp[2**N - 1] == INF:
    print((-1))
else:
    print((dp[2**N - 1]))

import sys

input = sys.stdin.readline

def solve():
    INF = 10**10
    N, M = list(map(int, input().split()))
    keys = []
    costs = []
    for _ in range(M):
        a, b = list(map(int, input().split()))
        costs.append(a)
        cs = list(map(int, input().split()))
        key = 0
        for c in cs:
            key |= 1 << (c - 1)
        keys.append(key)
    dp = [INF] * (1 << N)
    dp[0] = 0
    for S in range(1 << N):
        for key, cost in zip(keys, costs):
            S2 = S | key
            c2 = dp[S] + cost
            if c2 < dp[S2]:
                dp[S2] = c2
    if dp[-1] == INF:
        print((-1))
    else:
        print((dp[-1]))

solve()

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

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

-    # 鍵を2進数化する

-# [1]の個数で分類する

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

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

+        cs = list(map(int, input().split()))

+        for key, cost in zip(keys, costs):


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,queue,math,numpy as np,scipy as sc

sys.setrecursionlimit(10**7)

input = sys.stdin.readline

INF = 10**18

MOD = 10**9 + 7

LI = lambda : [int(x) for x in input().split()]

N,M = LI()

E = [LI() for _ in range(M)]

ans = 0

for i in range(M):

    g = np.array([i for i in range(N+1)])

    def root(x):

        if g[x] != x:

            g[x] = root(g[x])

        return g[x]

    for j in range(M):

        if i != j: g[root(E[j][0])] = root(E[j][1])

    ans += (root(E[i][0]) != root(E[i][1]))

print (ans)

# optimized version of the same code:

import sys,queue,math,numpy as np,scipy as sc

sys.setrecursionlimit(10**7)

input = sys.stdin.readline

INF = 10**18

MOD = 10**9 + 7

LI = lambda : [int(x) for x in input().split()]

N,M = LI()

E = [LI() for _ in range(M)]

ans = 0

for i in range(M):

    g = [i for i in range(N+1)]

    def root(x):

        if g[x] != x:

            g[x] = root(g[x])

        return g[x]

    for j in range(M):

        if i != j: g[root(E[j][0])] = root(E[j][1])

    ans += (root(E[i][0]) != root(E[i][1]))

print (ans)

import sys, queue, math, numpy as np, scipy as sc

sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = 10**18
MOD = 10**9 + 7
LI = lambda: [int(x) for x in input().split()]
N, M = LI()
E = [LI() for _ in range(M)]
ans = 0
for i in range(M):
    g = np.array([i for i in range(N + 1)])

    def root(x):
        if g[x] != x:
            g[x] = root(g[x])
        return g[x]

    for j in range(M):
        if i != j:
            g[root(E[j][0])] = root(E[j][1])
    ans += root(E[i][0]) != root(E[i][1])
print(ans)

import sys, queue, math, numpy as np, scipy as sc

sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = 10**18
MOD = 10**9 + 7
LI = lambda: [int(x) for x in input().split()]
N, M = LI()
E = [LI() for _ in range(M)]
ans = 0
for i in range(M):
    g = [i for i in range(N + 1)]

    def root(x):
        if g[x] != x:
            g[x] = root(g[x])
        return g[x]

    for j in range(M):
        if i != j:
            g[root(E[j][0])] = root(E[j][1])
    ans += root(E[i][0]) != root(E[i][1])
print(ans)

-    g = np.array([i for i in range(N + 1)])


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

def f(s):

    s=list(map(int,s.split(':')))

    return (s[0]*60+s[1])*60+s[2]

a=86401

while 1:

    t=[0]*a

    n=int(eval(input()))

    if n==0:break

    for _ in range(n):

        b,c=input().split()

        t[f(b)]+=1;t[f(c)]-=1

    d=0

    for i in range(1,a):

        t[i]+=t[i-1]

        d=max(d,t[i])

    print(d)

# optimized version of the same code:

def f(s):

    return (s[0]*60+s[1])*60+s[2]

a=86400

while 1:

    t=[0]*a

    n=int(eval(input()))

    if n==0:break

    for _ in range(n):

        b,c = [list(map(int,x.split(':'))) for x in input().split()]

        t[f(b)]+=1;t[f(c)]-=1

    d=0

    for i in range(1,a):

        t[i]+=t[i-1]

        if d<t[i]:d=t[i]

    print(d)

def f(s):
    s = list(map(int, s.split(":")))
    return (s[0] * 60 + s[1]) * 60 + s[2]

a = 86401
while 1:
    t = [0] * a
    n = int(eval(input()))
    if n == 0:
        break
    for _ in range(n):
        b, c = input().split()
        t[f(b)] += 1
        t[f(c)] -= 1
    d = 0
    for i in range(1, a):
        t[i] += t[i - 1]
        d = max(d, t[i])
    print(d)

def f(s):
    return (s[0] * 60 + s[1]) * 60 + s[2]

a = 86400
while 1:
    t = [0] * a
    n = int(eval(input()))
    if n == 0:
        break
    for _ in range(n):
        b, c = [list(map(int, x.split(":"))) for x in input().split()]
        t[f(b)] += 1
        t[f(c)] -= 1
    d = 0
    for i in range(1, a):
        t[i] += t[i - 1]
        if d < t[i]:
            d = t[i]
    print(d)

+        b, c = [list(map(int, x.split(":"))) for x in input().split()]


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

from collections import deque

INF = float('inf')

dr = (-1, 0, 0, 1)

dc = (0, -1, 1, 0)

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

s = []

total_white_count = 0

for _ in range(H):

    t = eval(input())

    s.append(t)

    total_white_count += t.count('.')

p = [[INF for _ in range(W)] for _ in range(H)]

ans = -1

dq = deque()

dq.append((0, 0, 1))

while dq:

    r, c, d = dq.popleft() # 直した

    nd = d + 1

    for i in range(4):

        nr = r + dr[i]

        nc = c + dc[i]

        if not (0 <= nr < H and 0 <= nc < W): continue

        if s[nr][nc] == '#' : continue

        if p[nr][nc] <= nd: continue

        p[nr][nc] = nd

        if nr == H - 1 and nc == W - 1:

            ans = total_white_count - nd

            break

        dq.append((nr, nc, nd))

    else:

        continue

    break

print(ans)

# optimized version of the same code:

def main():

    from collections import deque

    import sys

    input = sys.stdin.readline

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

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

    bk = 0

    for row in s:

        bk += row.count('#')

    def coods(r, c):

        if r > 0: yield r - 1, c

        if r < h - 1: yield r + 1, c

        if c > 0: yield r, c - 1

        if c < w - 1: yield r, c + 1

    q = deque()

    q.append((0, 0))

    count = [[-1] * w for _ in range(h)]

    count[0][0] = 1

    while q:

        r, c = q.popleft()

        k = count[r][c]

        for nr, nc in coods(r, c):

            nchar = s[nr][nc]

            if nchar == '#': continue

            if count[nr][nc] != -1: continue

            count[nr][nc] = k + 1

            if (nr, nc) == (h - 1, w - 1):

                print((h * w - (k + 1) - bk))

                return

            q.append((nr, nc))

    print((-1))

if __name__ == '__main__':

    main()

from collections import deque

INF = float("inf")
dr = (-1, 0, 0, 1)
dc = (0, -1, 1, 0)
H, W = list(map(int, input().split()))
s = []
total_white_count = 0
for _ in range(H):
    t = eval(input())
    s.append(t)
    total_white_count += t.count(".")
p = [[INF for _ in range(W)] for _ in range(H)]
ans = -1
dq = deque()
dq.append((0, 0, 1))
while dq:
    r, c, d = dq.popleft()  # 直した
    nd = d + 1
    for i in range(4):
        nr = r + dr[i]
        nc = c + dc[i]
        if not (0 <= nr < H and 0 <= nc < W):
            continue
        if s[nr][nc] == "#":
            continue
        if p[nr][nc] <= nd:
            continue
        p[nr][nc] = nd
        if nr == H - 1 and nc == W - 1:
            ans = total_white_count - nd
            break
        dq.append((nr, nc, nd))
    else:
        continue
    break
print(ans)

def main():
    from collections import deque
    import sys

    input = sys.stdin.readline
    h, w = list(map(int, input().split()))
    s = [eval(input()) for _ in range(h)]
    bk = 0
    for row in s:
        bk += row.count("#")

    def coods(r, c):
        if r > 0:
            yield r - 1, c
        if r < h - 1:
            yield r + 1, c
        if c > 0:
            yield r, c - 1
        if c < w - 1:
            yield r, c + 1

    q = deque()
    q.append((0, 0))
    count = [[-1] * w for _ in range(h)]
    count[0][0] = 1
    while q:
        r, c = q.popleft()
        k = count[r][c]
        for nr, nc in coods(r, c):
            nchar = s[nr][nc]
            if nchar == "#":
                continue
            if count[nr][nc] != -1:
                continue
            count[nr][nc] = k + 1
            if (nr, nc) == (h - 1, w - 1):
                print((h * w - (k + 1) - bk))
                return
            q.append((nr, nc))
    print((-1))

if __name__ == "__main__":
    main()

-p = [[INF for _ in range(W)] for _ in range(H)]

-        if not (0 <= nr < H and 0 <= nc < W):

-        if nr == H - 1 and nc == W - 1:

-            ans = total_white_count - nd

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

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

+    count = [[-1] * w for _ in range(h)]


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

print((math.factorial(n)%(10**9+7)))

# optimized version of the same code:

n = int(eval(input()))

mod = 10**9 + 7

pow = 1

for i in range(n):

    pow = pow*(i+1)%mod

print(pow)

import math

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

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

-print((math.factorial(n) % (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:

import numpy

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

listx = []

count = 0

for i in range(N):

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

    listx.append(x)

for j in range(0, N):

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

        a = numpy.array(listx[j])

        b = numpy.array(listx[k])

        u = b - a

        c = float(numpy.linalg.norm(u))

        if c.is_integer() :

            count += 1

print(count)

# optimized version of the same code:

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

N,D = LI()

X = [LI() for _ in range(N)]

ans = 0

for i in range(N):

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

        temp = 0

        for k in range(D):

            temp += (X[j][k]-X[i][k])**2

        if temp **0.5%1==0:

            ans += 1

print(ans)

import numpy

N, D = list(map(int, input().split()))
listx = []
count = 0
for i in range(N):
    x = list(map(int, input().split()))
    listx.append(x)
for j in range(0, N):
    for k in range(j + 1, N):
        a = numpy.array(listx[j])
        b = numpy.array(listx[k])
        u = b - a
        c = float(numpy.linalg.norm(u))
        if c.is_integer():
            count += 1
print(count)

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

N, D = LI()
X = [LI() for _ in range(N)]
ans = 0
for i in range(N):
    for j in range(i + 1, N):
        temp = 0
        for k in range(D):
            temp += (X[j][k] - X[i][k]) ** 2
        if temp**0.5 % 1 == 0:
            ans += 1
print(ans)

+    return list(map(int, input().split()))

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

-        c = float(numpy.linalg.norm(u))


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

X=int(eval(input()))

for i in range(-200,201):

    for j in range(-200,201):

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

            print((i,j))

            exit()

# optimized version of the same code:

X=int(eval(input()))

for i in range(-150,151):

    for j in range(-150,151):

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

            print((i,j))

            exit()

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

X = int(eval(input()))
for i in range(-150, 151):
    for j in range(-150, 151):
        if i**5 - j**5 == X:
            print((i, j))
            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:

S = list(eval(input()))

num_one = S.count("1")

num_zero = S.count("0")

ans = min(num_one, num_zero) *2

print(ans)

# optimized version of the same code:

S = eval(input())

ans = min(S.count("0"), S.count("1")) * 2

print(ans)

S = list(eval(input()))
num_one = S.count("1")
num_zero = S.count("0")
ans = min(num_one, num_zero) * 2
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 sys

can = True; eval(input())

e = [[0, 0, 0]] + [list(map(int, e.split())) for e in sys.stdin]

for a, b in zip(e[1:], e):

    t = a[0] - b[0] - abs(a[1] - b[1]) - abs(a[2] - b[2])

    if t < 0 or t % 2 == 1: can = False; break

print((['No', 'Yes'][can]))

# optimized version of the same code:

import sys

ans = 'Yes'; eval(input())

for e in sys.stdin:

    t, x, y = list(map(int, e.split()))

    t = t - x - y

    if t < 0 or t % 2 == 1: ans = 'No'; break

print(ans)

import sys

can = True
eval(input())
e = [[0, 0, 0]] + [list(map(int, e.split())) for e in sys.stdin]
for a, b in zip(e[1:], e):
    t = a[0] - b[0] - abs(a[1] - b[1]) - abs(a[2] - b[2])
    if t < 0 or t % 2 == 1:
        can = False
        break
print((["No", "Yes"][can]))

import sys

ans = "Yes"
eval(input())
for e in sys.stdin:
    t, x, y = list(map(int, e.split()))
    t = t - x - y
    if t < 0 or t % 2 == 1:
        ans = "No"
        break
print(ans)

-e = [[0, 0, 0]] + [list(map(int, e.split())) for e in sys.stdin]

+    t, x, y = list(map(int, e.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

readline = sys.stdin.readline

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

INF = 10 ** 10

dp = [INF] * (2 ** N)

dp[0] = 0

for i in range(M):

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

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

  key = 0

  for j in range(len(c)):

    key += (1 << (c[j] - 1))

  for j in range(len(dp)):

    if dp[j] == INF:

      continue

    if j | key == j:

      continue

    dp[j | key] = min(dp[j | key], dp[j] + a)

if dp[-1] == INF:

  print((-1))

else:

  print((dp[-1]))

# optimized version of the same code:

import sys

readline = sys.stdin.readline

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

INF = 10 ** 10

dp = [INF] * (2 ** N)

dp[0] = 0

for i in range(M):

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

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

  key = 0

  for j in range(len(c)):

    key += (1 << (c[j] - 1))

  for j in range(len(dp)):

    if dp[j] == INF:

      continue

    if j | key == j:

      continue

    if dp[j | key] > dp[j] + a:

      dp[j | key] = dp[j] + a

if dp[-1] == INF:

  print((-1))

else:

  print((dp[-1]))

import sys

readline = sys.stdin.readline
N, M = list(map(int, readline().split()))
INF = 10**10
dp = [INF] * (2**N)
dp[0] = 0
for i in range(M):
    a, b = list(map(int, readline().split()))
    c = list(map(int, readline().split()))
    key = 0
    for j in range(len(c)):
        key += 1 << (c[j] - 1)
    for j in range(len(dp)):
        if dp[j] == INF:
            continue
        if j | key == j:
            continue
        dp[j | key] = min(dp[j | key], dp[j] + a)
if dp[-1] == INF:
    print((-1))
else:
    print((dp[-1]))

import sys

readline = sys.stdin.readline
N, M = list(map(int, readline().split()))
INF = 10**10
dp = [INF] * (2**N)
dp[0] = 0
for i in range(M):
    a, b = list(map(int, readline().split()))
    c = list(map(int, readline().split()))
    key = 0
    for j in range(len(c)):
        key += 1 << (c[j] - 1)
    for j in range(len(dp)):
        if dp[j] == INF:
            continue
        if j | key == j:
            continue
        if dp[j | key] > dp[j] + a:
            dp[j | key] = dp[j] + a
if dp[-1] == INF:
    print((-1))
else:
    print((dp[-1]))

-        dp[j | key] = min(dp[j | key], dp[j] + 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:

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

S = eval(input())

latest = [None]*K

i = len(S)+C

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

  i = S.rindex("o", 0, i-C)

  latest[j] = i

if i<=C or "o" not in S[:i-C]:

  i = -C-1

  for j in latest:

    i = S.index("o", i+C+1)

    if i == j:

      print((i+1))

# optimized version of the same code:

def solve():

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

  workable = [i for i, s in enumerate(eval(input())) if s=="o"]

  if len(workable) == K:

    return workable

  prev = workable[-1]

  latest = {prev}

  i = len(workable)-1

  while i > 0:

    i -= 1

    if prev - workable[i] > C:

      latest.add(workable[i])

      prev = workable[i]

      if len(latest) > K:

        return []

  must = []

  i = -1

  prev = -C-1

  while i < len(workable)-1:

    i += 1

    if workable[i] - prev > C:

      if workable[i] in latest:

        must.append(workable[i])

      prev = workable[i]

  return must

for i in solve():

  print((i+1))

N, K, C = list(map(int, input().split()))
S = eval(input())
latest = [None] * K
i = len(S) + C
for j in range(K - 1, -1, -1):
    i = S.rindex("o", 0, i - C)
    latest[j] = i
if i <= C or "o" not in S[: i - C]:
    i = -C - 1
    for j in latest:
        i = S.index("o", i + C + 1)
        if i == j:
            print((i + 1))

def solve():
    N, K, C = list(map(int, input().split()))
    workable = [i for i, s in enumerate(eval(input())) if s == "o"]
    if len(workable) == K:
        return workable
    prev = workable[-1]
    latest = {prev}
    i = len(workable) - 1
    while i > 0:
        i -= 1
        if prev - workable[i] > C:
            latest.add(workable[i])
            prev = workable[i]
            if len(latest) > K:
                return []
    must = []
    i = -1
    prev = -C - 1
    while i < len(workable) - 1:
        i += 1
        if workable[i] - prev > C:
            if workable[i] in latest:
                must.append(workable[i])
            prev = workable[i]
    return must

for i in solve():
    print((i + 1))

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

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

+    workable = [i for i, s in enumerate(eval(input())) if s == "o"]

+                must.append(workable[i])


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

import sys

input = sys.stdin.readline

N,L,T = list(map(int,input().split()))

XW = [[int(x) for x in input().split()] for _ in range(N)]

X,W = list(zip(*XW))

DX = [1 if w == 1 else -1 for w in W]

Y = [(x+dx*T)%L for x,dx in zip(X,DX)]

y0 = Y[0]

Y.sort()

# 番号1がすれ違わず進んだ場所に相当するアリの番号

# すれ違うたびに1増える（W1=1） or 1減る（W1=-1）

# T秒ちょうどもすれ違い終わったと考える

x = 0

x0,dx0 = X[0],DX[0]

for y,dy in zip(X[1:],DX[1:]):

    if dx0 == dy:

        continue

    if dx0 == 1 and dy == -1:

        # 正の向きに追い越すので番号がひとつ増える

        x += (2*T-(y-x0)-1)//L + 1

    if dx0 == -1 and dy == 1:

        x -= (2*T-(L+x0-y))//L + 1

x %= N

i = Y.index(y0)

Y += Y

answer = [None] * N

answer[x:N] = Y[i:i+N-x]

answer[0:x] = Y[i+N-x:i+N]

print(('\n'.join(map(str,answer))))

# 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

"""

・順序が固定されるので、区間だったら簡単

・円のときも、地点 0 をそれぞれの方向に通った人数を見れば計算できる

"""

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

XW = np.array(read().split(), np.int64)

X = XW[::2]

W = XW[1::2]

speed = np.where(W == 1, 1, -1)

Y = X + speed * T

n = (Y // L - X // L).sum()

n %= N

Y %= L

Y.sort()

Y = np.concatenate((Y[n:], Y[:n]))

print(('\n'.join(map(str, Y.tolist()))))

import sys

input = sys.stdin.readline
N, L, T = list(map(int, input().split()))
XW = [[int(x) for x in input().split()] for _ in range(N)]
X, W = list(zip(*XW))
DX = [1 if w == 1 else -1 for w in W]
Y = [(x + dx * T) % L for x, dx in zip(X, DX)]
y0 = Y[0]
Y.sort()
# 番号1がすれ違わず進んだ場所に相当するアリの番号
# すれ違うたびに1増える（W1=1） or 1減る（W1=-1）
# T秒ちょうどもすれ違い終わったと考える
x = 0
x0, dx0 = X[0], DX[0]
for y, dy in zip(X[1:], DX[1:]):
    if dx0 == dy:
        continue
    if dx0 == 1 and dy == -1:
        # 正の向きに追い越すので番号がひとつ増える
        x += (2 * T - (y - x0) - 1) // L + 1
    if dx0 == -1 and dy == 1:
        x -= (2 * T - (L + x0 - y)) // L + 1
x %= N
i = Y.index(y0)
Y += Y
answer = [None] * N
answer[x:N] = Y[i : i + N - x]
answer[0:x] = Y[i + N - x : i + N]
print(("\n".join(map(str, answer))))

import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
"""
・順序が固定されるので、区間だったら簡単
・円のときも、地点 0 をそれぞれの方向に通った人数を見れば計算できる
"""
N, L, T = list(map(int, readline().split()))
XW = np.array(read().split(), np.int64)
X = XW[::2]
W = XW[1::2]
speed = np.where(W == 1, 1, -1)
Y = X + speed * T
n = (Y // L - X // L).sum()
n %= N
Y %= L
Y.sort()
Y = np.concatenate((Y[n:], Y[:n]))
print(("\n".join(map(str, Y.tolist()))))

-N, L, T = list(map(int, input().split()))

-XW = [[int(x) for x in input().split()] for _ in range(N)]

-Y = [(x + dx * T) % L for x, dx in zip(X, DX)]

+・順序が固定されるので、区間だったら簡単

+・円のときも、地点 0 をそれぞれの方向に通った人数を見れば計算できる

+N, L, T = list(map(int, readline().split()))

+XW = np.array(read().split(), np.int64)

-# 番号1がすれ違わず進んだ場所に相当するアリの番号

-# すれ違うたびに1増える（W1=1） or 1減る（W1=-1）

-# T秒ちょうどもすれ違い終わったと考える

-        # 正の向きに追い越すので番号がひとつ増える


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

sunuke = [True]*N

for i in range(K):

    d = int(eval(input()))

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

    for a in A:

        sunuke[a-1] = False

ans = 0

for i in range(N):

    if sunuke[i]:

        ans += 1

print(ans)

# optimized version of the same code:

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

flag = [True]*N

for i in range(K):

    d = int(eval(input()))

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

    for a in A:

        flag[a-1] = False

ans = 0

for i in range(N):

    if flag[i]:

        ans += 1

print(ans)

N, K = list(map(int, input().split()))
sunuke = [True] * N
for i in range(K):
    d = int(eval(input()))
    A = list(map(int, input().split()))
    for a in A:
        sunuke[a - 1] = False
ans = 0
for i in range(N):
    if sunuke[i]:
        ans += 1
print(ans)

N, K = list(map(int, input().split()))
flag = [True] * N
for i in range(K):
    d = int(eval(input()))
    A = list(map(int, input().split()))
    for a in A:
        flag[a - 1] = False
ans = 0
for i in range(N):
    if flag[i]:
        ans += 1
print(ans)

-sunuke = [True] * N
+flag = [True] * N
-        sunuke[a - 1] = False
+        flag[a - 1] = False
-    if sunuke[i]:
+    if flag[i]:


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

import sys

read = sys.stdin.read

readline = sys.stdin.readline

readlines = sys.stdin.readlines

def main():

    S = readline().strip()

    T = readline().strip()

    idx_in_S = []

    last_idx = 0

    for t in T:

        t_idx = S.find(t, last_idx) + 1

        if t_idx:

            idx_in_S.append(t_idx)

            last_idx = t_idx

        else:

            t_idx = S.find(t, 0, last_idx) + 1

            if not t_idx:

                print((-1))

                exit()

            else:

                idx_in_S.append(t_idx)

                last_idx = t_idx

    rep = 0

    for i in range(len(T) - 1):

        if idx_in_S[i] < idx_in_S[i+1]:

            continue

        else:

            rep += 1

    ans = len(S) * rep + idx_in_S[-1]

    print(ans)

if __name__ == "__main__":

    main()

# optimized version of the same code:

# S.find()の部分を高速化する

from collections import defaultdict

from bisect import bisect_right

import sys

read = sys.stdin.read

readline = sys.stdin.readline

readlines = sys.stdin.readlines

def main():

    S = readline().strip()

    T = readline().strip()

    S_idx = defaultdict(list)

    for i, s in enumerate(S):

        S_idx[s].append(i)

    rep = 0

    last_idx = -1

    for t in T:

        t_idx_list = S_idx[t]

        if t_idx_list:

            t_idx = bisect_right(t_idx_list, last_idx)

            if t_idx < len(t_idx_list):

                last_idx = t_idx_list[t_idx]

            else:

                last_idx = t_idx_list[0]

                rep += 1

        else:

            print((-1))

            exit()

    ans = len(S) * rep + last_idx + 1

    print(ans)

if __name__ == "__main__":

    main()

import sys

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

def main():
    S = readline().strip()
    T = readline().strip()
    idx_in_S = []
    last_idx = 0
    for t in T:
        t_idx = S.find(t, last_idx) + 1
        if t_idx:
            idx_in_S.append(t_idx)
            last_idx = t_idx
        else:
            t_idx = S.find(t, 0, last_idx) + 1
            if not t_idx:
                print((-1))
                exit()
            else:
                idx_in_S.append(t_idx)
                last_idx = t_idx
    rep = 0
    for i in range(len(T) - 1):
        if idx_in_S[i] < idx_in_S[i + 1]:
            continue
        else:
            rep += 1
    ans = len(S) * rep + idx_in_S[-1]
    print(ans)

if __name__ == "__main__":
    main()

-        t_idx = S.find(t, last_idx) + 1

+            t_idx = bisect_right(t_idx_list, last_idx)

+            if t_idx < len(t_idx_list):

+                last_idx = t_idx_list[t_idx]

+                last_idx = t_idx_list[0]

-            t_idx = S.find(t, 0, last_idx) + 1

-        if idx_in_S[i] < idx_in_S[i + 1]:


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

from bisect import bisect

D = [0.2,0.6,1.1]

L = [0,0,0,0]

R = [0,0,0,0]

while True:

    try:

        left,right = list(map(float,input().split()))

    except:

        break

    L[bisect(D,left)] += 1

    R[bisect(D,right)] += 1

for left,right in zip(L,R)[::-1]:

    print(left,right)

# optimized version of the same code:

from bisect import bisect

D = [0.2,0.6,1.1]

L = [0]*4

R = [0]*4

while True:

    try:

        left,right = list(map(float,input().split()))

    except:

        break

    L[bisect(D,left)] += 1

    R[bisect(D,right)] += 1

for left,right in zip(L,R)[::-1]:

    print(left,right)

from bisect import bisect

D = [0.2, 0.6, 1.1]
L = [0, 0, 0, 0]
R = [0, 0, 0, 0]
while True:
    try:
        left, right = list(map(float, input().split()))
    except:
        break
    L[bisect(D, left)] += 1
    R[bisect(D, right)] += 1
for left, right in zip(L, R)[::-1]:
    print(left, right)

from bisect import bisect

D = [0.2, 0.6, 1.1]
L = [0] * 4
R = [0] * 4
while True:
    try:
        left, right = list(map(float, input().split()))
    except:
        break
    L[bisect(D, left)] += 1
    R[bisect(D, right)] += 1
for left, right in zip(L, R)[::-1]:
    print(left, right)


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

import sys

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

def resolve():

    import math

    n=int(eval(input()))

    print((math.factorial(n)%(10**9+7)))

resolve()

# optimized version of the same code:

import sys

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

def resolve():

    answer=1

    n=int(eval(input()))

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

        answer*=i

        answer%=10**9+7

    print(answer)

resolve()

import sys

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

def resolve():
    import math

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

resolve()

import sys

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

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

resolve()

-    print((math.factorial(n) % (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:

from collections import Counter

import numpy as np

N = int(eval(input()))

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

c = Counter(A.cumsum())

c[0] += 1

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

print(answer)

# optimized version of the same code:

N = int(eval(input()))

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

csum = [0]

temp = 0

for a in A:

    temp += a

    csum.append(temp)

# csum.sort()

# print(csum)

from collections import Counter

freq = Counter(csum)

ans = 0

for v in list(freq.values()):

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

print(ans)

from collections import Counter
import numpy as np

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

N = int(eval(input()))
A = list(map(int, input().split()))
csum = [0]
temp = 0
for a in A:
    temp += a
    csum.append(temp)
# csum.sort()
# print(csum)
from collections import Counter

freq = Counter(csum)
ans = 0
for v in list(freq.values()):
    ans += (v * (v - 1)) // 2
print(ans)

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

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


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

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

import numpy as np

if __name__ == '__main__':

    n = int(eval(input()))

    A = np.array([int(a) for a in input().split()], dtype=np.int)

    isEven = True

    count = 0

    while isEven:

        if (A%2).any() != 0 :

            isEven = False

            break

        A = A/2

        count+=1

    print(count)

# optimized version of the same code:

import math

n = eval(input())

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

ans = float("inf")

for i in a:

    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)

print((round(ans)))

# -*- coding: utf-8 -*-
import numpy as np

if __name__ == "__main__":
    n = int(eval(input()))
    A = np.array([int(a) for a in input().split()], dtype=np.int)
    isEven = True
    count = 0
    while isEven:
        if (A % 2).any() != 0:
            isEven = False
            break
        A = A / 2
        count += 1
    print(count)

-    A = np.array([int(a) for a in input().split()], dtype=np.int)

+    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

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

j = 0

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

  l = list(str(i))

  l_reverse = list(reversed(l))

  if l == l_reverse:

    j += 1

print(j)

# optimized version of the same code:

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

ans = 0

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

    n = str(n)

    if n == n[::-1]:

        ans += 1

print(ans)

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

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

-j = 0
-for i in range(A, B + 1):
-    l = list(str(i))
-    l_reverse = list(reversed(l))
-    if l == l_reverse:
-        j += 1
-print(j)
+ans = 0
+for n in range(A, B + 1):
+    n = str(n)
+    if n == n[::-1]:
+        ans += 1
+print(ans)


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

s = int(eval(input()))

m, s = s // 60, s % 60

h, m = m // 60, m % 60

print((':'.join(map(str, [h,m,s]))))

# optimized version of the same code:

s = int(eval(input()))

second = s % 60

s = s // 60

min = s % 60

hour = s // 60

print(f'{hour}:{min}:{second}')

s = int(eval(input()))
second = s % 60
s = s // 60
min = s % 60
hour = s // 60
print(f"{hour}:{min}:{second}")


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

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

# optimized version of the same code:

import math

N = int(eval(input()))

a = 1

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

    a = a*n % (10**9+7)

print(a)

import math

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

import math

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

-print((math.factorial(N) % (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:

import numpy as np

n = int(eval(input()))

X = np.array([input().split() for _ in range(n)], np.int64)

dp = np.zeros((n + 1, 3), np.int64)

dp[0, 0] = dp[0, 1] = dp[0, 2] = 0

for i in range(n):

    for j in range(3):

        dp[i + 1, j] = X[i, j] + max(dp[i, k] for k in range(3) if j != k)

print((max(dp[n])))

# optimized version of the same code:

N = int(eval(input()))

x, y, z = 0, 0, 0

for _ in range(N):

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

    x, y, z = max(y, z) + a, max(z, x) + b, max(x, y) + c

print((max(x, y, z)))

-X = np.array([input().split() for _ in range(n)], np.int64)

-        dp[i + 1, j] = X[i, j] + max(dp[i, k] for k in range(3) if j != k)

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

+    x, y, z = max(y, z) + a, max(z, x) + b, max(x, y) + 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:

x = int(eval(input()))

root = int(x**(0.2))

flag = 0

for i in range(root - 400, root + 400):

    for j in range(-100, root + 400):

        if i!=j:

            if x%(i-j) == 0:

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

                    print((i, j))

                    flag = 1

                    break

    if flag:

        break

# optimized version of the same code:

x = int(eval(input()))

for a in range(-120, 120):

  for b in range(-120, 120):

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

      print((a, b))

      exit()

x = int(eval(input()))
root = int(x ** (0.2))
flag = 0
for i in range(root - 400, root + 400):
    for j in range(-100, root + 400):
        if i != j:
            if x % (i - j) == 0:
                if i**5 - j**5 == x:
                    print((i, j))
                    flag = 1
                    break
    if flag:
        break

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

-for i in range(root - 400, root + 400):


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

import sys

input = sys.stdin.readline

def main():

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

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

  BIT = [0]*(m+2)

  def add(i, a):

    while i <= m+1:

      BIT[i] += a

      i += i&(-i)

  def bit_sum(i):

    res = 0

    while i > 0:

      res += BIT[i]

      i -= i&(-i)

    return res

  S = sorted([(r-l+1, l, r) for l, r in LR], reverse=True)

  cnt = n

  L = []

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

    while S and S[-1][0] == i:

      c, l, r = S.pop()

      cnt -= 1

      add(l, 1)

      add(r+1, -1)

    res = cnt

    for j in range(0, m+1, i):

      res += bit_sum(j)

    L.append(res)

  print(*L, sep="\n")

if __name__ == "__main__":

  main()

# optimized version of the same code:

import sys

input = sys.stdin.readline

def main():

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

  S = [[] for _ in range(m+1)]

  for _ in range(n):

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

    S[r-l+1].append((l, r))

  BIT = [0]*(m+2)

  def add(i, a):

    while i <= m+1:

      BIT[i] += a

      i += i&(-i)

  def bit_sum(i):

    res = 0

    while i > 0:

      res += BIT[i]

      i -= i&(-i)

    return res

  cnt = n

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

    for l, r in S[i]:

      cnt -= 1

      add(l, 1)

      add(r+1, -1)

    res = cnt

    for j in range(0, m+1, i):

      res += bit_sum(j)

    print(res)

if __name__ == "__main__":

  main()

import sys

input = sys.stdin.readline

def main():
    n, m = map(int, input().split())
    LR = [list(map(int, input().split())) for _ in range(n)]
    BIT = [0] * (m + 2)

    def add(i, a):
        while i <= m + 1:
            BIT[i] += a
            i += i & (-i)

    def bit_sum(i):
        res = 0
        while i > 0:
            res += BIT[i]
            i -= i & (-i)
        return res

    S = sorted([(r - l + 1, l, r) for l, r in LR], reverse=True)
    cnt = n
    L = []
    for i in range(1, m + 1):
        while S and S[-1][0] == i:
            c, l, r = S.pop()
            cnt -= 1
            add(l, 1)
            add(r + 1, -1)
        res = cnt
        for j in range(0, m + 1, i):
            res += bit_sum(j)
        L.append(res)
    print(*L, sep="\n")

if __name__ == "__main__":
    main()

import sys

input = sys.stdin.readline

def main():
    n, m = list(map(int, input().split()))
    S = [[] for _ in range(m + 1)]
    for _ in range(n):
        l, r = list(map(int, input().split()))
        S[r - l + 1].append((l, r))
    BIT = [0] * (m + 2)

    def add(i, a):
        while i <= m + 1:
            BIT[i] += a
            i += i & (-i)

    def bit_sum(i):
        res = 0
        while i > 0:
            res += BIT[i]
            i -= i & (-i)
        return res

    cnt = n
    for i in range(1, m + 1):
        for l, r in S[i]:
            cnt -= 1
            add(l, 1)
            add(r + 1, -1)
        res = cnt
        for j in range(0, m + 1, i):
            res += bit_sum(j)
        print(res)

if __name__ == "__main__":
    main()

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

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

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

-    S = sorted([(r - l + 1, l, r) for l, r in LR], 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:

import sys

import numpy as np

x, y, z, k = map(int, sys.stdin.readline().split())

a, b, c = (np.array(sys.stdin.readline().split(), dtype=np.int64) for _ in range(3))

def main():

    res = np.sort(np.ravel(a[:, None] + b))[::-1]

    res = np.sort(np.ravel(c[:, None] + res[:min(k, x*y)]))[::-1]

    return res[:k]

if __name__ == '__main__':

    ans = main()

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

# optimized version of the same code:

import sys

x, y, z, K = map(int, sys.stdin.readline().split())

a, b, c = (sorted(map(int, sys.stdin.readline().split()), reverse=True) for _ in range(3))

def main():

    res = []

    for i in range(1, min(K, x) + 1):

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

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

                res.append(a[i-1] + b[j-1] + c[k-1])

    return sorted(res, reverse=True)[:K]

if __name__ == '__main__':

    ans = main()

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

import sys
import numpy as np

x, y, z, k = map(int, sys.stdin.readline().split())
a, b, c = (np.array(sys.stdin.readline().split(), dtype=np.int64) for _ in range(3))

def main():
    res = np.sort(np.ravel(a[:, None] + b))[::-1]
    res = np.sort(np.ravel(c[:, None] + res[: min(k, x * y)]))[::-1]
    return res[:k]

if __name__ == "__main__":
    ans = main()
    print(*ans, sep="\n")

import sys

x, y, z, K = map(int, sys.stdin.readline().split())
a, b, c = (
    sorted(map(int, sys.stdin.readline().split()), reverse=True) for _ in range(3)
)

def main():
    res = []
    for i in range(1, min(K, x) + 1):
        for j in range(1, min(K // i, y) + 1):
            for k in range(1, min(K // (i * j), z) + 1):
                res.append(a[i - 1] + b[j - 1] + c[k - 1])
    return sorted(res, reverse=True)[:K]

if __name__ == "__main__":
    ans = main()
    print(*ans, sep="\n")

-x, y, z, k = map(int, sys.stdin.readline().split())

-a, b, c = (np.array(sys.stdin.readline().split(), dtype=np.int64) for _ in range(3))

+x, y, z, K = map(int, sys.stdin.readline().split())

+    sorted(map(int, sys.stdin.readline().split()), reverse=True) for _ in range(3)

-    res = np.sort(np.ravel(a[:, None] + b))[::-1]

-    res = np.sort(np.ravel(c[:, None] + res[: min(k, x * y)]))[::-1]

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

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

+    return sorted(res, reverse=True)[:K]


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 functools

print((len(functools.reduce(lambda x, y: x&y,[set(input().split()[1:]) for _ in [0]*int(input().split()[0])]))))

# optimized version of the same code:

print((len(set.intersection(*[set(input().split()[1:]) for _ in [0]*int(input().split()[0])]))))

import functools

print(
    (
        len(
            functools.reduce(
                lambda x, y: x & y,
                [set(input().split()[1:]) for _ in [0] * int(input().split()[0])],
            )
        )
    )
)

print(
    (
        len(
            set.intersection(
                *[set(input().split()[1:]) for _ in [0] * int(input().split()[0])]
            )
        )
    )
)

-                [set(input().split()[1:]) for _ in [0] * int(input().split()[0])],

+                *[set(input().split()[1:]) for _ in [0] * int(input().split()[0])]