N = 10000
MOD = 10 ** 10
comb = [[0] * (N+1) for _ in range(N+1)]
%%time
comb[0][0] = 1
for n in range(1,N+1):
comb[n][0] = 1
for k in range(1,N+1):
comb[n][k] = (comb[n-1][k-1] + comb[n-1][k]) % MOD
[comb[n][:n+1] for n in range(10)]