#include<cstdio>
#include<string.h>
int a[1010][1010];
int main(){
int n,r,count,k;
while(scanf("%d",&n) != EOF){
while(n--){
scanf("%d",&r);
memset(a,0,sizeof(a));
a[1][1] = a[2][1] = 1;
k = 1;
for(int i = 3;i<=r;++i){
for(int j = 1;j<=k;++j){
a[i][j] += a[i-2][j] + a[i-1][j] + count;
count = a[i][j]/10;
a[i][j] %= 10;
}
while(count){
a[i][++k] = count%10;
count /= 10;
}
}
for(int i = k;i>=1;--i)
printf("%d",a[r][i]);
printf("\n");
}
}
return 0;
}
#include<string.h>
int a[1010][1010];
int main(){
int n,r,count,k;
while(scanf("%d",&n) != EOF){
while(n--){
scanf("%d",&r);
memset(a,0,sizeof(a));
a[1][1] = a[2][1] = 1;
k = 1;
for(int i = 3;i<=r;++i){
for(int j = 1;j<=k;++j){
a[i][j] += a[i-2][j] + a[i-1][j] + count;
count = a[i][j]/10;
a[i][j] %= 10;
}
while(count){
a[i][++k] = count%10;
count /= 10;
}
}
for(int i = k;i>=1;--i)
printf("%d",a[r][i]);
printf("\n");
}
}
return 0;
}