fn main() { let mut s: String = read(); const MOD: usize = 1_000_000_007; let mut cum: Vec = Vec::new(); let mut n: usize = 0; for i in 0..10 { n += i; cum.push(n); } let c: usize = cum[9]; let len = s.len(); let mut sv: Vec = vec![0; s.len()]; for i in 0..sv.len() { let x: usize = s.pop().unwrap().to_digit(10u32).unwrap() as usize; sv[len - i - 1] = x; } sv[len - 1] += 1; let mut ans: usize = 0; for i in 1..len { ans = (ans + modpow(c, i, MOD)) % MOD; } let mut w: usize = 1; for i in 0..len { if sv[i] == 0 { break; } ans = (w * (cum[sv[i] - 1]) % MOD * modpow(c, sv.len() - i - 1, MOD) % MOD + ans) % MOD; w = w * sv[i] % MOD; } println!("{}", ans); } fn read() -> T { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim().parse().ok().unwrap() } fn modpow(mut a: usize, mut k: usize, m: usize) -> usize { let mut ret: usize = 1; while k > 0 { if k & 1 == 1 { ret = ret * a % m; } a = a * a % m; k = k >> 1; } ret }