fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let n: usize = n.trim().parse().unwrap(); let mut cnts = String::new(); std::io::stdin().read_line(&mut cnts).ok(); let cnts: Vec = cnts.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let result = (0..9).rev().map(|i| (i+1).to_string().repeat(cnts[i])).collect::>().join(""); println!("{}", result); }