Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import numpy as np

MOD = 10**9 + 7
s = input()
count = np.zeros(13, dtype = int)
count[0] = 1
for i in range(1, len(s) + 1):
    if s[-i] != "?":
        div = (int(s[-i]) * 10 ** (i - 1)) % 13
        count = np.concatenate([count[-div:], count[:-div]], 0)
    else:
        new = np.copy(count)
        for j in range(1, 10):
            div = (j * (10 ** (i - 1))) % 13
            new += np.concatenate([count[-div:], count[:-div]], 0)
        count = np.copy(new)
    count %= MOD
print(count[5])

### FIXED CODE ###

from copy import copy

MOD = 10**9 + 7
s = input()
count = [0 for _ in range(13)]
count[0] = 1
for i in range(len(s)):
    new = [0 for _ in range(13)]
    for m in range(13):
        new[(m * 10) % 13] = count[m]
    count = new
    if s[i] != "?":
        div = int(s[i])
        count = count[-div:] +  count[:-div]
    else:
        new = [0 for _ in range(13)]
        pre = sum(count[:3])
        SUM = sum(count) % MOD
        for j in range(13):
            pre += count[(j+3) % 13]
            pre -= count[j % 13]
            new[j] = (SUM - pre) % MOD
        count = new
print(count[5])
### BUGGY CODE ###

# -*- coding: utf-8 -*-
V,E,r = map(int,raw_input().split())
edges = [[] for i in range(V)]

for i in xrange(E):
	(a,b,w) = map(int,raw_input().split())
	edges[a].append({'to':b,'weight':w})

INF = 2000000000

distance = [INF] * V	# A??????????????¢
visited = [False] * V	# ??????????¨??????????????????????

distance[r] = 0
for i in range(V):
	min_v = -1
	for v in range(V):
		if not visited[v] and (min_v == -1 or distance[v] < distance[min_v]):
			min_v = v
	visited[min_v] = True
	for e in edges[min_v]:
		distance[e['to']] = min(distance[min_v] + e['weight'],distance[e['to']])

for d in distance:
	print 'INF' if d == INF else d

### FIXED CODE ###

# -*- coding: utf-8 -*-
import Queue
INF = 10000000000000000

# ?¨??????\???????????\????????¢?????§????????????
# |V| |E|
# ai bi wi
V,E,r = map(int,raw_input().split())
edges = [[] for i in range(V)]	# ??£??\?????????

for i in xrange(E):
	a,b,w = map(int,raw_input().split())
	edges[a].append({'to':b,'weight':w})
	# edges[b].append({'to':a,'weight':w})

distance = [INF] * V
visited = [False] * V

distance[r] = 0
pq = Queue.PriorityQueue()
pq.put((0,r))
while not pq.empty():
	d,v = pq.get()
	visited[v] = True
	for e in edges[v]:
		if visited[e['to']] or distance[v]+e['weight'] > distance[e['to']]: continue
		distance[e['to']] = distance[v] + e['weight']
		pq.put((d+e['weight'],e['to']))

for d in distance:
	if d >= INF:
		print "INF"
	else:
		print d

# for i in range(V):
# 	min_v = -1
# 	for v in range(V):
# 		if not visited[v] and (min_v == -1 or distance[v] < distance[min_v]):
# 			min_v = v

# 	visited[min_v] = True
# 	for e in edges[min_v]:
# 		distance[e['to']] = min(distance[min_v] + e['weight'],distance[e['to']])

# for d in distance:
# 	if d >= INF:
# 		print "INF"
# 	else:
# 		print d
### BUGGY CODE ###

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

for i in range(n):
    print(A.count(i+1))

### FIXED CODE ###

n = int(input())
A = [int(x) for x in input().split()]
ans = [0] * n

for i in range(n-1):
    ans[A[i] - 1] += 1

for i in range(n):
    print(ans[i])
### BUGGY CODE ###

