#include <bits/stdc++.h>
using namespace std;
int f[100], g[100], n, a[100];
long long fib[100], Num;
long long get() {
  int f = 0;
  long long v = 0;
  char ch;
  while (!isdigit(ch = getchar()))
    if (ch == '-') break;
  if (ch == '-')
    f = 1;
  else
    v = ch - 48;
  while (isdigit(ch = getchar())) v = v * 10 + ch - 48;
  if (f == 1)
    return -v;
  else
    return v;
}
int main() {
  int T = get();
  fib[1] = 1, fib[2] = 2;
  for (int i = 3; i <= 88; i++) fib[i] = fib[i - 1] + fib[i - 2];
  while (T--) {
    Num = get();
    n = 0;
    for (int i = 88; i >= 1; i--)
      if (fib[i] <= Num) a[++n] = i, Num -= fib[i];
    sort(a + 1, a + 1 + n);
    f[0] = 1, g[0] = 0;
    for (int i = 1; i <= n; i++) {
      if ((a[i] - a[i - 1] - 1) % 2 == 0)
        f[i] = f[i - 1] * ((a[i] - a[i - 1] + 1) / 2);
      else
        f[i] = f[i - 1] * ((a[i] - a[i - 1] + 1) / 2) + g[i - 1];
      g[i] = f[i] - f[i - 1];
    }
    printf("%d\n", f[n]);
  }
  return 0;
}
