use std::io::Read; fn a(n: usize) { let mut c = vec!['0'; n]; let (mut a, mut b) = (0, 0); for i in (1..=n).rev() { if a > b { b += i } else { c[i - 1] = '1'; a += i } } let s: String = c.iter().collect(); println!("{}", if a == b { &s } else { "-1" }) } fn main() { let mut s = String::new(); std::io::stdin().read_to_string(&mut s).ok(); s.lines().skip(1).flat_map(str::parse).for_each(a) }