Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

class prime_factorize_by_osa_k():

    def __init__(self, max_val):

        '''

        割ることが出来る最小の値を格納したリストを返す

        :param max_val:

        :return:

        '''

        self.minFactor = [-1] * (max_val + 1)

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

            if self.minFactor[i] == -1:

                self.minFactor[i] = i

                # エラトステネスの篩と同様の処理を行う

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

                    if self.minFactor[j] == -1:

                        self.minFactor[j] = i

    def osa_k(self, n):

        '''

        preprocessをしたあと、O(logN)で素因数分解を行う。nの最大値をn_maxとする。

        :param n:

        :return:

        '''

        from collections import defaultdict

        d = defaultdict(int)

        now = n

        while now > 1:

            d[self.minFactor[now]] += 1

            now //= self.minFactor[now]

        return d

def gcd(a, b):

    while b: a, b = b, a % b

    return a

N = int(eval(input()))

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

# N = 10 ** 6

# A = [10 ** 6] * N

ob = prime_factorize_by_osa_k(10 ** 6)

pairwise = False

prime_key = set(ob.osa_k(A[-1]).keys())

break_flag = False

prime_flags = [False] * (10 ** 6 + 1)

for i in range(N):

    for key in list(ob.osa_k(A[i]).keys()):

        if prime_flags[key]:

            break_flag = True

            break

        else:

            prime_flags[key] = True

    if break_flag:

        break

else:

    pairwise = True

if pairwise:

    print('pairwise coprime')

    exit()

work = gcd(A[0], A[1])

for i in range(2, N):

    work = gcd(work, A[i])

if work != 1:

    print('not coprime')

else:

    print('setwise coprime')

# optimized version of the same code:

def gcd(a, b):

    while b: a, b = b, a % b

    return a

def isPrimeMR(n):

    d = n - 1

    d = d // (d & -d)

    L = [2]

    for a in L:

        t = d

        y = pow(a, t, n)

        if y == 1: continue

        while y != n - 1:

            y = (y * y) % n

            if y == 1 or t == n - 1: return 0

            t <<= 1

    return 1

def findFactorRho(n):

    m = 1 << n.bit_length() // 8

    for c in range(1, 99):

        f = lambda x: (x * x + c) % n

        y, r, q, g = 2, 1, 1, 1

        while g == 1:

            x = y

            for i in range(r):

                y = f(y)

            k = 0

            while k < r and g == 1:

                ys = y

                for i in range(min(m, r - k)):

                    y = f(y)

                    q = q * abs(x - y) % n

                g = gcd(q, n)

                k += m

            r <<= 1

        if g == n:

            g = 1

            while g == 1:

                ys = f(ys)

                g = gcd(abs(x - ys), n)

        if g < n:

            if isPrimeMR(g): return g

            elif isPrimeMR(n // g): return n // g

            return findFactorRho(g)

def primeFactor(n):

    i = 2

    ret = {}

    rhoFlg = 0

    while i*i <= n:

        k = 0

        while n % i == 0:

            n //= i

            k += 1

        if k: ret[i] = k

        i += 1 + i % 2

        if i == 101 and n >= 2 ** 20:

            while n > 1:

                if isPrimeMR(n):

                    ret[n], n = 1, 1

                else:

                    rhoFlg = 1

                    j = findFactorRho(n)

                    k = 0

                    while n % j == 0:

                        n //= j

                        k += 1

                    ret[j] = k

    if n > 1: ret[n] = 1

    if rhoFlg: ret = {x: ret[x] for x in sorted(ret)}

    return ret

def gcd(a, b):

    while b: a, b = b, a % b

    return a

N = int(eval(input()))

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

# N = 10 ** 6

# A = [10 ** 6] * N

pairwise = False

prime_key = set(primeFactor(A[-1]).keys())

break_flag = False

prime_flags = [False] * (10 ** 6 + 1)

for i in range(N):

    for key in list(primeFactor(A[i]).keys()):

        if prime_flags[key]:

            break_flag = True

            break

        else:

            prime_flags[key] = True

    if break_flag:

        break

else:

    pairwise = True

if pairwise:

    print('pairwise coprime')

    exit()

work = gcd(A[0], A[1])

for i in range(2, N):

    work = gcd(work, A[i])

if work != 1:

    print('not coprime')

else:

    print('setwise coprime')

class prime_factorize_by_osa_k:
    def __init__(self, max_val):
        """
        割ることが出来る最小の値を格納したリストを返す
        :param max_val:
        :return:
        """
        self.minFactor = [-1] * (max_val + 1)
        for i in range(2, max_val + 1):
            if self.minFactor[i] == -1:
                self.minFactor[i] = i
                # エラトステネスの篩と同様の処理を行う
                for j in range(i * i, max_val + 1, i):
                    if self.minFactor[j] == -1:
                        self.minFactor[j] = i

    def osa_k(self, n):
        """
        preprocessをしたあと、O(logN)で素因数分解を行う。nの最大値をn_maxとする。
        :param n:
        :return:
        """
        from collections import defaultdict

        d = defaultdict(int)
        now = n
        while now > 1:
            d[self.minFactor[now]] += 1
            now //= self.minFactor[now]
        return d

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

N = int(eval(input()))
A = list(map(int, input().split()))
# N = 10 ** 6
# A = [10 ** 6] * N
ob = prime_factorize_by_osa_k(10**6)
pairwise = False
prime_key = set(ob.osa_k(A[-1]).keys())
break_flag = False
prime_flags = [False] * (10**6 + 1)
for i in range(N):
    for key in list(ob.osa_k(A[i]).keys()):
        if prime_flags[key]:
            break_flag = True
            break
        else:
            prime_flags[key] = True
    if break_flag:
        break
else:
    pairwise = True
if pairwise:
    print("pairwise coprime")
    exit()
work = gcd(A[0], A[1])
for i in range(2, N):
    work = gcd(work, A[i])
if work != 1:
    print("not coprime")
else:
    print("setwise coprime")

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def isPrimeMR(n):
    d = n - 1
    d = d // (d & -d)
    L = [2]
    for a in L:
        t = d
        y = pow(a, t, n)
        if y == 1:
            continue
        while y != n - 1:
            y = (y * y) % n
            if y == 1 or t == n - 1:
                return 0
            t <<= 1
    return 1

def findFactorRho(n):
    m = 1 << n.bit_length() // 8
    for c in range(1, 99):
        f = lambda x: (x * x + c) % n
        y, r, q, g = 2, 1, 1, 1
        while g == 1:
            x = y
            for i in range(r):
                y = f(y)
            k = 0
            while k < r and g == 1:
                ys = y
                for i in range(min(m, r - k)):
                    y = f(y)
                    q = q * abs(x - y) % n
                g = gcd(q, n)
                k += m
            r <<= 1
        if g == n:
            g = 1
            while g == 1:
                ys = f(ys)
                g = gcd(abs(x - ys), n)
        if g < n:
            if isPrimeMR(g):
                return g
            elif isPrimeMR(n // g):
                return n // g
            return findFactorRho(g)

def primeFactor(n):
    i = 2
    ret = {}
    rhoFlg = 0
    while i * i <= n:
        k = 0
        while n % i == 0:
            n //= i
            k += 1
        if k:
            ret[i] = k
        i += 1 + i % 2
        if i == 101 and n >= 2**20:
            while n > 1:
                if isPrimeMR(n):
                    ret[n], n = 1, 1
                else:
                    rhoFlg = 1
                    j = findFactorRho(n)
                    k = 0
                    while n % j == 0:
                        n //= j
                        k += 1
                    ret[j] = k
    if n > 1:
        ret[n] = 1
    if rhoFlg:
        ret = {x: ret[x] for x in sorted(ret)}
    return ret

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

N = int(eval(input()))
A = list(map(int, input().split()))
# N = 10 ** 6
# A = [10 ** 6] * N
pairwise = False
prime_key = set(primeFactor(A[-1]).keys())
break_flag = False
prime_flags = [False] * (10**6 + 1)
for i in range(N):
    for key in list(primeFactor(A[i]).keys()):
        if prime_flags[key]:
            break_flag = True
            break
        else:
            prime_flags[key] = True
    if break_flag:
        break
else:
    pairwise = True
if pairwise:
    print("pairwise coprime")
    exit()
work = gcd(A[0], A[1])
for i in range(2, N):
    work = gcd(work, A[i])
if work != 1:
    print("not coprime")
else:
    print("setwise coprime")

-        割ることが出来る最小の値を格納したリストを返す

-        self.minFactor = [-1] * (max_val + 1)

-        for i in range(2, max_val + 1):

-            if self.minFactor[i] == -1:

-                # エラトステネスの篩と同様の処理を行う

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

-                    if self.minFactor[j] == -1:

-                        self.minFactor[j] = i

-        preprocessをしたあと、O(logN)で素因数分解を行う。nの最大値をn_maxとする。

-        from collections import defaultdict

-            d[self.minFactor[now]] += 1

-            now //= self.minFactor[now]

+                for i in range(min(m, r - k)):

+                    q = q * abs(x - y) % n

+                g = gcd(abs(x - ys), n)

+                    j = findFactorRho(n)

+        ret = {x: ret[x] for x in sorted(ret)}

-    for key in list(ob.osa_k(A[i]).keys()):

+    for key in list(primeFactor(A[i]).keys()):


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

import numpy as np

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

S = list(eval(input())) + ['2']

blocks = []

cur = 1

seq = 0

for s in S:

    if int(s) == cur:

        seq += 1

    else:

        blocks.append(seq)

        cur = 1 - cur

        seq = 1

answer = 0

blocks = np.array(blocks)

for i in range(0, len(blocks), 2):

    answer = max(answer, blocks[i:i+2*K+1].sum())

print(answer)

# optimized version of the same code:

# coding: utf-8

import sys

import itertools

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

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))

# 0か1の連続している人数のリスト、累積和

streak = [0, 0]

N, K = lr()

S = sr() + '2'

cur = 1

for i in range(N):

    if S[i] != S[i+1]:

        streak.append(cur)

        cur = 1

    else:

        cur += 1

streak_cum = list(itertools.accumulate(streak))

streak_cum.extend([streak_cum[-1], streak_cum[-1]])

if S[0] == '0':

    start = 0

else:

    start = 1

answer = 0

limit = len(streak_cum) - 1

for i in range(start, len(streak_cum), 2):

    result = streak_cum[min(limit, i+2*K+1)] - streak_cum[i]

    if result > answer:

        answer = result

print(answer)

# 52

import numpy as np

N, K = list(map(int, input().split()))
S = list(eval(input())) + ["2"]
blocks = []
cur = 1
seq = 0
for s in S:
    if int(s) == cur:
        seq += 1
    else:
        blocks.append(seq)
        cur = 1 - cur
        seq = 1
answer = 0
blocks = np.array(blocks)
for i in range(0, len(blocks), 2):
    answer = max(answer, blocks[i : i + 2 * K + 1].sum())
print(answer)

# coding: utf-8
import sys
import itertools

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
# 0か1の連続している人数のリスト、累積和
streak = [0, 0]
N, K = lr()
S = sr() + "2"
cur = 1
for i in range(N):
    if S[i] != S[i + 1]:
        streak.append(cur)
        cur = 1
    else:
        cur += 1
