#include <iostream>
using namespace std;
long arr[101] = { 0, 1, 1 };
long solution(int n)
{
if (n <= 0) return 0;
else if (n == 1) return 1;
else if (arr[n]) return arr[n];
else return arr[n] = solution(n - 2) + solution(n - 3);
}
int main(void)
{
int T, N;
cin >> T;
for (int i = 0; i < T; i++)
{
cin >> N;
cout << solution(N) << "\n";
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmxvbmcgYXJyWzEwMV0gPSB7IDAsIDEsIDEgfTsKCmxvbmcgc29sdXRpb24oaW50IG4pCnsKCWlmIChuIDw9IDApIHJldHVybiAwOwoJZWxzZSBpZiAobiA9PSAxKSByZXR1cm4gMTsKCWVsc2UgaWYgKGFycltuXSkgcmV0dXJuIGFycltuXTsKCWVsc2UgcmV0dXJuIGFycltuXSA9IHNvbHV0aW9uKG4gLSAyKSArIHNvbHV0aW9uKG4gLSAzKTsKfQoKaW50IG1haW4odm9pZCkKewoJaW50IFQsIE47CgljaW4gPj4gVDsKCglmb3IgKGludCBpID0gMDsgaSA8IFQ7IGkrKykKCXsKCQljaW4gPj4gTjsKCQljb3V0IDw8IHNvbHV0aW9uKE4pIDw8ICJcbiI7Cgl9CglyZXR1cm4gMDsKfQ==