fn main() { let mut buf = String::new(); let mut input = { use std::io::Read; std::io::stdin().read_to_string(&mut buf).unwrap(); buf.split_whitespace() }; const MOD: usize = 998244353; let t: usize = input.next().unwrap().parse().unwrap(); let ns: Vec = (0..t) .map(|_| input.next().unwrap().parse().unwrap()) .collect(); let n_max = ns.iter().fold(1, |acc, &n| if n > acc { n } else { acc }); let mut w = vec![]; for k in 0..=n_max { match k { 0 => w.push(0), 1 => w.push(2), 2 => w.push(6), _ => w.push((w[k - 1] * 2 + w[k - 1]) % MOD), } } for n in ns.into_iter() { println!("{}", w[n]); } }