use std::io::{BufRead, BufWriter, Write, StdinLock, StdoutLock}; fn input(stdin: &mut StdinLock) -> String { let mut input = String::new(); stdin.read_line(&mut input).ok(); input } macro_rules! read { ($stdin:expr, [$t:tt; $n:expr]) => { (0..$n).map(|_| read!($stdin, $t)).collect::>() }; ($stdin:expr, [$t:tt]) => { input($stdin) .split_whitespace() .map(|x| parse!(x, $t)) .collect::>() }; ($stdin:expr, ($($t:tt),*)) => { { let input = input($stdin); let mut iter = input.split_whitespace(); ( $( parse!(iter.next().unwrap(), $t) ),* ) } }; ($stdin:expr, $t:tt) => { parse!(input($stdin).trim(), $t) }; } macro_rules! parse { ($s:expr, chars) => { $s.chars().collect::>() }; ($s:expr, usize1) => { parse!($s, usize) - 1 }; ($s:expr, $t:ty) => { $s.parse::<$t>().unwrap() } } trait ProconWrite { fn writeln(&mut self, x: T); fn writeln_iter(&mut self, iter: I) where I::Item: std::fmt::Display { self.writeln( iter.map(|x| x.to_string()).collect::>().join(" ") ); } } impl ProconWrite for BufWriter> { fn writeln(&mut self, x: T) { writeln!(self, "{}", x).ok(); } } fn solve(stdin: &mut StdinLock, writer: &mut BufWriter) { let d = read!(stdin, usize); writer.writeln( std::iter::once('9').chain( std::iter::once('0') .cycle() .take(d - 1) ).collect::() ); } fn main() { let stdin = std::io::stdin(); let mut stdin = stdin.lock(); let stdout = std::io::stdout(); let mut writer = BufWriter::new(stdout.lock()); let t = read!(&mut stdin, usize); for _ in 0..t { solve(&mut stdin, &mut writer); } }