#include "bits/stdc++.h"
#define up(i,a,b) for (int i = (int)a; i <= (int)b; i++)
using namespace std;

string addBig(string a, string b){
    string res = "";
    while (a.size() < b.size()) a = "0" + a;
    while (b.size() < a.size()) b = "0" + b;
    int cr = 0;
    for (int i = a.size()-1; i >= 0; i--){
        int t = a[i] + b[i] - 48*2 + cr;
        cr = t/10;
        t = t % 10;
        res = (char)(t+48) + res;
    }
    if (cr) res = '1' + res;
    return res;
}

string mulBig(string a, string b){
    string res = "";
    int n = a.size();
    int m = b.size();
    int len = n + m - 1;
    int cr = 0;
    for (int i = len; i >= 0; i--){
        int t = 0;
        for (int j = n-1; j >= 0; j--){
            if (i-j <= m && i-j >= 1){
                int a1 = a[j] - 48;
                int b1 = b[i-j-1] - 48;
                t += a1*b1;
            }
        }
        t += cr;
        cr = t/10;
        res = (char)(t % 10 + 48) + res;
    }
    while (res.size() > 1 && res[0] == '0') res.erase(0,1);
    return res;
}

long long n,M;
struct Matrix{
    string c[2][2];
    Matrix(){
        c[0][0] = "1";        c[0][1] = "1";

        c[1][0] = "1";        c[1][1] = "0";
    }
    ~Matrix(){};
}; Matrix A;

Matrix nhan(Matrix a, Matrix b){
    Matrix res;
    for (int i = 0; i <= 1; i++){
        for (int j = 0; j <= 1; j++){
            res.c[i][j] = "0";
            for (int k = 0; k <= 1; k++){
                res.c[i][j] = addBig(res.c[i][j], mulBig(a.c[i][k], b.c[k][j]));
            }
        }
    }
    return res;
}

Matrix Fpow(Matrix& A, int n){
    Matrix res;
    up(i,0,1) up(j,0,1) res.c[i][j] = "0";
    up(i,0,1) res.c[i][i] = "1";
    for (; n; n >>= 1, A = nhan(A, A)){
        if (n & 1) res = nhan(res, A);
    }
    return res;
}

string a,b;
#define Task "A"
signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    if (fopen(Task".inp", "r")){
        freopen(Task".inp", "r", stdin);
        freopen(Task".out", "w", stdout);
    }

    int tt;
    cin >> tt;
    while (tt--){
        int n;
        cin >> n;
        Matrix A;
        A = Fpow(A, n);
        cout << A.c[0][0] << "\n";
    }
}