fn main() { let t = read::(); let mut cand_count = vec![vec![0i64; 33]; 33]; for cand in 2..33 { let mut c = cand; for i in 2..33 { while c % i == 0 { cand_count[cand][i as usize] += 1; c /= i; } } } for _ in 0..t { let x = read::(); let mut count = vec![0i64; 33]; let mut c = x; for i in 2..33 { while c % i == 0 { count[i as usize] += 1; c /= i; } } let p = count.iter().map(|&x| x + 1).product::(); for cand in 2..33 { let q = count .iter() .zip(cand_count[cand].iter()) .map(|(&x, &y)| x + y + 1) .product::(); if q == p * 2 { println!("{}", cand as i64 * x); break; } } } } fn read() -> T { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim().parse().ok().unwrap() }