fn main() { let t = getline().parse::().unwrap(); for _ in 0..t { let n = getline().parse::().unwrap(); let mut f: u64 = 1; while f < n + 1 { f *= 10; } let m = f - (n + 1); // 2 + 7 | 27 // 10 + 89 | 1089 println!("{}", m); } } fn getline() -> String { let mut __ret = String::new(); std::io::stdin().read_line(&mut __ret).ok(); __ret.trim().to_string() }