mod = 10 ** 9 + 7 #行列ライブラリ class Matrix: def __init__(self, n, m, mat=None): self.n = n self.m = m self.mat = [[0] * self.m for i in range(self.n)] if mat: for i in range(self.n): self.mat[i] = mat[i] def __getitem__(self, key): if isinstance(key, slice): return self.mat[key] else: assert key >= 0 return self.mat[key] def id(n): res = Matrix(n, n) for i in range(n): res[i][i] = 1 return res def __len__(self): return len(self.mat) def __str__(self): return "\n".join(" ".join(map(str, self[i])) for i in range(self.n)) def times(self, k): res = [[0] * self.m for i in range(self.n)] for i in range(self.n): for j in range(self.m): res[i][j] = k * self[i][j] % mod return Matrix(self.n, self.m, res) def __pos__(self): return self def __neg__(self): return self.times(-1) def __add__(self, other): res = [[0] * self.m for i in range(self.n)] for i in range(self.n): for j in range(self.m): res[i][j] = (self[i][j] + other[i][j]) % mod return Matrix(self.n, self.m, res) def __sub__(self, other): res = [[0] * self.m for i in range(self.n)] for i in range(self.n): for j in range(self.m): res[i][j] = (self[i][j] - other[i][j]) % mod return Matrix(self.n, self.m, res) def __mul__(self, other): if other.__class__ == Matrix: res = [[0] * other.m for i in range(self.n)] for i in range(self.n): for k in range(self.m): for j in range(other.m): res[i][j] += self[i][k] * other[k][j] res[i][j] %= mod return Matrix(self.n, other.m, res) else: return self.times(other) def __rmul__(self, other): return self.times(other) def __pow__(self, k): tmp = Matrix(self.n, self.n, self.mat) res = Matrix.id(self.n) while k: if k & 1: res *= tmp tmp *= tmp k >>= 1 return res #入力 n, k, l = map(int, input().split()) #隣接行列の構築 G = [[0] * n for i in range(n)] for i in range(n): for j in range(1, l + 1): G[i][(i + j) % n] = 1 G = Matrix(n, n, G) G **= k for i in range(n): print(G[0][i])