#include<bits/stdc++.h>
#define int long long
using namespace std;
inline int read(){
int x=0,f=1;char c=getchar();
for(;(c<'0'||c>'9');c=getchar()){if(c=='-')f=-1;}
for(;(c>='0'&&c<='9');c=getchar())x=x*10+(c&15);
return x*f;
}
const int MN=1005;
const int mod=998244353;
int f[MN][MN],n,ans[MN];
signed main(void){
freopen("card.in","r",stdin);
freopen("card.out","w",stdout);
int N=1000;f[0][0]=1;
for(int i=2;i<=N;i++){
for(int j=1;j+j<=i;j++)f[i][j]=(f[i-2][j-1]+f[i-j][j])%mod;
}
for(int i=1;i<=N;i++){
for(int j=1;j+j<=i;j++)ans[i]+=f[i][j],ans[i]%=mod;
}
int tt=read();
while(tt--){
int n=read();
cout<<ans[n]<<'\n';
}
return 0;
}