streak_cum = list(itertools.accumulate(streak))
streak_cum.extend([streak_cum[-1], streak_cum[-1]])
if S[0] == "0":
    start = 0
else:
    start = 1
answer = 0
limit = len(streak_cum) - 1
for i in range(start, len(streak_cum), 2):
    result = streak_cum[min(limit, i + 2 * K + 1)] - streak_cum[i]
    if result > answer:
        answer = result
print(answer)
# 52

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

+lr = lambda: list(map(int, sr().split()))

+# 0か1の連続している人数のリスト、累積和

-    answer = max(answer, blocks[i : i + 2 * K + 1].sum())

+for i in range(start, len(streak_cum), 2):

+    result = streak_cum[min(limit, i + 2 * K + 1)] - streak_cum[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 numpy as np

S=eval(input())

S=np.array([1 if s=='B' else 0 for s in S])

print((np.abs(np.diff(S)).sum()))

# optimized version of the same code:

from itertools import groupby

S=eval(input())

answer = sum([1 for _ in groupby(S)]) -1

print(answer)

import numpy as np

S = eval(input())
S = np.array([1 if s == "B" else 0 for s in S])
print((np.abs(np.diff(S)).sum()))

from itertools import groupby

S = eval(input())
answer = sum([1 for _ in groupby(S)]) - 1
print(answer)

-S = np.array([1 if s == "B" else 0 for s in S])

+answer = sum([1 for _ in groupby(S)]) - 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:

INF = 2*10**7

def main():

    N, M = (int(i) for i in input().split())

    A = []

    B = []

    C = []

    for _ in range(M):

        a, b = (int(i) for i in input().split())

        A.append(a)

        B.append(b)

        bit = 0

        for i in input().split():

            bit |= (1 << (int(i)-1))

        C.append(bit)

    dp = [[INF]*(1 << N) for _ in range(M+1)]

    dp[0][0] = 0

    for i in range(M):

        for j in range(1 << N):

            dp[i+1][j] = min(dp[i+1][j], dp[i][j])

            if dp[i][j] != INF:

                next_bit = j | C[i]

                dp[i+1][next_bit] = min(dp[i+1][next_bit], dp[i][j] + A[i])

    ans = dp[-1][-1]

    if ans == INF:

        print((-1))

    else:

        print(ans)

    # print(*dp, sep="\n")

if __name__ == '__main__':

    main()

# optimized version of the same code:

INF = 2*10**7

def main():

    import sys

    input = sys.stdin.buffer.readline

    N, M = (int(i) for i in input().split())

    A = []

    B = []

    C = []

    for _ in range(M):

        a, b = (int(i) for i in input().split())

        A.append(a)

        B.append(b)

        bit = 0

        for i in input().split():

            bit |= (1 << (int(i)-1))

        C.append(bit)

    dp = [[INF]*(1 << N) for _ in range(M+1)]

    dp[0][0] = 0

    for i in range(M):

        for j in range(1 << N):

            dp[i+1][j] = min(dp[i+1][j], dp[i][j])

            if dp[i][j] != INF:

                next_bit = j | C[i]

                dp[i+1][next_bit] = min(dp[i+1][next_bit], dp[i][j] + A[i])

    ans = dp[-1][-1]

    if ans == INF:

        print((-1))

    else:

        print(ans)

    # print(*dp, sep="\n")

if __name__ == '__main__':

    main()

INF = 2 * 10**7

def main():
    N, M = (int(i) for i in input().split())
    A = []
    B = []
    C = []
    for _ in range(M):
        a, b = (int(i) for i in input().split())
        A.append(a)
        B.append(b)
        bit = 0
        for i in input().split():
            bit |= 1 << (int(i) - 1)
        C.append(bit)
    dp = [[INF] * (1 << N) for _ in range(M + 1)]
    dp[0][0] = 0
    for i in range(M):
        for j in range(1 << N):
            dp[i + 1][j] = min(dp[i + 1][j], dp[i][j])
            if dp[i][j] != INF:
                next_bit = j | C[i]
                dp[i + 1][next_bit] = min(dp[i + 1][next_bit], dp[i][j] + A[i])
    ans = dp[-1][-1]
    if ans == INF:
        print((-1))
    else:
        print(ans)
    # print(*dp, sep="\n")

if __name__ == "__main__":
    main()

INF = 2 * 10**7

def main():
    import sys

    input = sys.stdin.buffer.readline
    N, M = (int(i) for i in input().split())
    A = []
    B = []
    C = []
    for _ in range(M):
        a, b = (int(i) for i in input().split())
        A.append(a)
        B.append(b)
        bit = 0
        for i in input().split():
            bit |= 1 << (int(i) - 1)
        C.append(bit)
    dp = [[INF] * (1 << N) for _ in range(M + 1)]
    dp[0][0] = 0
    for i in range(M):
        for j in range(1 << N):
            dp[i + 1][j] = min(dp[i + 1][j], dp[i][j])
            if dp[i][j] != INF:
                next_bit = j | C[i]
                dp[i + 1][next_bit] = min(dp[i + 1][next_bit], dp[i][j] + A[i])
    ans = dp[-1][-1]
    if ans == INF:
        print((-1))
    else:
        print(ans)
    # print(*dp, sep="\n")

if __name__ == "__main__":
    main()

+    import sys
+
+    input = sys.stdin.buffer.readline


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

class UnionFind():

    def __init__(self, n):

        self.n = n

        self.parents = [-1] * n

    def find(self, x):

        if self.parents[x] < 0:

            return x

        else:

            self.parents[x] = self.find(self.parents[x])

            return self.parents[x]

    def union(self, x, y):

        x = self.find(x)

        y = self.find(y)

        if x == y:

            return

        if self.parents[x] > self.parents[y]:

            x, y = y, x

        self.parents[x] += self.parents[y]

        self.parents[y] = x

    def same(self, x, y):

        return self.find(x) == self.find(y)

import numpy as np

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

edge = []

for _ in range(M):

    edge.append(list(map(int, input().split())))

ans = 0

for i in range(M):

    unionfind = UnionFind(N)

    for j in [k for k in range(M) if k != i]:

        a, b = edge[j][0] - 1, edge[j][1] - 1

        unionfind.union(a, b)

    if np.count_nonzero(np.array(unionfind.parents) < 0) >= 2:

        ans += 1

print(ans)

# optimized version of the same code:

#!/usr/bin/env python3

from collections import deque

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

edge = []

for _ in range(M):

    edge.append(list(map(int, input().split())))

ans = 0

for i in range(M):

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

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

    for j in [k for k in range(M) if k != i]:

        a, b = edge[j][0], edge[j][1]

        renketu[a].append(b)

        renketu[b].append(a)

    q = deque([1])

    while q:

        now = q.pop()

        done[now] = False

        for r in renketu[now]:

            if done[r]:

                q.append(r)

    if sum(done) > 1:

        ans += 1

print(ans)

#!/usr/bin/env python3
class UnionFind:
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def same(self, x, y):
        return self.find(x) == self.find(y)

import numpy as np

N, M = list(map(int, input().split()))
edge = []
for _ in range(M):
    edge.append(list(map(int, input().split())))
ans = 0
for i in range(M):
    unionfind = UnionFind(N)
    for j in [k for k in range(M) if k != i]:
        a, b = edge[j][0] - 1, edge[j][1] - 1
        unionfind.union(a, b)
    if np.count_nonzero(np.array(unionfind.parents) < 0) >= 2:
        ans += 1
print(ans)

-            self.parents[x] = self.find(self.parents[x])

-        if self.parents[x] > self.parents[y]:

-        self.parents[x] += self.parents[y]

-        return self.find(x) == self.find(y)

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

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

-    if np.count_nonzero(np.array(unionfind.parents) < 0) >= 2:


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

import numpy as np

N = int(eval(input()))

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

count = 0

while True:

    if np.sum(A%2) > 0:

        break

    count +=1

    A = A//2

print(count)

# optimized version of the same code:

n = int(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) # (1)…2で割った回数が最小のものを探索

print(ans)

import numpy as np

N = int(eval(input()))
A = np.array(list(map(int, input().split())))
count = 0
while True:
    if np.sum(A % 2) > 0:
        break
    count += 1
    A = A // 2
print(count)

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

+    ans = min(ans, len(bin(i)) - bin(i).rfind("1") - 1)  # (1)…2で割った回数が最小のものを探索


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

def prime_factorize(num):

    """

    This function performs prime factorization on the input natural number.

    The result is returned in the form of a dictionary with the prime number as the key

    and its number as the value.

    :param num:

    :return prime_factor: Dictionary with the prime number as the key and its number as the value.

    """

    prime_factor = {}

    i = 2

    while i ** 2 <= num:

        while num % i == 0:

            num //= i

            if i in list(prime_factor.keys()):

                prime_factor[i] += 1

            else:

                prime_factor[i] = 1

        i += 1

    if num > 1:

        prime_factor[num] = 1

    return prime_factor

from math import factorial

def comb(n, r, R):

    if n not in R:

        a = factorial(n)

        R[n] = a

    else:

        a = R[n]

    if n - r not in R:

        b = factorial(n - r)

        R[n - r] = b

    else:

        b = R[n - r]

    if r not in R:

        c = factorial(r)

        R[r] = c

    else:

        c = R[r]

    return a // (b * c)

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

r = 1

R = dict()

prime_fac = prime_factorize(m)

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

    r *= comb(v + n - 1, v, R)

mod = 1000000000 + 7

print((r % mod))

# optimized version of the same code:

def prime_factorize(num):

    """

    This function performs prime factorization on the input natural number.

    The result is returned in the form of a dictionary with the prime number as the key

    and its number as the value.

    :param num:

    :return prime_factor: Dictionary with the prime number as the key and its number as the value.

    """

    prime_factor = {}

    i = 2

    while i ** 2 <= num:

        while num % i == 0:

            num //= i

            if i in list(prime_factor.keys()):

                prime_factor[i] += 1

            else:

                prime_factor[i] = 1

        i += 1

    if num > 1:

        prime_factor[num] = 1

    return prime_factor

def combination(n, r):

    r = min(n-r, r)

    result = 1

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

        result *= i

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

        result //= i

    return result

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

r = 1

prime_fac = prime_factorize(m)

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

    r *= combination(v + n - 1, v)

mod = 1000000000 + 7

print((r % mod))

def prime_factorize(num):
    """
    This function performs prime factorization on the input natural number.
    The result is returned in the form of a dictionary with the prime number as the key
    and its number as the value.
    :param num:
    :return prime_factor: Dictionary with the prime number as the key and its number as the value.
    """
    prime_factor = {}
    i = 2
    while i**2 <= num:
        while num % i == 0:
            num //= i
            if i in list(prime_factor.keys()):
                prime_factor[i] += 1
            else:
                prime_factor[i] = 1
        i += 1
    if num > 1:
        prime_factor[num] = 1
    return prime_factor

from math import factorial

def comb(n, r, R):
    if n not in R:
        a = factorial(n)
        R[n] = a
    else:
        a = R[n]
    if n - r not in R:
        b = factorial(n - r)
        R[n - r] = b
    else:
        b = R[n - r]
    if r not in R:
        c = factorial(r)
        R[r] = c
    else:
        c = R[r]
    return a // (b * c)

n, m = list(map(int, input().split()))
r = 1
R = dict()
prime_fac = prime_factorize(m)
for v in list(prime_fac.values()):
    r *= comb(v + n - 1, v, R)
mod = 1000000000 + 7
print((r % mod))

def prime_factorize(num):
    """
    This function performs prime factorization on the input natural number.
    The result is returned in the form of a dictionary with the prime number as the key
    and its number as the value.
    :param num:
    :return prime_factor: Dictionary with the prime number as the key and its number as the value.
    """
    prime_factor = {}
    i = 2
    while i**2 <= num:
        while num % i == 0:
            num //= i
            if i in list(prime_factor.keys()):
                prime_factor[i] += 1
            else:
                prime_factor[i] = 1
        i += 1
    if num > 1:
        prime_factor[num] = 1
    return prime_factor

def combination(n, r):
    r = min(n - r, r)
    result = 1
    for i in range(n, n - r, -1):
        result *= i
    for i in range(1, r + 1):
        result //= i
    return result

n, m = list(map(int, input().split()))
r = 1
prime_fac = prime_factorize(m)
for v in list(prime_fac.values()):
    r *= combination(v + n - 1, v)
mod = 1000000000 + 7
print((r % mod))

-from math import factorial
-def comb(n, r, R):
-    if n not in R:
-        a = factorial(n)
-        R[n] = a
-    else:
-        a = R[n]
-    if n - r not in R:
-        b = factorial(n - r)
-        R[n - r] = b
-    else:
-        b = R[n - r]
-    if r not in R:
-        c = factorial(r)
-        R[r] = c
-    else:
-        c = R[r]
-    return a // (b * c)
+def combination(n, r):
+    r = min(n - r, r)
+    result = 1
+    for i in range(n, n - r, -1):
+        result *= i
+    for i in range(1, r + 1):
+        result //= i
+    return result
-R = dict()
-    r *= comb(v + n - 1, v, R)
+    r *= combination(v + n - 1, v)


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

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

if a < b + c:

    print((b+c-a))

else:

    print((0))

# optimized version of the same code:

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

print((max(0, c-(a-b))))

a, b, c = list(map(int, input().split()))
if a < b + c:
    print((b + c - a))
else:
    print((0))

a, b, c = list(map(int, input().split()))
print((max(0, c - (a - b))))

-if a < b + c:
-    print((b + c - a))
-else:
-    print((0))
+print((max(0, c - (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 collections import Counter

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

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

X = Counter(A)

for i in range(M):

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

    X[C] += B

Z = []

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

    Z.append((key, value))

Z.sort(key=lambda x: x[0], reverse=True)

ans = 0

cnt = 0

for value, key in Z:

    if cnt + key <= N:

        ans += key * value

        cnt += key

    else:

        ans += (N - cnt) * value

        break

print(ans)

# optimized version of the same code:

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

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

query = []

for i in range(M):

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

    query.append([b, c])

query.sort(key=lambda q: q[1], reverse=True)

i = 0

for b, c in query:

    while i < N and b > 0:

        if A[i] < c:

            A[i] = c

            b -= 1

        i += 1

print((sum(A)))

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

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

-Z.sort(key=lambda x: x[0], reverse=True)

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

+query.sort(key=lambda q: q[1], reverse=True)


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

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

if any(i % 2 != 0 for i in [a, b, c]):

    print((0))

    exit()

if a == b and b == c:

    print((-1))

    exit()

cnt = 0

a_list = [0]*(1001001)

b_list = [0]*(1001001)

c_list = [0]*(1001001)

a_list[0] = a

b_list[0] = b

c_list[0] = c

for i in range(1, 1001001):

    a_list[i] = (b_list[i-1] + c_list[i-1]) // 2

    b_list[i] = (c_list[i-1] + a_list[i-1]) // 2

    c_list[i] = (a_list[i-1] + b_list[i-1]) // 2

    cnt += 1

    if a_list[i] % 2 != 0 or b_list[i] % 2 != 0 or c_list[i] % 2 != 0:

        break

print(cnt)

# optimized version of the same code:

def solve(a, b, c):

    if any(i % 2 == 1 for i in [a, b, c]):

        return 0

    if a == b == c:

        return -1

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

    return solve(a, b, c) + 1

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

print((solve(a, b, c)))

+    if any(i % 2 == 1 for i in [a, b, c]):


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

from functools import lru_cache

import sys

sys.setrecursionlimit(30000)

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

a = list(int(eval(input())) for _ in range(M))

MOD = pow(10, 9) + 7

isOk = True

for i in range(M-1):

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

        isOk = False

funcb = [-1] * 100001

def func(n):

    if n <= 0:

        return 1

    cnt = funcb[n]

    if cnt > 0:

        return cnt

    cnt = 0

    if n >= 2:

        cnt += func(n-2)

    if n >= 1:

        cnt += func(n-1)

    funcb[n] = cnt % MOD

    return funcb[n]

func(30000)

func(50000)

func(80000)

func(100000)

if not isOk:

    print((0))

else:

    ans = 1

    s = 0

    for i in range(M+1):

        if i >= M:

            e = N

        else:

            e = a[i] - 1

        ans = ans * func(e-s) % MOD

        if i >= M:

            break

        s = a[i] + 1

    print(ans)

# optimized version of the same code:

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

a = list(int(eval(input())) for _ in range(M))

MOD = pow(10, 9) + 7

MAP = [0] * (N + 1)

for x in a:

    MAP[x] = -1

MAP[0] = 1

for i in range(N):

    if MAP[i] < 0:

        continue

    MAP[i] %= MOD

    if i + 1 <= N and MAP[i+1] >= 0:

        MAP[i+1] += MAP[i]

    if i + 2 <= N and MAP[i+2] >= 0:

        MAP[i+2] += MAP[i]

print((MAP[N] % MOD))

from functools import lru_cache
import sys

sys.setrecursionlimit(30000)
N, M = list(map(int, input().split()))
a = list(int(eval(input())) for _ in range(M))
MOD = pow(10, 9) + 7
isOk = True
for i in range(M - 1):
    if a[i] + 1 == a[i + 1]:
        isOk = False
funcb = [-1] * 100001

def func(n):
    if n <= 0:
        return 1
    cnt = funcb[n]
    if cnt > 0:
        return cnt
    cnt = 0
    if n >= 2:
        cnt += func(n - 2)
    if n >= 1:
        cnt += func(n - 1)
    funcb[n] = cnt % MOD
    return funcb[n]

func(30000)
func(50000)
func(80000)
func(100000)
if not isOk:
    print((0))
else:
    ans = 1
    s = 0
    for i in range(M + 1):
        if i >= M:
            e = N
        else:
            e = a[i] - 1
        ans = ans * func(e - s) % MOD
        if i >= M:
            break
        s = a[i] + 1
    print(ans)

N, M = list(map(int, input().split()))
a = list(int(eval(input())) for _ in range(M))
MOD = pow(10, 9) + 7
MAP = [0] * (N + 1)
for x in a:
    MAP[x] = -1
MAP[0] = 1
for i in range(N):
    if MAP[i] < 0:
        continue
    MAP[i] %= MOD
    if i + 1 <= N and MAP[i + 1] >= 0:
        MAP[i + 1] += MAP[i]
    if i + 2 <= N and MAP[i + 2] >= 0:
        MAP[i + 2] += MAP[i]
print((MAP[N] % MOD))

-from functools import lru_cache
-import sys
-sys.setrecursionlimit(30000)
-isOk = True
-for i in range(M - 1):
-    if a[i] + 1 == a[i + 1]:
-        isOk = False
-funcb = [-1] * 100001
-def func(n):
-    if n <= 0:
-        return 1
-    cnt = funcb[n]
-    if cnt > 0:
-        return cnt
-    cnt = 0
-    if n >= 2:
-        cnt += func(n - 2)
-    if n >= 1:
-        cnt += func(n - 1)
-    funcb[n] = cnt % MOD
-    return funcb[n]
-func(30000)
-func(50000)
-func(80000)
-func(100000)
-if not isOk:
-    print((0))
-else:
-    ans = 1
-    s = 0
-    for i in range(M + 1):
-        if i >= M:
-            e = N
-        else:
-            e = a[i] - 1
-        ans = ans * func(e - s) % MOD
-        if i >= M:
-            break
-        s = a[i] + 1
-    print(ans)
+MAP = [0] * (N + 1)
+for x in a:
+    MAP[x] = -1
+MAP[0] = 1
+for i in range(N):
+    if MAP[i] < 0:
+        continue
+    MAP[i] %= MOD
+    if i + 1 <= N and MAP[i + 1] >= 0:
+        MAP[i + 1] += MAP[i]
+    if i + 2 <= N and MAP[i + 2] >= 0:
+        MAP[i + 2] += MAP[i]
+print((MAP[N] % 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

import numpy as np

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

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

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

tmp = [(i+1)/2 for i in p]

cs = list(np.cumsum(tmp))

if n == k:

    print((cs[-1]))

    exit()

ans = 0

for i in range(n - k):

    ans = max(ans, cs[i + k] - cs[i])

print(ans)

# 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

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

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

tmp = [(i+1)/2 for i in p]

# cs = list(np.cumsum(tmp))

cs = [0]*n

cs[0] = tmp[0]

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

    cs[i + 1] = cs[i] + tmp[i + 1]

if n == k:

    print((cs[-1]))

    exit()

ans = 0

for i in range(n - k):

    ans = max(ans, cs[i + k] - cs[i])

print(ans)

import sys
import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
n, k = list(map(int, readline().split()))
p = list(map(int, readline().split()))
tmp = [(i + 1) / 2 for i in p]
cs = list(np.cumsum(tmp))
if n == k:
    print((cs[-1]))
    exit()
ans = 0
for i in range(n - k):
    ans = max(ans, cs[i + k] - cs[i])
print(ans)

import sys

# import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
n, k = list(map(int, readline().split()))
p = list(map(int, readline().split()))
tmp = [(i + 1) / 2 for i in p]
# cs = list(np.cumsum(tmp))
cs = [0] * n
cs[0] = tmp[0]
for i in range(len(tmp) - 1):
    cs[i + 1] = cs[i] + tmp[i + 1]
if n == k:
    print((cs[-1]))
    exit()
ans = 0
for i in range(n - k):
    ans = max(ans, cs[i + k] - cs[i])
print(ans)

-import numpy as np
+# import numpy as np
-cs = list(np.cumsum(tmp))
+# cs = list(np.cumsum(tmp))
+cs = [0] * n
+cs[0] = tmp[0]
+for i in range(len(tmp) - 1):
+    cs[i + 1] = cs[i] + tmp[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:

'''

A = 500 とする。

このとき、X = 10^9 となるのは、 B = 499.9968... のとき。

→ AまたはB (の絶対値) が大きすぎると、Xが10^9に収まらない。

A, Bの探索範囲は -120~120で十分。

'''

from itertools import product

def main():

    X = int(eval(input()))

    for A, B in product(list(range(-150, 150)), list(range(-150, 150))):

        if A**5 - B**5 == X:

            print((A, B))

            return

main()

# optimized version of the same code:

from itertools import count

def main():

    X = int(eval(input()))

    for i in count():

        for A in (-i, i):

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

                if A**5 - B**5 == X:

                    print((A, B))

                    return

main()

"""
A = 500 とする。
このとき、X = 10^9 となるのは、 B = 499.9968... のとき。
→ AまたはB (の絶対値) が大きすぎると、Xが10^9に収まらない。
A, Bの探索範囲は -120~120で十分。
"""
from itertools import product

def main():
    X = int(eval(input()))
    for A, B in product(list(range(-150, 150)), list(range(-150, 150))):
        if A**5 - B**5 == X:
            print((A, B))
            return

main()

from itertools import count

def main():
    X = int(eval(input()))
    for i in count():
        for A in (-i, i):
            for B in range(-i, i + 1):
                if A**5 - B**5 == X:
                    print((A, B))
                    return

main()

-→ AまたはB (の絶対値) が大きすぎると、Xが10^9に収まらない。

-    for A, B in product(list(range(-150, 150)), list(range(-150, 150))):


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:

# 2019-11-17 20:44:23(JST)

import sys

# import collections

# import math

# from string import ascii_lowercase, ascii_uppercase, digits

# from bisect import bisect_left as bi_l, bisect_right as bi_r

# import itertools

# from functools import reduce

# import operator as op

# import re

# import heapq

# import array

# from scipy.misc import comb # (default: exact=False)

# import numpy as np

def main():

    s, t = sys.stdin.read().split()

    count = 0

    for i in range(3):

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

            count += 1

    print(count)

if __name__ == "__main__":

    main()

# optimized version of the same code:

import sys

s, t = sys.stdin.read().split()

def main():

    cnt = 0

    for i in range(3):

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

            cnt += 1

    return cnt

if __name__ == '__main__':

    ans = main()

    print(ans)

import sys

s, t = sys.stdin.read().split()

def main():
    cnt = 0
    for i in range(3):
        if s[i] == t[i]:
            cnt += 1
    return cnt

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

-# from string import ascii_lowercase, ascii_uppercase, digits

-# from bisect import bisect_left as bi_l, bisect_right as bi_r

-# from scipy.misc import comb # (default: exact=False)


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

n = int(eval(input()))

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

count = 0

while(1):

    if all(1 - (l % 2)):

        count += 1

        l = l / 2

    else:

        break

print(count)

# optimized version of the same code:

N = eval(input())

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

count = 0

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

    count += 1

    A = [a/2 for a in A]

print(count)

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

n = int(eval(input()))
l = np.array(list(map(int, input().split())))
count = 0
while 1:
    if all(1 - (l % 2)):
        count += 1
        l = l / 2
    else:
        break
print(count)

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

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


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

#                         author:  kagemeka

#                         created: 2019-11-06 21:30:22(JST)

import sys

# import collections

# import math

# import string

# import bisect

# import re

# import itertools

# import statistics

# import functools

# import operator

def main():

    a, b = (int(x) for x in sys.stdin.read().split())

    count = 0

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

        n = str(n)

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

            count += 1

    print(count)

if __name__ == "__main__":

    # execute only if run as a script

    main()

# optimized version of the same code:

import sys

from bisect import bisect_left as bi_l, bisect_right as bi_r

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

def main():

    palindromic_nums = []

    for i in range(1, 10):

        for j in range(10):

            for k in range(10):

                x = [i, j, k, j, i]

                palindromic_nums.append(int(''.join(list(map(str, x)))))

    return bi_r(palindromic_nums, b) - bi_l(palindromic_nums, a)

if __name__ == '__main__':

    ans = main()

    print(ans)

#                         author:  kagemeka
#                         created: 2019-11-06 21:30:22(JST)
import sys

# import collections
# import math
# import string
# import bisect
# import re
# import itertools
# import statistics
# import functools
# import operator
def main():
    a, b = (int(x) for x in sys.stdin.read().split())
    count = 0
    for n in range(a, b + 1):
        n = str(n)
        if n == n[::-1]:
            count += 1
    print(count)

if __name__ == "__main__":
    # execute only if run as a script
    main()

import sys
from bisect import bisect_left as bi_l, bisect_right as bi_r

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

def main():
    palindromic_nums = []
    for i in range(1, 10):
        for j in range(10):
            for k in range(10):
                x = [i, j, k, j, i]
                palindromic_nums.append(int("".join(list(map(str, x)))))
    return bi_r(palindromic_nums, b) - bi_l(palindromic_nums, a)

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

-#                         author:  kagemeka

+from bisect import bisect_left as bi_l, bisect_right as bi_r

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

-    a, b = (int(x) for x in sys.stdin.read().split())

+                palindromic_nums.append(int("".join(list(map(str, x)))))

+    return bi_r(palindromic_nums, b) - bi_l(palindromic_nums, 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 = int(eval(input()))

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

X = list(sorted(X))

if N == 1:

  print((0))

  exit()

ans = float('inf')

for p in range(X[0], X[N - 1] + 1):

  sum = 0

  for x in X:

    sum += (x - p) ** 2

  ans = min(sum, ans)

print(ans)

# optimized version of the same code:

N = int(eval(input()))

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

avg = round(sum(X) / N)

print((sum([(x - avg) ** 2 for x in X])))

N = int(eval(input()))
X = list(map(int, input().split()))
X = list(sorted(X))
if N == 1:
    print((0))
    exit()
ans = float("inf")
for p in range(X[0], X[N - 1] + 1):
    sum = 0
    for x in X:
        sum += (x - p) ** 2
    ans = min(sum, ans)
print(ans)

+print((sum([(x - avg) ** 2 for x in X])))


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

from collections import Counter

import numpy as np

def part(pts, a, ans):

    b = np.dot(pts, [np.sin(a), np.cos(a)])

    c = np.argmax(b, axis=0)

    for i, v in list(Counter(c).items()):

        ans[i] += v

def solve(n, pts):

    ans = [0] * n

    part(pts, np.linspace(0, np.pi, 100000, endpoint=False), ans)

    part(pts, np.linspace(np.pi, 2 * np.pi, 100000, endpoint=False), ans)

    return [v / 200000 for v in ans]

n = int(eval(input()))

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

print(('\n'.join(map(str, solve(n, pts)))))

# optimized version of the same code:

from collections import Counter

import numpy as np

def part(pts, s, t, num, ans):

    a = np.linspace(s, t, num, endpoint=False)

    for i, v in list(Counter(np.argmax(np.dot(pts, [np.sin(a), np.cos(a)]), axis=0)).items()):

        ans[i] += v

def solve(n, pts):

    ans = np.zeros(n)

    part(pts, 0, np.pi, 1e5, ans)

    part(pts, np.pi, 2 * np.pi, 1e5, ans)

    return ans / 2e5

n = int(eval(input()))

print(('\n'.join(map(str, solve(n, [list(map(int, input().split())) for _ in range(n)])))))

from collections import Counter
import numpy as np

def part(pts, a, ans):
    b = np.dot(pts, [np.sin(a), np.cos(a)])
    c = np.argmax(b, axis=0)
    for i, v in list(Counter(c).items()):
        ans[i] += v

def solve(n, pts):
    ans = [0] * n
    part(pts, np.linspace(0, np.pi, 100000, endpoint=False), ans)
    part(pts, np.linspace(np.pi, 2 * np.pi, 100000, endpoint=False), ans)
    return [v / 200000 for v in ans]

n = int(eval(input()))
pts = np.array([list(map(int, input().split())) for _ in range(n)])
print(("\n".join(map(str, solve(n, pts)))))

from collections import Counter
import numpy as np

def part(pts, s, t, num, ans):
    a = np.linspace(s, t, num, endpoint=False)
    for i, v in list(
        Counter(np.argmax(np.dot(pts, [np.sin(a), np.cos(a)]), axis=0)).items()
    ):
        ans[i] += v

def solve(n, pts):
    ans = np.zeros(n)
    part(pts, 0, np.pi, 1e5, ans)
    part(pts, np.pi, 2 * np.pi, 1e5, ans)
    return ans / 2e5

n = int(eval(input()))
print(
    ("\n".join(map(str, solve(n, [list(map(int, input().split())) for _ in range(n)]))))
)

-    b = np.dot(pts, [np.sin(a), np.cos(a)])

-    for i, v in list(Counter(c).items()):

+    a = np.linspace(s, t, num, endpoint=False)

+        Counter(np.argmax(np.dot(pts, [np.sin(a), np.cos(a)]), axis=0)).items()

-    part(pts, np.linspace(0, np.pi, 100000, endpoint=False), ans)

-    part(pts, np.linspace(np.pi, 2 * np.pi, 100000, endpoint=False), ans)

+    part(pts, np.pi, 2 * np.pi, 1e5, ans)

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

+    ("\n".join(map(str, solve(n, [list(map(int, input().split())) for _ in range(n)]))))


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

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

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

d = [0] * n

d_max = 0

for i in range(n - 1):

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

    d_max = max(d_max, d[i])

d[-1] = (k - a[-1]) + a[0]

d_max = max(d_max, d[-1])

print((k - d_max))

# optimized version of the same code:

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

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

d_max = 0

for i in range(n - 1):

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

    d_max = max(d_max, d)

d = (k - a[-1]) + a[0]

d_max = max(d_max, d)

print((k - d_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:

import sys

input = sys.stdin.readline

from collections import deque

N = int(eval(input()))

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

for i in range(N-1):

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

    X[x-1].append(y-1)

    X[y-1].append(x-1)

i0 = min([i for i in range(N) if len(X[i]) == 1])

P = [-1] * N

Q = deque([i0])

R = []

while Q:

    i = deque.popleft(Q)

    R.append(i)

    for a in X[i]:

        if a != P[i]:

            P[a] = i

            X[a].remove(i)

            deque.append(Q, a)

mod = 10 ** 9 + 7

inv2 = (mod + 1) // 2

A = [1] * N

for i in R[::-1]:

    s = 0

    for j in X[i]:

        A[i] += A[j]

ans = 0

for i in range(N):

    s = pow(inv2, N - A[i], mod)

    t = 1 + (1-pow(inv2, N - A[i], mod)) * pow(2, N - A[i], mod)

    for j in X[i]:

        s = (s * pow(inv2, A[j], mod)) % mod

        t = (t + (1-pow(inv2, A[j], mod)) * pow(2, A[j], mod)) % mod

    ans = (ans + 1 - s * t) % mod

print((ans * inv2 % mod))

# optimized version of the same code:

import sys

input = sys.stdin.readline

from collections import deque

N = int(eval(input()))

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

for i in range(N-1):

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

    X[x-1].append(y-1)

    X[y-1].append(x-1)

i0 = min([i for i in range(N) if len(X[i]) == 1])

P = [-1] * N

Q = deque([i0])

R = []

while Q:

    i = deque.popleft(Q)

    R.append(i)

    for a in X[i]:

        if a != P[i]:

            P[a] = i

            X[a].remove(i)

            deque.append(Q, a)

mod = 10 ** 9 + 7

pow2 = [1]

for i in range(N + 10):

    pow2.append(pow2[-1] * 2 % mod)

inv2 = (mod + 1) // 2

invpow2 = [pow(pow2[-1], mod-2, mod)]

for i in range(N + 10)[::-1]:

    invpow2.append(invpow2[-1] * 2 % mod)

invpow2 = invpow2[::-1]

A = [1] * N

for i in R[::-1]:

    s = 0

    for j in X[i]:

        A[i] += A[j]

ans = 0

for i in range(N):

    s = pow(inv2, N - A[i], mod)

    t = 1 + (1-invpow2[N-A[i]]) * pow2[N-A[i]]

    for j in X[i]:

        s = (s * invpow2[A[j]]) % mod

        t = (t + (1-invpow2[A[j]]) * pow2[A[j]]) % mod

    ans = (ans + 1 - s * t) % mod

print((ans * inv2 % mod))

import sys

input = sys.stdin.readline
from collections import deque

N = int(eval(input()))
X = [[] for i in range(N)]
for i in range(N - 1):
    x, y = list(map(int, input().split()))
    X[x - 1].append(y - 1)
    X[y - 1].append(x - 1)
i0 = min([i for i in range(N) if len(X[i]) == 1])
P = [-1] * N
Q = deque([i0])
R = []
while Q:
    i = deque.popleft(Q)
    R.append(i)
    for a in X[i]:
        if a != P[i]:
            P[a] = i
            X[a].remove(i)
            deque.append(Q, a)
mod = 10**9 + 7
inv2 = (mod + 1) // 2
A = [1] * N
for i in R[::-1]:
    s = 0
    for j in X[i]:
        A[i] += A[j]
ans = 0
for i in range(N):
    s = pow(inv2, N - A[i], mod)
    t = 1 + (1 - pow(inv2, N - A[i], mod)) * pow(2, N - A[i], mod)
    for j in X[i]:
        s = (s * pow(inv2, A[j], mod)) % mod
        t = (t + (1 - pow(inv2, A[j], mod)) * pow(2, A[j], mod)) % mod
    ans = (ans + 1 - s * t) % mod
print((ans * inv2 % mod))

import sys

input = sys.stdin.readline
from collections import deque

N = int(eval(input()))
X = [[] for i in range(N)]
for i in range(N - 1):
    x, y = list(map(int, input().split()))
    X[x - 1].append(y - 1)
    X[y - 1].append(x - 1)
i0 = min([i for i in range(N) if len(X[i]) == 1])
P = [-1] * N
Q = deque([i0])
R = []
while Q:
    i = deque.popleft(Q)
    R.append(i)
    for a in X[i]:
        if a != P[i]:
            P[a] = i
            X[a].remove(i)
            deque.append(Q, a)
mod = 10**9 + 7
pow2 = [1]
for i in range(N + 10):
    pow2.append(pow2[-1] * 2 % mod)
inv2 = (mod + 1) // 2
invpow2 = [pow(pow2[-1], mod - 2, mod)]
for i in range(N + 10)[::-1]:
    invpow2.append(invpow2[-1] * 2 % mod)
invpow2 = invpow2[::-1]
A = [1] * N
for i in R[::-1]:
    s = 0
    for j in X[i]:
        A[i] += A[j]
ans = 0
for i in range(N):
    s = pow(inv2, N - A[i], mod)
    t = 1 + (1 - invpow2[N - A[i]]) * pow2[N - A[i]]
    for j in X[i]:
        s = (s * invpow2[A[j]]) % mod
        t = (t + (1 - invpow2[A[j]]) * pow2[A[j]]) % mod
    ans = (ans + 1 - s * t) % mod
print((ans * inv2 % mod))

+invpow2 = [pow(pow2[-1], mod - 2, mod)]

+    invpow2.append(invpow2[-1] * 2 % mod)

-        s = (s * pow(inv2, A[j], mod)) % mod


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

import numpy as np

from scipy.sparse.csgraph import connected_components

from scipy.sparse import csr_matrix

def main():

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

    graph=[[0 for i in range(n)] for j in range(n)]

    graph_del=[]

    ans = 0

    for i in range(m):

        e_1,e_2=list(map(int,input().split(' ')))

        graph[e_1-1][e_2-1]=1

        graph[e_2-1][e_1-1]=1

        graph_del.append((e_1,e_2))

    for i,j in graph_del:

        graph[i-1][j-1]=0

        graph[j-1][i-1]=0

        if connected_components(np.array(graph),return_labels=False)!=1:

            ans += 1

        graph[i-1][j-1]=1

        graph[j-1][i-1]=1

    print(ans)

if __name__ == '__main__':

    main()

# optimized version of the same code:

class UnionFind:

    def __init__(self,N):

        self.par =[-1 for i in range(N)]

    def find(self,x):

        if self.par[x] < 0:

            return x

        else:

            self.par[x] = self.find(self.par[x])

            return self.par[x]

    def unite(self,x,y):

        x = self.find(x)

        y = self.find(y)

        if x==y:

            return

        if self.par[x] > self.par[y]:

            x,y = y,x

        self.par[x] +=self.par[y]

        self.par[y] = x

    def size(self,x):

        return -self.par[self.find(x)]

    def same(self,x,y):

        return self.find(x)==self.find(y)

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

q = [list(map(int,input().split(' '))) for i in range(M)]

ans = 0

for i in range(M):

    tmp = q[:i]+q[i+1:]

    uf = UnionFind(N)

    for j,k in tmp:

        uf.unite(j-1,k-1)

    for l in range(N):

        if uf.size(l) != N:

            ans += 1

            break

print(ans)

import numpy as np
from scipy.sparse.csgraph import connected_components
from scipy.sparse import csr_matrix

def main():
    n, m = list(map(int, input().split(" ")))
    graph = [[0 for i in range(n)] for j in range(n)]
    graph_del = []
    ans = 0
    for i in range(m):
        e_1, e_2 = list(map(int, input().split(" ")))
        graph[e_1 - 1][e_2 - 1] = 1
        graph[e_2 - 1][e_1 - 1] = 1
        graph_del.append((e_1, e_2))
    for i, j in graph_del:
        graph[i - 1][j - 1] = 0
        graph[j - 1][i - 1] = 0
        if connected_components(np.array(graph), return_labels=False) != 1:
            ans += 1
        graph[i - 1][j - 1] = 1
        graph[j - 1][i - 1] = 1
    print(ans)

if __name__ == "__main__":
    main()

class UnionFind:
    def __init__(self, N):
        self.par = [-1 for i in range(N)]

    def find(self, x):
        if self.par[x] < 0:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.par[x] > self.par[y]:
            x, y = y, x
        self.par[x] += self.par[y]
        self.par[y] = x

    def size(self, x):
        return -self.par[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

N, M = list(map(int, input().split(" ")))
q = [list(map(int, input().split(" "))) for i in range(M)]
ans = 0
for i in range(M):
    tmp = q[:i] + q[i + 1 :]
    uf = UnionFind(N)
    for j, k in tmp:
        uf.unite(j - 1, k - 1)
    for l in range(N):
        if uf.size(l) != N:
            ans += 1
            break
print(ans)

-from scipy.sparse.csgraph import connected_components

+        self.par = [-1 for i in range(N)]

+            self.par[x] = self.find(self.par[x])

+        return self.find(x) == self.find(y)

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

-    graph = [[0 for i in range(n)] for j in range(n)]

-        e_1, e_2 = list(map(int, input().split(" ")))

-        if connected_components(np.array(graph), return_labels=False) != 1:

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

+q = [list(map(int, input().split(" "))) for i in range(M)]


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

import numpy as np

n = int(eval(input()))

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

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

p = v-c

ans = 0

for i in p:

    if i>0:

        ans+=i

print(ans)

# optimized version of the same code:

n=int(eval(input()))

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

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

ans=0

for v,c in zip(V,C):

    diff=v-c

    if 0<diff:

        ans+=diff

print(ans)

import numpy as np

n = int(eval(input()))
v = np.array(list(map(int, input().split())))
c = np.array(list(map(int, input().split())))
p = v - c
ans = 0
for i in p:
    if i > 0:
        ans += i
print(ans)

n = int(eval(input()))
V = list(map(int, input().split()))
C = list(map(int, input().split()))
ans = 0
for v, c in zip(V, C):
    diff = v - c
    if 0 < diff:
        ans += diff
print(ans)

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

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


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

import sys

import numpy as np

sys.setrecursionlimit(10 ** 6)

int1 = lambda x: int(x) - 1

printV = lambda x: print(*x, sep="\n")

printH = lambda x: print(" ".join(map(str,x)))

def IS(): return sys.stdin.readline()[:-1]

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

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

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

def LI1(): return list(map(int1, sys.stdin.readline().split()))

def LII(rows_number): return [II() for _ in range(rows_number)]

def LLI(rows_number): return [LI() for _ in range(rows_number)]

def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

def main():

	K,N = MI()

	A = np.array(LI())

	A_LAST = K+A[0] - A[N-1]

	B = A[1:]-A[:N-1]

	B = np.sort(B)

	print(K-max(B[N-2],A_LAST))

if __name__ == '__main__':

	main()

# optimized version of the same code:

import sys

sys.setrecursionlimit(10 ** 6)

int1 = lambda x: int(x) - 1

printV = lambda x: print(*x, sep="\n")

printH = lambda x: print(" ".join(map(str,x)))

def IS(): return sys.stdin.readline()[:-1]

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

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

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

def LI1(): return list(map(int1, sys.stdin.readline().split()))

def LII(rows_number): return [II() for _ in range(rows_number)]

def LLI(rows_number): return [LI() for _ in range(rows_number)]

def LLI1(rows_number): return [LI1() for _ in range(rows_number)]

def main():

	k,n = MI()

	a = LI()

	b = [0]*n

	for i in range(n):

		if i == n-1:

			b[i] = a[0]+k-a[i]

		else:

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

	b.sort()

	print(k-b[-1])

if __name__ == '__main__':

	main()

import sys
import numpy as np

sys.setrecursionlimit(10**6)
int1 = lambda x: int(x) - 1
printV = lambda x: print(*x, sep="\n")
printH = lambda x: print(" ".join(map(str, x)))

def IS():
    return sys.stdin.readline()[:-1]

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

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

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

def LI1():
    return list(map(int1, sys.stdin.readline().split()))

def LII(rows_number):
    return [II() for _ in range(rows_number)]

def LLI(rows_number):
    return [LI() for _ in range(rows_number)]

def LLI1(rows_number):
    return [LI1() for _ in range(rows_number)]

def main():
    K, N = MI()
    A = np.array(LI())
    A_LAST = K + A[0] - A[N - 1]
    B = A[1:] - A[: N - 1]
    B = np.sort(B)
    print(K - max(B[N - 2], A_LAST))

if __name__ == "__main__":
    main()

import sys

sys.setrecursionlimit(10**6)
int1 = lambda x: int(x) - 1
printV = lambda x: print(*x, sep="\n")
printH = lambda x: print(" ".join(map(str, x)))

def IS():
    return sys.stdin.readline()[:-1]

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

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

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

def LI1():
    return list(map(int1, sys.stdin.readline().split()))

def LII(rows_number):
    return [II() for _ in range(rows_number)]

def LLI(rows_number):
    return [LI() for _ in range(rows_number)]

def LLI1(rows_number):
    return [LI1() for _ in range(rows_number)]

def main():
    k, n = MI()
    a = LI()
    b = [0] * n
    for i in range(n):
        if i == n - 1:
            b[i] = a[0] + k - a[i]
        else:
            b[i] = a[i + 1] - a[i]
    b.sort()
    print(k - b[-1])

if __name__ == "__main__":
    main()

-import numpy as np
-    K, N = MI()
-    A = np.array(LI())
-    A_LAST = K + A[0] - A[N - 1]
-    B = A[1:] - A[: N - 1]
-    B = np.sort(B)
-    print(K - max(B[N - 2], A_LAST))
+    k, n = MI()
+    a = LI()
+    b = [0] * n
+    for i in range(n):
+        if i == n - 1:
+            b[i] = a[0] + k - a[i]
+        else:
+            b[i] = a[i + 1] - a[i]
+    b.sort()
+    print(k - b[-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 collections import defaultdict

import numpy as np

def main():

    s = eval(input())

    n = len(s)

    d = np.zeros(2019,np.int64)

    ans = 0

    num = 0

    pow10 = 1

    d[0] = 1

    for i in reversed(list(range(n))):

        pow10 = pow10 * 10 % 2019

        num += int(s[i]) * pow10

        #print(num, num % 2019, i)

        mod = num % 2019

        ans += d[mod]

        d[mod] += 1

    print(ans)

if __name__ == "__main__":

    main()

# optimized version of the same code:

from collections import defaultdict

def main():

    s = eval(input())

    n = len(s)

    ans = 0

    num = 0

    pow10 = 1

    d = defaultdict(int)

    d[0] = 1

    for i in reversed(list(range(n))):

        # pow10を10 ** (n-1-i)にしてるだけでTLEしていた

        pow10 = pow10 * 10 % 2019

        num += int(s[i]) * pow10

        mod = num % 2019

        ans += d[mod]

        d[mod] += 1

    print(ans)

if __name__ == "__main__":

    main()

from collections import defaultdict
import numpy as np

def main():
    s = eval(input())
    n = len(s)
    d = np.zeros(2019, np.int64)
    ans = 0
    num = 0
    pow10 = 1
    d[0] = 1
    for i in reversed(list(range(n))):
        pow10 = pow10 * 10 % 2019
        num += int(s[i]) * pow10
        # print(num, num % 2019, i)
        mod = num % 2019
        ans += d[mod]
        d[mod] += 1
    print(ans)

if __name__ == "__main__":
    main()

+        # pow10を10 ** (n-1-i)にしてるだけでTLEしていた


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

def myAnswer(N:int) ->int:

   ans =factorial(N)

   return ans % (10**9 + 7)

def modelAnswer():

   tmp=1

def main():

   N = int(eval(input()))

   print((myAnswer(N)))

if __name__ == '__main__':

   main()

# optimized version of the same code:

def modelAnswer(N:int) -> int:

   ans = 1

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

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

   return ans

def main():

   N = int(eval(input()))

   print((modelAnswer(N)))

if __name__ == '__main__':

   main()

from math import factorial

def myAnswer(N: int) -> int:
    ans = factorial(N)
    return ans % (10**9 + 7)

def modelAnswer():
    tmp = 1

def main():
    N = int(eval(input()))
    print((myAnswer(N)))

if __name__ == "__main__":
    main()

def modelAnswer(N: int) -> int:
    ans = 1
    for i in range(1, N + 1):
        ans = (ans * i) % (10**9 + 7)
    return ans

def main():
    N = int(eval(input()))
    print((modelAnswer(N)))

if __name__ == "__main__":
    main()

-from math import factorial
-def myAnswer(N: int) -> int:
-    ans = factorial(N)
-    return ans % (10**9 + 7)
-def modelAnswer():
-    tmp = 1
+def modelAnswer(N: int) -> int:
+    ans = 1
+    for i in range(1, N + 1):
+        ans = (ans * i) % (10**9 + 7)
+    return ans
-    print((myAnswer(N)))
+    print((modelAnswer(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

N=int(eval(input()))

a=int(np.sqrt(N))

b=float('inf')

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

    if N%i==0:

        if i+N//i<b:

            ans=i

print((ans+N//ans-2))

# optimized version of the same code:

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

import sys

from math import sqrt

sys.setrecursionlimit(10**9)

INF=10**18

MOD=10**9+7

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

def main():

    N=int(eval(input()))

    tmp=INF

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

        if N%i==0:

            tmp=min(tmp,i+N//i)

    print((tmp-2))

if __name__ == '__main__':

    main()

import numpy as np

N = int(eval(input()))
a = int(np.sqrt(N))
b = float("inf")
for i in range(1, a + 1):
    if N % i == 0:
        if i + N // i < b:
            ans = i
print((ans + N // ans - 2))

# -*- coding: utf-8 -*-
import sys
from math import sqrt

sys.setrecursionlimit(10**9)
INF = 10**18
MOD = 10**9 + 7

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

def main():
    N = int(eval(input()))
    tmp = INF
    for i in range(1, 10**6 + 1):
        if N % i == 0:
            tmp = min(tmp, i + N // i)
    print((tmp - 2))

if __name__ == "__main__":
    main()

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


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

def factorization(n):

    arr = []

    temp = n

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

        if temp % i == 0:

            cnt = 0

            while temp % i == 0:

                cnt += 1

                temp //= i

            arr.append([i, cnt])

    if temp != 1:

        arr.append([temp, 1])

    if arr == [] and n != 1:

        arr.append([n, 1])

    return arr

mod = 10**9 + 7

def cmb(n, r, mod):

    if (r < 0 or r > n):

        return 0

    r = min(r, n-r)

    return g1[n] * g2[r] * g2[n-r] % mod

g1 = [1, 1]

g2 = [1, 1]

inverse = [0, 1]

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

    g1.append((g1[-1] * i) % mod)

    inverse.append((-inverse[mod % i] * (mod//i)) % mod)

    g2.append((g2[-1] * inverse[-1]) % mod)

primes = factorization(M)

# 何箇所に分けるか（cnt以下）,その中でどう分けるか（しきりをどこにおくか（振り分けられないものが出ると選べれないのとおなじになるので、cnt - 選んだ数））

ans = 1

for p, cnt in primes:

    tmp = cmb(N+cnt-1, N-1, mod)

    ans *= tmp

    ans %= mod

print(ans)

# optimized version of the same code:

def main():

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

    def factorization(n):

        arr = []

        temp = n

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

            if temp % i == 0:

                cnt = 0

                while temp % i == 0:

                    cnt += 1

                    temp //= i

                arr.append([i, cnt])

        if temp != 1:

            arr.append([temp, 1])

        if arr == [] and n != 1:

            arr.append([n, 1])

        return arr

    mod = 10**9 + 7

    def cmb(n, r, mod):

        if (r < 0 or r > n):

            return 0

        r = min(r, n-r)

        return g1[n] * g2[r] * g2[n-r] % mod

    g1 = [1, 1]

    g2 = [1, 1]

    inverse = [0, 1]

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

        g1.append((g1[-1] * i) % mod)

        inverse.append((-inverse[mod % i] * (mod//i)) % mod)

        g2.append((g2[-1] * inverse[-1]) % mod)

    primes = factorization(M)

    # 何箇所に分けるか（cnt以下）,その中でどう分けるか（しきりをどこにおくか（振り分けられないものが出ると選べれないのとおなじになるので、cnt - 選んだ数））

    ans = 1

    for p, cnt in primes:

        tmp = cmb(N+cnt-1, N-1, mod)

        ans *= tmp

        ans %= mod

    print(ans)

main()

import math

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

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-(n**0.5) // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])
    if temp != 1:
        arr.append([temp, 1])
    if arr == [] and n != 1:
        arr.append([n, 1])
    return arr

mod = 10**9 + 7

def cmb(n, r, mod):
    if r < 0 or r > n:
        return 0
    r = min(r, n - r)
    return g1[n] * g2[r] * g2[n - r] % mod

g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]
for i in range(2, 2 * 10**5 + 1):
    g1.append((g1[-1] * i) % mod)
    inverse.append((-inverse[mod % i] * (mod // i)) % mod)
    g2.append((g2[-1] * inverse[-1]) % mod)
primes = factorization(M)
# 何箇所に分けるか（cnt以下）,その中でどう分けるか（しきりをどこにおくか（振り分けられないものが出ると選べれないのとおなじになるので、cnt - 選んだ数））
ans = 1
for p, cnt in primes:
    tmp = cmb(N + cnt - 1, N - 1, mod)
    ans *= tmp
    ans %= mod
print(ans)

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

    def factorization(n):
        arr = []
        temp = n
        for i in range(2, int(-(-(n**0.5) // 1)) + 1):
            if temp % i == 0:
                cnt = 0
                while temp % i == 0:
                    cnt += 1
                    temp //= i
                arr.append([i, cnt])
        if temp != 1:
            arr.append([temp, 1])
        if arr == [] and n != 1:
            arr.append([n, 1])
        return arr

    mod = 10**9 + 7

    def cmb(n, r, mod):
        if r < 0 or r > n:
            return 0
        r = min(r, n - r)
        return g1[n] * g2[r] * g2[n - r] % mod

    g1 = [1, 1]
    g2 = [1, 1]
    inverse = [0, 1]
    for i in range(2, N + 100 + 1):
        g1.append((g1[-1] * i) % mod)
        inverse.append((-inverse[mod % i] * (mod // i)) % mod)
        g2.append((g2[-1] * inverse[-1]) % mod)
    primes = factorization(M)
    # 何箇所に分けるか（cnt以下）,その中でどう分けるか（しきりをどこにおくか（振り分けられないものが出ると選べれないのとおなじになるので、cnt - 選んだ数））
    ans = 1
    for p, cnt in primes:
        tmp = cmb(N + cnt - 1, N - 1, mod)
        ans *= tmp
        ans %= mod
    print(ans)

main()

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

+        return g1[n] * g2[r] * g2[n - r] % mod

+        inverse.append((-inverse[mod % i] * (mod // i)) % mod)

+        g2.append((g2[-1] * inverse[-1]) % mod)

+    # 何箇所に分けるか（cnt以下）,その中でどう分けるか（しきりをどこにおくか（振り分けられないものが出ると選べれないのとおなじになるので、cnt - 選んだ数））

+        tmp = cmb(N + cnt - 1, N - 1, mod)

-    return g1[n] * g2[r] * g2[n - r] % mod

-    inverse.append((-inverse[mod % i] * (mod // i)) % mod)

-    g2.append((g2[-1] * inverse[-1]) % mod)

-# 何箇所に分けるか（cnt以下）,その中でどう分けるか（しきりをどこにおくか（振り分けられないものが出ると選べれないのとおなじになるので、cnt - 選んだ数））


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

s = input()[::-1]

while True:

    if len(s) == 0:

        break

    if s[:7] == "remaerd":

        s = s[7:]

    elif s[:6] == "resare":

        s = s[6:]

    elif s[:5] == "maerd" or s[:5] == "esare":

        s = s[5:]

    else:

        print("NO")

        exit()

print("YES")

# optimized version of the same code:

import re

s = eval(input())

if re.fullmatch(r"(dream|dreamer|erase|eraser)+", s):

    print("YES")

else:

    print("NO")

-    elif s[:5] == "maerd" or s[:5] == "esare":


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

import sys

stdin = sys.stdin

ni = lambda: int(ns())

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

ns = lambda: stdin.readline()

def Solve():

    N,K=na()

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

    l=[]

    N=len(S)

    if(S[0]==0):

        l.append(0)

    b=S[0]

    ct=1

    for i in S[1:]:

        if(b!=i):

            l.append(ct)

            ct=1

            b=i

        else:

            ct+=1

    l.append(ct)

    len_l=len(l)

    if(len_l//2 <= K):

        return sum(l)

    ans = res = sum(l[:2*K+1])

    if(len_l%2==0):

        l.append(0)

        len_l+=1

    g = K * 2 + 1

    for i in range(K*2+1,len_l-1,2):

        ans -= l[i-g] + l[i-g+1]

        ans += l[i] + l[1+i]

        if(res<ans):

            res=ans

    #print(S)

    #print(l)

    #print(len_l)

    return res

print((Solve()))

# optimized version of the same code:

import sys

stdin = sys.stdin

ni = lambda: int(ns())

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

ns = lambda: stdin.readline()

def Solve():

    N,K=na()

    S=eval(input())

    l=[]

    N=len(S)

    #print(len(S))

    if(S[0]=="0"):

        #print("00")

        l.append(0)

    t=S[0]

    ct=1

    #print("aa")

    #print(S)

    #print(S[0],S[1],S[2])

    for b in S[1:]:

        #print(b)

        if(t!=b):

            l.append(ct)

            ct=1

            t=b

        else:

            ct+=1

    #print("bb")

    l.append(ct)

    len_l=len(l)

    if(len_l//2 <= K):

        return sum(l)

    ans = res = sum(l[:2*K+1])

    if(len_l%2==0):

        l.append(0)

        len_l+=1

    g = K * 2 + 1

    for i in range(K*2+1,len_l-1,2):

        ans -= l[i-g] + l[i-g+1]

        ans += l[i] + l[1+i]

        if(res<ans):

            res=ans

    #print(S)

    #print(l)

    #print(len_l)

    return res

print((Solve()))

import sys

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

def Solve():
    N, K = na()
    S = [int(d) for d in eval(input())]
    l = []
    N = len(S)
    if S[0] == 0:
        l.append(0)
    b = S[0]
    ct = 1
    for i in S[1:]:
        if b != i:
            l.append(ct)
            ct = 1
            b = i
        else:
            ct += 1
    l.append(ct)
    len_l = len(l)
    if len_l // 2 <= K:
        return sum(l)
    ans = res = sum(l[: 2 * K + 1])
    if len_l % 2 == 0:
        l.append(0)
        len_l += 1
    g = K * 2 + 1
    for i in range(K * 2 + 1, len_l - 1, 2):
        ans -= l[i - g] + l[i - g + 1]
        ans += l[i] + l[1 + i]
        if res < ans:
            res = ans
    # print(S)
    # print(l)
    # print(len_l)
    return res

print((Solve()))

import sys

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

def Solve():
    N, K = na()
    S = eval(input())
    l = []
    N = len(S)
    # print(len(S))
    if S[0] == "0":
        # print("00")
        l.append(0)
    t = S[0]
    ct = 1
    # print("aa")
    # print(S)
    # print(S[0],S[1],S[2])
    for b in S[1:]:
        # print(b)
        if t != b:
            l.append(ct)
            ct = 1
            t = b
        else:
            ct += 1
    # print("bb")
    l.append(ct)
    len_l = len(l)
    if len_l // 2 <= K:
        return sum(l)
    ans = res = sum(l[: 2 * K + 1])
    if len_l % 2 == 0:
        l.append(0)
        len_l += 1
    g = K * 2 + 1
    for i in range(K * 2 + 1, len_l - 1, 2):
        ans -= l[i - g] + l[i - g + 1]
        ans += l[i] + l[1 + i]
        if res < ans:
            res = ans
    # print(S)
    # print(l)
    # print(len_l)
    return res

print((Solve()))

-    S = [int(d) for d in 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:

def check(x, y):

    for a, b in zip(x, y):

        if a != b and b != -1:

            return False

    else:

        return True

n = int(eval(input()))

remarks = []

cnt_max = 0

for _ in range(n):

    a = int(eval(input()))

    x = [tuple(map(int, input().split())) for i in range(a)]

    r = [-1] * n

    for i, j in x:

        r[i - 1] = j

    remarks.append(r)

for r in range(2 ** n):

    r = list(bin(r)[2:].zfill(n))

    r = [int(i) for i in r[:]]

    cnt = 0

    for i in range(n):

        if r[i] == 1:

            flag = check(r, remarks[i])

            cnt += 1

            if not flag:

                cnt = 0

                break

    cnt_max = max(cnt, cnt_max)

print(cnt_max)

# optimized version of the same code:

import numpy as np

import itertools

n = int(eval(input()))

info = []

for i in range(n):

    a = int(eval(input()))

    for _ in range(a):

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

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

a = np.array(list(itertools.product([0, 1], repeat=n)), dtype=np.bool)

for i, x, y in info:

    bl = (~a[:, i]) | (a[:, x] == bool(y))

    a = a[bl]

ans = a.sum(axis=1).max()

print(ans)

def check(x, y):
    for a, b in zip(x, y):
        if a != b and b != -1:
            return False
    else:
        return True

n = int(eval(input()))
remarks = []
cnt_max = 0
for _ in range(n):
    a = int(eval(input()))
    x = [tuple(map(int, input().split())) for i in range(a)]
    r = [-1] * n
    for i, j in x:
        r[i - 1] = j
    remarks.append(r)
for r in range(2**n):
    r = list(bin(r)[2:].zfill(n))
    r = [int(i) for i in r[:]]
    cnt = 0
    for i in range(n):
        if r[i] == 1:
            flag = check(r, remarks[i])
            cnt += 1
            if not flag:
                cnt = 0
                break
    cnt_max = max(cnt, cnt_max)
print(cnt_max)

-    x = [tuple(map(int, input().split())) for i in range(a)]

-            flag = check(r, remarks[i])

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

+a = np.array(list(itertools.product([0, 1], repeat=n)), dtype=np.bool)


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

count_target = 0

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

    str_i = str(i)

    reversed_i = ''

    for n_th_i in reversed(list(range(len(str_i)))):

        reversed_i += str_i[n_th_i]

    if str_i == reversed_i:

        count_target += 1

print(count_target)

# optimized version of the same code:

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

count_target = 0

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

    str_i = str(i)

    reversed_i = str_i[::-1]

    if str_i == reversed_i:

        count_target += 1

print(count_target)

A, B = list(map(int, input().split()))
count_target = 0
for i in range(A, B + 1):
    str_i = str(i)
    reversed_i = ""
    for n_th_i in reversed(list(range(len(str_i)))):
        reversed_i += str_i[n_th_i]
    if str_i == reversed_i:
        count_target += 1
print(count_target)

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

-    for n_th_i in reversed(list(range(len(str_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:

from collections import Counter,defaultdict,deque

import sys,bisect,math,itertools,string,queue

from heapq import heappop, heappush

sys.setrecursionlimit(10**8)

mod = 10**9+7

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

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

def inpl_str(): return list(sys.stdin.readline().split())

def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()

res = float('inf')

for i in range(1,2*10**6):

    if (n/i).is_integer():

        res = min(res, i + n/i)

print((int(res-2)))

# optimized version of the same code:

from collections import Counter,defaultdict,deque

import sys,bisect,math,itertools,string,queue

from heapq import heappop, heappush

sys.setrecursionlimit(10**8)

mod = 10**9+7

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

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

def inpl_str(): return list(sys.stdin.readline().split())

def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()

res = float('inf')

for i in range(1,int(math.sqrt(n))+1):

    if n%i == 0:

        res = min(res, i + n/i)

print((int(res-2)))

from collections import Counter, defaultdict, deque
import sys, bisect, math, itertools, string, queue
from heapq import heappop, heappush

sys.setrecursionlimit(10**8)
mod = 10**9 + 7

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

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

def inpl_str():
    return list(sys.stdin.readline().split())

def inpln(n):
    return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
res = float("inf")
for i in range(1, 2 * 10**6):
    if (n / i).is_integer():
        res = min(res, i + n / i)
print((int(res - 2)))

from collections import Counter, defaultdict, deque
import sys, bisect, math, itertools, string, queue
from heapq import heappop, heappush

sys.setrecursionlimit(10**8)
mod = 10**9 + 7

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

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

def inpl_str():
    return list(sys.stdin.readline().split())

def inpln(n):
    return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
res = float("inf")
for i in range(1, int(math.sqrt(n)) + 1):
    if n % i == 0:
        res = min(res, i + n / i)
print((int(res - 2)))

+for i in range(1, int(math.sqrt(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:

S = int(eval(input()))

dp = [0] * (S + 1)

dp[0] = 1

M = 10 ** 9 + 7

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

    num = 0

    for j in range(i - 2):

        num += dp[j]

        dp[i] = num % M

print((dp[S]))

# optimized version of the same code:

S = int(eval(input()))

def cmb(n, r, p):

    r = min(n - r, r)

    if r == 0:

        return 1

    over = 1

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

        over = over * i % p

    under = 1

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

        under = under * i % p

    inv = pow(under, p - 2, p)

    return over * inv % p

M = 10 ** 9 + 7

ans = 0

for i in range(1, S):

    if S - 3 * i < 0:

        break

    ans += cmb(S - 3 * i + i - 1, i - 1, M)

    ans %= M

print(ans)

S = int(eval(input()))
dp = [0] * (S + 1)
dp[0] = 1
M = 10**9 + 7
for i in range(1, S + 1):
    num = 0
    for j in range(i - 2):
        num += dp[j]
        dp[i] = num % M
print((dp[S]))

S = int(eval(input()))

def cmb(n, r, p):
    r = min(n - r, r)
    if r == 0:
        return 1
    over = 1
    for i in range(n, n - r, -1):
        over = over * i % p
    under = 1
    for i in range(1, r + 1):
        under = under * i % p
    inv = pow(under, p - 2, p)
    return over * inv % p

M = 10**9 + 7
ans = 0
for i in range(1, S):
    if S - 3 * i < 0:
        break
    ans += cmb(S - 3 * i + i - 1, i - 1, M)
    ans %= M
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 random, math

random.seed()

def gen(a, b, num):

    result = set()

    while 1:

        while 1:

            v = random.randint(a, b)//2*2+1

            if v not in result:

                break

        for x in range(3, int(math.sqrt(v))+1, 2):

            if v % x == 0:

                break

        else:

            result.add(v)

            if len(result) == num:

                break

    return result

class RH():

    def __init__(self, s, base, mod):

        self.base = base

        self.mod = mod

        self.rev = pow(base, mod-2, mod)

        l = len(s)

        self.h = h = [0]*(l+1)

        tmp = 0

        for i in range(l):

            num = ord(s[i])

            tmp = (tmp*base + num) % mod

            h[i+1] = tmp

    def calc(self, l, r):

        return (self.h[r] - self.h[l] * pow(self.base, r-l, self.mod)) % self.mod

    def fixed(self, length):

        v = pow(self.base, length, self.mod)

        h = self.h; mod = self.mod

        def fixed_calc(l):

            return (h[length+l] - h[l] * v) % mod

        return fixed_calc

class RRH():

    def __init__(self, s, num=10, primes=None):

        primes = primes or gen(2, 10**3, num)

        MOD = 10**9+7

        self.rhs = [RH(s, p, MOD) for p in primes]

    def calc(self, l, r):

        return [rh.calc(l, r) for rh in self.rhs]

    def fixed(self, length):

        fs = [rh.fixed(length) for rh in self.rhs]

        def multi_fixed_calc(l):

            return list(f(l) for f in fs)

        return multi_fixed_calc

T = eval(input()); P = eval(input())

primes = gen(2, 10**3, 2)

HT = RRH(T, primes=primes)

HP = RRH(P, primes=primes)

pv = HP.calc(0, len(P))

calc = HT.fixed(len(P))

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

    if calc(i) == pv:

        print(i)

# optimized version of the same code:

class RH():

    def __init__(self, s, base, mod):

        self.base = base

        self.mod = mod

        self.rev = pow(base, mod-2, mod)

        l = len(s)

        self.h = h = [0]*(l+1)

        tmp = 0

        for i in range(l):

            num = ord(s[i])

            tmp = (tmp*base + num) % mod

            h[i+1] = tmp

    def calc(self, l, r):

        return (self.h[r] - self.h[l] * pow(self.base, r-l, self.mod)) % self.mod

    def fixed(self, length):

        v = pow(self.base, length, self.mod)

        h = self.h; mod = self.mod

        def fixed_calc(l):

            return (h[length+l] - h[l] * v) % mod

        return fixed_calc

T = eval(input()); P = eval(input())

MOD = 10**18+9

HT = RH(T, 11, MOD)

HP = RH(P, 11, MOD)

pv = HP.calc(0, len(P))

calc = HT.fixed(len(P))

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

    if calc(i) == pv:

        print(i)

import random, math

random.seed()

def gen(a, b, num):
    result = set()
    while 1:
        while 1:
            v = random.randint(a, b) // 2 * 2 + 1
            if v not in result:
                break
        for x in range(3, int(math.sqrt(v)) + 1, 2):
            if v % x == 0:
                break
        else:
            result.add(v)
            if len(result) == num:
                break
    return result

class RH:
    def __init__(self, s, base, mod):
        self.base = base
        self.mod = mod
        self.rev = pow(base, mod - 2, mod)
        l = len(s)
        self.h = h = [0] * (l + 1)
        tmp = 0
        for i in range(l):
            num = ord(s[i])
            tmp = (tmp * base + num) % mod
            h[i + 1] = tmp

    def calc(self, l, r):
        return (self.h[r] - self.h[l] * pow(self.base, r - l, self.mod)) % self.mod

    def fixed(self, length):
        v = pow(self.base, length, self.mod)
        h = self.h
        mod = self.mod

        def fixed_calc(l):
            return (h[length + l] - h[l] * v) % mod

        return fixed_calc

class RRH:
    def __init__(self, s, num=10, primes=None):
        primes = primes or gen(2, 10**3, num)
        MOD = 10**9 + 7
        self.rhs = [RH(s, p, MOD) for p in primes]

    def calc(self, l, r):
        return [rh.calc(l, r) for rh in self.rhs]

    def fixed(self, length):
        fs = [rh.fixed(length) for rh in self.rhs]

        def multi_fixed_calc(l):
            return list(f(l) for f in fs)

        return multi_fixed_calc

T = eval(input())
P = eval(input())
primes = gen(2, 10**3, 2)
HT = RRH(T, primes=primes)
HP = RRH(P, primes=primes)
pv = HP.calc(0, len(P))
calc = HT.fixed(len(P))
for i in range(len(T) - len(P) + 1):
    if calc(i) == pv:
        print(i)

class RH:
    def __init__(self, s, base, mod):
        self.base = base
        self.mod = mod
        self.rev = pow(base, mod - 2, mod)
        l = len(s)
        self.h = h = [0] * (l + 1)
        tmp = 0
        for i in range(l):
            num = ord(s[i])
            tmp = (tmp * base + num) % mod
            h[i + 1] = tmp

    def calc(self, l, r):
        return (self.h[r] - self.h[l] * pow(self.base, r - l, self.mod)) % self.mod

    def fixed(self, length):
        v = pow(self.base, length, self.mod)
        h = self.h
        mod = self.mod

        def fixed_calc(l):
            return (h[length + l] - h[l] * v) % mod

        return fixed_calc

T = eval(input())
P = eval(input())
MOD = 10**18 + 9
HT = RH(T, 11, MOD)
HP = RH(P, 11, MOD)
pv = HP.calc(0, len(P))
calc = HT.fixed(len(P))
for i in range(len(T) - len(P) + 1):
    if calc(i) == pv:
        print(i)

-            v = random.randint(a, b) // 2 * 2 + 1

-        for x in range(3, int(math.sqrt(v)) + 1, 2):

-    def __init__(self, s, num=10, primes=None):

-        primes = primes or gen(2, 10**3, num)

-        self.rhs = [RH(s, p, MOD) for p in primes]

-        return [rh.calc(l, r) for rh in self.rhs]

-        fs = [rh.fixed(length) for rh in self.rhs]

-            return list(f(l) for f in fs)


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

import numpy as np

N = int(eval(input()))

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

for i in range(N):

    A = int(eval(input()))

    temp = []

    for _ in range(A):

        temp.append([str(x) for x in input().split()])

        S[i] = temp

ans = 0

for i in range(2 ** N - 1, -1,-1):

    biti = list(bin(i)[2:].zfill(N))

    flag = 0

    for j in range(N):

        if biti[j] == "1":

            for k in S[j]:

                if biti[int(k[0])-1] != k[1]:

                    flag = 1

                    break

        if flag:

            break

    if not flag:

        biti = np.array(biti)

        ans = max(ans, np.count_nonzero(biti == "1"))

print(ans)

# optimized version of the same code:

import sys

input = sys.stdin.readline

n = int(eval(input()))

from collections import defaultdict

d = defaultdict(list)

for i in range(n):

    a = int(eval(input()))

    for _ in range(a):

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

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

ans = 0

for k in range(2**n):

    res = 0

    j = bin(k)[2:].zfill(n)

    flag = 1

    for i in range(n):

        if j[i] == "0":

            continue

        for x, y in d[i]:

            if int(j[x]) != int(y):

                flag = 0

                break

        res += 1

    if flag:

        ans = max(ans, res)

print(ans)

import sys

input = sys.stdin.readline
import numpy as np

N = int(eval(input()))
S = [[] for _ in range(N)]
for i in range(N):
    A = int(eval(input()))
    temp = []
    for _ in range(A):
        temp.append([str(x) for x in input().split()])
        S[i] = temp
ans = 0
for i in range(2**N - 1, -1, -1):
    biti = list(bin(i)[2:].zfill(N))
    flag = 0
    for j in range(N):
        if biti[j] == "1":
            for k in S[j]:
                if biti[int(k[0]) - 1] != k[1]:
                    flag = 1
                    break
        if flag:
            break
    if not flag:
        biti = np.array(biti)
        ans = max(ans, np.count_nonzero(biti == "1"))
print(ans)

-        temp.append([str(x) for x in input().split()])

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

-        ans = max(ans, np.count_nonzero(biti == "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:

#!/usr/bin/python3

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

import numpy as np

N = int(eval(input()))

prev_dst = [0,0,0]

for n in range(N):

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

    a = (t - prev_dst[0]) - (np.abs(prev_dst[1]-x) + np.abs(prev_dst[2]-y))

    if a >= 0 and a % 2 == 0:

        prev_dst = [t, x, y]

    else:

        print("No")

        exit(0)

print("Yes")

# optimized version of the same code:

#!/usr/bin/python3

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

N = int(eval(input()))

prev_dst = [0,0,0]

for n in range(N):

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

    a = (t - prev_dst[0]) - (abs(prev_dst[1]-x) + abs(prev_dst[2]-y))

    if a >= 0 and a % 2 == 0:

        prev_dst = [t, x, y]

    else:

        print("No")

        exit(0)

print("Yes")

#!/usr/bin/python3
# -*- coding: utf-8 -*-
import numpy as np

N = int(eval(input()))
prev_dst = [0, 0, 0]
for n in range(N):
    t, x, y = list(map(int, input().split(" ")))
    a = (t - prev_dst[0]) - (np.abs(prev_dst[1] - x) + np.abs(prev_dst[2] - y))
    if a >= 0 and a % 2 == 0:
        prev_dst = [t, x, y]
    else:
        print("No")
        exit(0)
print("Yes")

#!/usr/bin/python3
# -*- coding: utf-8 -*-
N = int(eval(input()))
prev_dst = [0, 0, 0]
for n in range(N):
    t, x, y = list(map(int, input().split(" ")))
    a = (t - prev_dst[0]) - (abs(prev_dst[1] - x) + abs(prev_dst[2] - y))
    if a >= 0 and a % 2 == 0:
        prev_dst = [t, x, y]
    else:
        print("No")
        exit(0)
print("Yes")

-    a = (t - prev_dst[0]) - (np.abs(prev_dst[1] - x) + np.abs(prev_dst[2] - y))

+    a = (t - prev_dst[0]) - (abs(prev_dst[1] - x) + abs(prev_dst[2] - y))


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

import numpy as np

N = int(eval(input()))

X = np.array(list(int(x) for x in input().split()))

m = round(np.mean(X))

print((int(sum((X-m)**2))))

# optimized version of the same code:

N = int(eval(input()))

X = list(int(x) for x in input().split())

p = round(sum(X)/len(X))

ans = 0

for i in range(N):

    ans += (X[i] - p)**2

print(ans)

import numpy as np

N = int(eval(input()))
X = np.array(list(int(x) for x in input().split()))
m = round(np.mean(X))
print((int(sum((X - m) ** 2))))

N = int(eval(input()))
X = list(int(x) for x in input().split())
p = round(sum(X) / len(X))
ans = 0
for i in range(N):
    ans += (X[i] - p) ** 2
print(ans)

-X = np.array(list(int(x) for x in input().split()))

+X = list(int(x) for x in input().split())


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

a = int(eval(input()))

h = int(a / 3600)

m = int((a - h * 3600) / 60)

s = int(a - h * 3600 - m * 60)

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

# optimized version of the same code:


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

n = int(eval(input()))

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

ans = list(range(n))

for i in range(n):

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

print((' '.join(map(str,ans))))

# optimized version of the same code:

def main():

    N = int(eval(input()))

    A = list(int(x) for x in input().split())

    ans = [0] * N

    for i, a in enumerate(A):

        ans[a-1] = i+1

    print((' '.join(map(str, ans))))

if __name__ == '__main__':

    main()

n = int(eval(input()))
a = [int(x) for x in input().split()]
ans = list(range(n))
for i in range(n):
    ans[a[i] - 1] = i + 1
print((" ".join(map(str, ans))))

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

if __name__ == "__main__":
    main()

+    A = list(int(x) for x in input().split())


Input:
# slower version:

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

# optimized version of the same code:

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

# slower version:

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

cnt = 0

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

    s = str(x)

    l = len(s)

    flg = True

    for i in range(l // 2):

        if s[i] != s[l - 1 - i]:

            flg = False

            break

    if flg:

        cnt += 1

print(cnt)

# optimized version of the same code:

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

cnt = 0

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

    s = str(i)

    if s[0] == s[4] and s[1] == s[3]:

        cnt += 1

print(cnt)

-for x in range(a, b + 1):
-    s = str(x)
-    l = len(s)
-    flg = True
-    for i in range(l // 2):
-        if s[i] != s[l - 1 - i]:
-            flg = False
-            break
-    if flg:
+for i in range(a, b + 1):
+    s = str(i)
+    if s[0] == s[4] and s[1] == s[3]: