#include<stdio.h>
int main()
{
int n;
scanf("%d",&n);
while (n--)
{
int len;
scanf("%d",&len);
int a[41], i;
a[2] = 3;
a[3] = 5;
for (i = 4; i <= len; i++)
a[i] = a[i-1] + a[i-2];
printf("%d\n",a[len]);
}
return 0;
}