N,W = [int(x) for x in input().split()]
l = []
for i in range(N):
    l.append([int(x) for x in input().split()])
DP = [[0 for i in range(W+1)] for j in range(N+1)]
for i in range(1,W+1):
    for j in range(1,N+1):
        if l[j-1][0] > i:
            DP[j][i] = DP[j-1][i]
        else:
            DP[j][i] = max(DP[j-1][i],DP[j-1][i-l[j-1][0]]+l[j-1][1])
print(DP[N][W])

### FIXED CODE ###

N,w = [int(x) for x in input().split()]
ll = []
for i in range(N):
    abc = [int(x) for x in input().split()]
    ll.append(abc)
DP = [[0]*(w+1) for i in range(N+1)]
for i in range(1,N+1):
    for j in range(1,w+1):
        if ll[i-1][0] <= j:
            DP[i][j] = max(DP[i-1][j-ll[i-1][0]]+ll[i-1][1],DP[i-1][j])
        else:
            DP[i][j] = DP[i-1][j]
print(DP[N][w])
### BUGGY CODE ###

import numpy as np

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


#
#for i in range(N):
#    Sum[i] = Sum[i-1] + A[i]

count = 0
S = np.zeros(N)


for i in range(N):
    for j in range(i+1):
        S[j] = S[j] + A[i]
        if S[j] == 0:
            count += 1
#    Sum[i] = A[i]
#    S = A[i]
#    if S == 0:
#        count += 1
#    for j in range(i+1, N):
#        S += A[j]
#        if S == 0:
#            count += 1
            
print(count)

### FIXED CODE ###

import math

N = int(input())

a = list(map(int, input().split()))
b = [a[0] for i in range(N)]

for i in range(1, N):
    b[i] = b[i-1] + a[i]
    
b.sort()
c = 1
ans = 0

def P(n, r):
    return math.factorial(n)//math.factorial(n-r)   

def C(n, r):
    return P(n, r)//math.factorial(r)

if N==1:
    if b[0]==0:
        print(1)
    else:
        print(0)
else:
    for i in range(1, N):
        if b[i]==b[i-1]:
            c = c+1
        else:
            if c>1:
                ans = ans + C(c, 2)
            if b[i-1]==0:
                ans = ans + c
            c=1
    else:
        if c>1:
            ans = ans + C(c, 2)
        if b[i-1]==0:
            ans = ans + c
    
    print(ans)
### BUGGY CODE ###

#!/usr/bin/env python

from collections import deque
import itertools as it
import sys

sys.setrecursionlimit(1000000)

while True:
    S_ = raw_input()
    if S_ == '.':
        break

    ans = 0
    for p, q, r in it.product([0, 1, 2], repeat = 3):
        S = S_
        S = S.replace("P", str(p)).replace("Q", str(q)).replace("R", str(r))

        for loop in range(100):
            S = S.replace("-0", "2")
            S = S.replace("-1", "1")
            S = S.replace("-2", "0")
            for a, b in it.product([0, 1, 2], repeat = 2):
                S = S.replace("(%d*%d)" % (a, b), str(min(a, b)))
                S = S.replace("(%d+%d)" % (a, b), str(max(a, b)))
            
        if S == "2":
            ans += 1
    print ans


### FIXED CODE ###

#!/usr/bin/env python

from collections import deque
import itertools as it
import sys

sys.setrecursionlimit(1000000)

while True:
    S_ = raw_input()
    if S_ == '.':
        break

    ans = 0
    for p, q, r in it.product([0, 1, 2], repeat = 3):
        S = S_
        S = S.replace("P", str(p)).replace("Q", str(q)).replace("R", str(r))

        while len(S) != 1:
            S = S.replace("-0", "2")
            S = S.replace("-1", "1")
            S = S.replace("-2", "0")
            for a, b in it.product([0, 1, 2], repeat = 2):
                S = S.replace("(%d*%d)" % (a, b), str(min(a, b)))
                S = S.replace("(%d+%d)" % (a, b), str(max(a, b)))
            
        if S == "2":
            ans += 1
    print ans
