fn main() { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let n = s.trim().parse::().unwrap() - 1; let mut d = vec![]; (1..9).for_each(|a| (a + 1..=9).for_each(|b| d.push(10 * a + b))); let a = d[n % d.len()]; println!("{}{}", a, (a % 10).to_string().repeat(n / d.len())) }