#include
#include
using namespace std;
int countStrings(int n)
{
int a[n], b[n];
a[0] = b[0] = 1;
for (int i = 1; i < n; i++)
{
a[i] = a[i-1] + b[i-1];
b[i] = a[i-1Q];
}
return a[n-1] + b[n-1];
}
int fib(int n){
int f = 0;
int s = 1;
int i=2;
int r;
while(i<=n+2){
r = f;
f = s;
s = r+s;
i++;
}
return s;
}
int main()
{
// cout<<fib(3);
int t;
cin>>t;
while(t–){
int n;
cin>>n;
if(n==0 or n==1){
cout<<n<<endl;
}
else
cout<<countStrings(n)<<endl;
}
return 0;
}