### BUGGY CODE ###

n=int(input())
list1=list(map(int,input().split()))
list2=[i for i in list1 if i<=list1[0]]
ln=[list1[0]]
for i in list2:
    if min(ln)>=i:
        ln.append(i)
print(len(ln)-1)

### FIXED CODE ###

n=int(input())
list1=list(map(int,input().split()))
mi=list1[0]
c=0
for i in list1:
    if mi>=i:
        mi=i
        c+=1
print(c)
### BUGGY CODE ###

n = int(input())
s = input()

def cntchg(s,i):
  cnt = 0
  for j in range(0,i):
    if s[j] == 'W':
      cnt += 1
  for j in range(i+1,len(s)):
    if s[j] == 'E':
      cnt += 1
  return cnt
low = n
for i in range(n):
  if low > cntchg(s,i):
    low = cntchg(s,i)
print(low)

### FIXED CODE ###

n = int(input())
s = input()

cnt = s[1:].count('E')
low = cnt
for i in range(n-1):
  if s[i] == 'W':
    cnt += 1
  if s[i+1] == 'E':
    cnt -= 1
  if cnt < low:
    low = cnt
print(low)
### BUGGY CODE ###

n,m=map(int,input().split())
a=m//n
while True:
  if m/a==int(m/a):
    print(a)
    exit()
  a-=1
  

### FIXED CODE ###

n,m=map(int,input().split())
a=m//n
while True:
  if m/a==int(m/a):
    print(a)
    exit()
  a-=1
### BUGGY CODE ###

X, Y, Z, K = list(map(int, input().split()))
A_list = list(map(int, input().split()))
B_list = list(map(int, input().split()))
C_list = list(map(int, input().split()))

A_list.sort(reverse=True)
B_list.sort(reverse=True)
C_list.sort(reverse=True)

class Value():
  def __init__(self, A_list, B_list, C_list, a_idx, b_idx, c_idx):
    self.A = A_list[a_idx]
    self.B = B_list[b_idx]
    self.C = C_list[c_idx]
    self.a_idx = a_idx
    self.b_idx = b_idx
    self.c_idx = c_idx
    self.value = self.A + self.B + self.C
  def __eq__(self, other):
    return self.a_idx == other.a_idx and self.b_idx == other.b_idx and self.c_idx == other.c_idx
  def __gt__(self, other):
    return self.value > other.value
  def __ge__(self, other):
    return self.value >= other.value
    
que = []
que.append(Value(A_list, B_list, C_list, 0, 0, 0))

for _ in range(K):
  if que:
    v = que.pop(0)
    print(v.value)
  new_v_list = []
  if v.a_idx < X - 1:
    new_v = Value(A_list, B_list, C_list, v.a_idx + 1, v.b_idx, v.c_idx)
    if not new_v in que: 
      que.append(new_v)
  if v.b_idx < Y - 1:
    new_v = Value(A_list, B_list, C_list, v.a_idx, v.b_idx + 1, v.c_idx)
    if not new_v in que:
      que.append(new_v)
  if v.c_idx < Z - 1:
    new_v = Value(A_list, B_list, C_list, v.a_idx, v.b_idx, v.c_idx + 1)
    if not new_v in que:
      que.append(new_v)
  que.sort(key=lambda x: x.value, reverse=True)

### FIXED CODE ###

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

A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

from heapq import heapify, heappop, heappush, heappushpop
 
 
class PriorityQueue:
    def __init__(self, heap):
        '''
        heap ... list
        '''
        self.heap = heap
        heapify(self.heap)
 
    def push(self, item):
        heappush(self.heap, item)
 
    def pop(self):
        return heappop(self.heap)
 
    def pushpop(self, item):
        return heappushpop(self.heap, item)
 
    def __call__(self):
        return self.heap
 
 
