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; continue; } c[i - 1] = '1'; a += i } println!( "{}", if a == b { c.iter().collect::() } else { "-1".to_owned() } ); } 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) }