const MOD: usize = 1e9 as usize + 7; fn main() { let mut nkl = String::new(); std::io::stdin().read_line(&mut nkl).ok(); let nkl: Vec = nkl.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let n = nkl[0]; let k = nkl[1]; let l = nkl[2]; let mut dp = vec![0usize; n]; dp[0] = 1; for _ in 0..k { let mut next_dp = vec![0usize; n]; for j in 0..n { if dp[j] == 0 { continue; } let start = j+1; let end = j+l+1; if l == n { next_dp[0] += dp[j]; continue; } let start = if start >= n { start % n } else { start }; let end = if end >= n { end % n } else { end }; if start > end { next_dp[0] += dp[j]; } next_dp[start] += dp[j]; next_dp[end] += MOD - dp[j]; } next_dp[0] %= MOD; for j in 0..n-1 { next_dp[j+1] += next_dp[j]; next_dp[j+1] %= MOD; } dp = next_dp; } for &v in dp.iter() { println!("{}", v); } }