heap = []  # ヒープといっても順序を工夫したただのリスト
 
q = PriorityQueue(heap)
q.push((-(A[0] + B[0] + C[0]), 0, 0, 0))
 
considered = set()
ans = []
for k_th in range(1, K+1):
    heap_max, i, j, k = q.pop()
    ans.append(-heap_max)
    for di, dj, dk in zip([1, 0, 0], [0, 1, 0], [0, 0, 1]):
        i_new, j_new, k_new = i + di, j + dj, k + dk
        if i_new >= X or j_new >= Y or k_new >= Z:
            continue
        if (i_new, j_new, k_new) in considered:
            continue
        considered.add((i_new, j_new, k_new))
        q.push((-(A[i_new] + B[j_new] + C[k_new]), i_new, j_new, k_new))
 
 
print(*ans, sep='\n')
### BUGGY CODE ###

"""
明らかに無理→最小が2つ無い or 最小同士がペアになってない
(最小から接続する頂点に最小がない)

満たしてる→最小の辺を置いちゃおう
小さい奴からGreedyに置いてく？

自分の周りにendしてるやつ or 大きさが同じやつがあったら繋げちゃう
そのとき白黒はどうでも良さそう？

"""
import sys

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

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

dic = {}

for i in range(M):

    U,V = map(int,input().split())
    U -= 1
    V -= 1

    if U not in dic:
        dic[U] = []
    if V not in dic:
        dic[V] = []

    dic[U].append([V,i])
    dic[V].append([U,i])

end = [False] * N
color = [0] * N
q = []
ans = [10**9] * M

for i in range(N):
    q.append([D[i],i])
q.sort()
#print (q)

for i in range(N):
    if end[q[i][1]]:
        continue
    flag = False
    for vi in dic[q[i][1]]:
        nexv = vi[0]
        mind = vi[1]
        nowd = q[i][0]
        nowp = q[i][1]
        #print (vi,q[i])

        if end[nexv]:
            flag = True
            color[nowp] = color[nexv] ^ 1
            end[nowp] = True
            ans[mind] = nowd
            break
        elif D[nexv] == nowd:
            
            flag = True
            color[nowp] = color[nexv] ^ 1
            end[nowp] = True
            end[nexv] = True
            ans[mind] = nowd
            break
    #print (ans)

    if not flag:
        print (-1)
        sys.exit()


S = ""
for i in color:
    if i == 0:
        S += "B"
    else:
        S += "W"

print (S)

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

### FIXED CODE ###

"""
明らかに無理→最小が2つ無い or 最小同士がペアになってない
(最小から接続する頂点に最小がない)

満たしてる→最小の辺を置いちゃおう
小さい奴からGreedyに置いてく？

自分の周りにendしてるやつ or 大きさが同じやつがあったら繋げちゃう
そのとき白黒はどうでも良さそう？

"""
import sys

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

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

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

for i in range(M):

    U,V = map(int,input().split())
    U -= 1
    V -= 1

    if len(dic2[U]) == 0 or dic2[U][0][0] > D[V]:
        dic2[U] = []
        dic2[U].append([D[V],V,i])
    if len(dic2[V]) == 0 or dic2[V][0][0] > D[U]:
        dic2[V] = []
        dic2[V].append([D[U],U,i])


dic = [[] for i in range(N)]
for i in range(N):
    for j in dic2[i]:
        dic[i].append([j[1],j[2]])

#print (dic)

end = [False] * N
color = [0] * N
q = []
ans = [10**9] * M

for i in range(N):
    q.append([D[i],i])
q.sort()
#print (q)

