//{{{ #[allow(unused_macros)] macro_rules! getl { ( $( $t:ty ),* ) => { { let mut s = String::new(); std::io::stdin().read_line(&mut s).unwrap(); let s = s.trim_right(); let mut ws = s.split_whitespace(); ($(ws.next().unwrap().parse::<$t>().unwrap()),*) } }; } #[allow(unused_macros)] macro_rules! getl_vec { ( $t:ty ) => {{ let mut s = String::new(); std::io::stdin().read_line(&mut s).unwrap(); let s = s.trim_right(); s.split_whitespace() .map(|x| x.parse().unwrap()) .collect::>() }}; } //}}} fn main() { let n = getl!(usize); let mut p = vec![]; for _ in 0..n { p.push(getl!(i64)); } for p in p { if p == 2 { println!("2"); } else { println!("{}", (p - 1) * (p - 1)); } } }