class AvatorHeight def initialize @m = 998244353 @rt = Array.new(200001, 0) @et = Array.new(200001, 0) @rt[1] = 1 @rt[2] = 1 @et[1] = 1 @et[2] = 3 (3 .. 200000).each do |i| @rt[i] = (@rt[i - 1] + @rt[i - 2]) % @m @et[i] = (@et[i - 1] + @et[i - 2]) % @m end end def solve(n) (5 * @rt[n] * @rt[n] - @et[n] * @et[n]) % @m end end q = gets.chomp.to_i ah = AvatorHeight.new q.times do n = gets.chomp.to_i puts ah.solve(n) end