for i in range(N):
    if end[q[i][1]]:
        continue
    flag = False
    for vi in dic[q[i][1]]:
        nexv = vi[0]
        mind = vi[1]
        nowd = q[i][0]
        nowp = q[i][1]
        #print (vi,q[i])

        if end[nexv]:
            flag = True
            color[nowp] = color[nexv] ^ 1
            end[nowp] = True
            ans[mind] = nowd
            break
        elif D[nexv] == nowd:
            
            flag = True
            color[nowp] = color[nexv] ^ 1
            end[nowp] = True
            end[nexv] = True
            ans[mind] = nowd
            break
        break
    #print (ans)

    if not flag:
        print (-1)
        sys.exit()


S = []
for i in color:
    if i == 0:
        S.append("B")
    else:
        S.append("W")

print ("".join(S))

print (" ".join(map(str,ans)))
### BUGGY CODE ###

m = 10**9 + 7
n = int(input())
a = list(map(int, input().split()))
check = 0
for i in set(a):
  if n%2 == 1:
    if i == 0 and a.count(i) == 1:
      pass
    elif i%2 == 0 and a.count(i) == 2:
      pass
    else:
      print(0)
      exit()
  else:
    if i%2 == 1 and a.count(i) == 2:
      pass
    else:
      print(0)
      exit()

print(2**(n//2)%m)

### FIXED CODE ###

m = 10**9+7
n = int(input())
a = list(map(int, input().split()))
check = True
if n%2 == 0:
    if 0 in a or len(set(a)) != n//2:
      check = False
else:
    if len([0 for i in a if i==0]) != 1 or len(set(a)) != n//2+1:
      check = False
      
if check:
  print(2**(n//2)%m)
else:
  print(0)
### BUGGY CODE ###

def parent(n):
    return (n+1)/2-1

def left(n):
    return (n+1)*2-1

def right(n):
    return (n+1)*2

def max_heapify(A, i):
    global pt
    l = left(i)
    r = right(i)
    largest = i
    if l <= pt and A[largest] < A[l]:
        largest = l
    if r <= pt and A[largest] < A[r]:
        largest = r

    if largest != i:
        A[largest],A[i] = A[i],A[largest]
        max_heapify(A,largest)

def build_max_heap(A):
    for i in reversed(xrange((len(A)-1)/2+1)):
        max_heapify(A,i)

heap = [0]*2000000
pt = -1
while True:
    c = raw_input()
    if c[0] == 'i':
        n = int(c[7:])
        pt += 1
        heap[pt] = n
        i = pt
        p = (i+1)/2-1
        while p >= 0 and heap[p] < heap[i]:
            heap[p],heap[i] = heap[i],heap[p]
            i = p
            p = (i+1)/2-1
    elif c[1] == 'x':
        ret = heap[0]
        heap[0] = heap[pt]
        pt -= 1
        max_heapify(heap,0)
        print ret
    else:
        break

### FIXED CODE ###

from sys import stdin

def max_heapify(A, i):
    l = i*2
    r = i*2+1
    largest = i
    if l <= A[0] and A[i] < A[l]:
        largest = l
    else:
        largest = i
    if r <= A[0] and A[largest] < A[r]:
        largest = r

    if largest != i:
        A[largest],A[i] = A[i],A[largest]
        max_heapify(A,largest)

heap = [0]*2000000
for c in stdin:
    if c[0] == 'i':
        heap[0] += 1
        heap[heap[0]] = int(c[7:])
        i = heap[0]
        p = i/2
        while p > 0 and heap[p] < heap[i]:
            heap[p],heap[i] = heap[i],heap[p]
            i = p
            p = i/2
    elif c[1] == 'x':
        print heap[1]
        heap[1] = heap[heap[0]]
        heap[0] -= 1
        max_heapify(heap,1)
    else:
        break
### BUGGY CODE ###

import sys

input = sys.stdin.readline
n = int(input())
sl = list(input())[:-1]

q = int(input())
kl = list(map(int,input().split()))

for k in kl:
    # i文字目までのdとmとdmの数
    d = m = dm = ans = 0
    for i in range(n):
        if i - k >= 0:
            if sl[i-k] == "D":
                d -= 1
                dm -= m
            if sl[i-k] == "M":
                m -= 1
        if sl[i] == "D":
            d += 1
        if sl[i] == "M":
            m += 1
            dm += d
        if sl[i] == "C":
            ans += dm

    print(ans)









### FIXED CODE ###

import sys
input = sys.stdin.readline

def main():
    N = int(input())
    S = input()
    Q = int(input())
    x = tuple(map(int,input().split()))
    for k in x:
        d,m,dm,dmc = 0,0,0,0
        for i in range(N):
            if S[i] == "D":
                d += 1
            elif S[i] == "M":
                m += 1
                dm += d
            elif S[i] == "C":
                dmc += dm
            if i >= k-1:
                if S[i-k+1] == "D":
                    dm -= m
                    d -= 1
                elif S[i-k+1] == "M":
                    m -= 1
        print(dmc)
    
if __name__ == "__main__":
    main()
### BUGGY CODE ###

def is_prime(t):
  i=2
  while i**2<=t:
    if t%i==0:
      return 0
    i+=1
  return 1
q=int(input())
lr=[list(map(int,input().split())) for _ in range(q)]
n=10**5
p=[0]*(n+1)
d=[]
for i in range(2,n):
  if is_prime(i):
    d.append(i)
  if i in d and (i+1)//2 in d:
    p[i]=p[i-1]+1
  else:
    p[i]=p[i-1]
for l,r in lr:
  print(p[r]-p[l-1])



### FIXED CODE ###

def is_prime(t):
  i=2
  while i**2<=t:
    if t%i==0:
      return 0
    i+=1
  return 1
q=int(input())
lr=[list(map(int,input().split())) for _ in range(q)]
n=10**5
p=[0]*(n+1)
d=set([])
for i in range(2,n):
  if is_prime(i):
    d.add(i)
  if i in d and (i+1)//2 in d:
    p[i]=p[i-1]+1
  else:
    p[i]=p[i-1]
for l,r in lr:
  print(p[r]-p[l-1])
### BUGGY CODE ###

#!/usr/bin/env python

from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(10000000)

m = [[-1] * 2001 for i in range(4001)]

def f():
    K, N = map(int, raw_input().split())
    MOD = 998244353

    def comb(n, k):
        if n < 0 or k < 0:
            return 0
        if n == k or k == 0:
            return 1
        if m[n][k] < 0:
            m[n][k] = (comb(n - 1, k) + comb(n - 1, k - 1)) % MOD
        return m[n][k]

    m2 = {}
    def p2(n):
        if n == 0:
            return 1
        if not n in m2:
            m2[n] = (p2(n - 1) * 2) % MOD
        return m2[n]

    ls = []
    for i in range(2, K + 2):
        ans = 0
        if i % 2 == 0:
            rem = i / 2 - 1
            for j in range(rem + 1):
                ans += comb(N + K - 2 - rem * 2, K - 2 - rem * 2 + j) \
                * comb(rem, j) * p2(j)
                ans += comb(N + K - 3 - rem * 2, K - 2 - rem * 2 + j) \
                * comb(rem, j) * p2(j)
                ans %= MOD
        else:
            rem = i / 2
            for j in range(rem + 1):
                ans += comb(N + K - 1 - rem * 2, K - 1 - rem * 2 + j) \
                * comb(rem, j) * p2(j)
                ans %= MOD
        ls.append(ans % MOD)

    ls += ls[:-1][::-1]

    for num in ls:
        print num

f()


### FIXED CODE ###

#!/usr/bin/env python

from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(10000000)

m = [[0] * 2005 for i in range(4005)]

def f():
    K, N = map(int, raw_input().split())
    MOD = 998244353

    for i in range(4001):
        m[i][0] = 1
    for i in range(2001):
        m[i][i] = 1
    for i in range(1, 4001):
        for j in range(1, 2001):
            m[i][j] = (m[i - 1][j] + m[i - 1][j - 1]) % MOD

    m2 = [1] * 4005
    for i in range(1, 4001):
        m2[i] = (m2[i - 1] * 2) % MOD

    ls = []
    for i in range(2, K + 2):
        ans = 0
        if i % 2 == 0:
            rem = i / 2 - 1
            for j in range(rem + 1):
                ans += m[N + K - 2 - rem * 2][K - 2 - rem * 2 + j] \
                * m[rem][j] * m2[j]
                ans += m[N + K - 3 - rem * 2][K - 2 - rem * 2 + j] \
                * m[rem][j] * m2[j]
                ans %= MOD
        else:
            rem = i / 2
            for j in range(rem + 1):
                ans += m[N + K - 1 - rem * 2][K - 1 - rem * 2 + j] \
                * m[rem][j] * m2[j]
                ans %= MOD
        ls.append(ans % MOD)

    ls += ls[:-1][::-1]

    for num in ls:
        print num

f()
### BUGGY CODE ###

N,K = map(int,input().split())
gcddic = {}
for i in range(K,0,-1):
    gcddic[i] = (K//(i))**N
    ll=2
    while(ll*i<=K):
        gcddic[i] -= gcddic[ll*(i)]
        ll += 1
sumnation = 0
for i,l in gcddic.items():
    sumnation += i*l
print(sumnation%(10**9+7))

### FIXED CODE ###

N,K = map(int,input().split())
gcddic = {}
mod_n = (10**9+7)
for i in range(K,0,-1):
    x = pow((K//i),N,mod_n)
    ll=2
    while(ll*i<=K):
        x -= gcddic[ll*(i)]
        ll += 1
    gcddic[i] = x
sumnation = 0
for i,l in gcddic.items():
    sumnation += i*l
print(sumnation%mod_n)
### BUGGY CODE ###

import numpy as np

n = int(input())

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

ans_list = []

kake = [1*(-1)**x for x in range(n)]
ans_list = [0 for x in range(n)]
kake_temp = kake
for i in range(n):
  ans = 0
  #print(kake_temp)
  ans = int(np.dot(dams, np.array(kake_temp)))
  ans_list[i] = str(ans)
  
  kake_temp = [kake_temp[-1]] + kake_temp[0 : n - 1]
    
print(" ".join(ans_list))
  

### FIXED CODE ###

n = int(input())

dams = list(map(int, input().split()))
ans_list = [0 for x in range(n)]

ans_list[0] = sum([dams[x]*(-1)**x for x in range(n)])

for i in range(1, n):
  ans_list[i] = -ans_list[i-1] + 2 * dams[i - 1]

print(" ".join(list(map(str, ans_list))))

#print(*ans_list)
### BUGGY CODE ###

def factorial(n):
    ans = 1
    for i in range(1, n+1):
        ans = ans * i

    return ans

def combination(n, r):
    #print(factorial(n) // (factorial(n-r) * factorial(r)))
    return factorial(n) // (factorial(n-r) * factorial(r))

def get_ans(N, K, i):
    #if K-1<i:
    #    return 0
    #else:
    return(combination(N-K+1, i) * combination(K-1, i-1))

N, K = tuple(map(int, input().split()))
for i in range(1, K+1):
    ans = get_ans(N, K, i)
    print(ans%(10**9+7))


### FIXED CODE ###

def factorial(n):
    ans = 1
    for i in range(1, n+1):
        ans = ans * i

    return ans

def combination(n, r):
    #print(factorial(n) // (factorial(n-r) * factorial(r)))
    return factorial(n) // (factorial(n-r) * factorial(r))

def get_ans(N, K, i):
    if N-K+1<i:
        return 0
    else:
        return(combination(N-K+1, i) * combination(K-1, i-1))

N, K = tuple(map(int, input().split()))
for i in range(1, K+1):
    ans = get_ans(N, K, i)
    print(ans%(10**9+7))