Problem: Fibonacci numbers have the following form:

F1 = 1,  F2 = 2,  Fi = Fi - 1 + Fi - 2, i > 2.

Let's consider some non-empty set S = {s1, s2, ..., sk}, consisting of different Fibonacci numbers. Let's find the sum of values of this set's elements:

<image>

Let's call the set S a number n's decomposition into Fibonacci sum. 

It's easy to see that several numbers have several decompositions into Fibonacci sum. For example, for 13 we have 13, 5 + 8, 2 + 3 + 8 — three decompositions, and for 16: 3 + 13, 1 + 2 + 13, 3 + 5 + 8, 1 + 2 + 5 + 8 — four decompositions.

By the given number n determine the number of its possible different decompositions into Fibonacci sum.

Input

The first line contains an integer t — the number of tests (1 ≤ t ≤ 105). Each of the following t lines contains one test.

Each test is an integer n (1 ≤ n ≤ 1018).

Please do not use the %lld specificator to read or write 64-bit integers in C++. It is preferred to use the cin, cout streams or the %I64d specificator.

Output

For each input data test print a single number on a single line — the answer to the problem.

Examples

Input

2
13
16


Output

3
4

Note

Two decompositions are different if there exists a number that is contained in the first decomposition, but is not contained in the second one. Decompositions that differ only in the order of summands are considered equal.

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.Locale;
import java.util.Queue;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.Map.Entry;

public class Solution implements Runnable {

	public static void main(String[] args) {
		(new Thread(new Solution())).start();
	}

	BufferedReader in;
	PrintWriter out;
	StringTokenizer st;

	String nextToken() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			String r = in.readLine();
			if (r == null) return null;
			st = new StringTokenizer(r);
		}
		return st.nextToken();
	}

	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}
	
	void solve1() throws Exception {
		long t1 = nextInt();
		long t2 = nextInt();
		long x1 = nextInt();
		long x2 = nextInt();
		long t0 = nextInt();
		if (t1 == t0) {
			out.println(x1 + " " + 0);
		} else {
			if (t2 == t0) out.println(0 + " " + x2); else {
				long ay1 = -1, ay2 = -1;
				long tch = -1, tzn = -1;
				long zn = t2 - t0;
				for (long y1 = 0; y1 <= x1; y1++) {
					long ch = (t0 - t1) * y1;
					long y2 = (ch / zn);
					if (ch % zn != 0) y2++;
					if (y2 > x2) continue;
					if (y1 + y2 == 0) continue;
					long qch = ((long)t1 * y1 + (long)t2 * y2);
					long qzn = (y1 + y2);
					if (tch == -1) {
						ay1 = y1; ay2 = y2; tch = qch; tzn = qzn;
					} else {
						if (qch * tzn < tch * qzn || (qch * tzn == tch * qzn && y1 + y2 > ay1 + ay2)) {
							ay1 = y1; ay2 = y2; tch = qch; tzn = qzn;
						}
					}
				}
				out.println(ay1 + " " + ay2);
			}
		}
	}
	
	long[] fu(int[] a, int al) {
		long[] res = new long[2];
		int q = al - 1;
		while (q > 0 && a[q] == 0) q--;
		if (q == 0) {
			res[0] = 1;
			res[1] = (al + 1) / 2 - 1;
			return res;
		}
		long[] x = fu(a, q);
		res[0] = x[0] + x[1];
		res[1] = ((al - q + 1) / 2 - 1) * x[0] + ((al - q + 2) / 2 - 1) * x[1];
		return res;
	}
	
	void solve() throws Exception {
		long[] fib = new long[100];
		fib[0] = 1;
		fib[1] = 1;
		for (int i = 2; i < 100; i++) fib[i] = fib[i - 1] + fib[i - 2];
		int fl = 91;
		int t = nextInt();
		for (int i = 0; i < t; i++) {
			long n = nextLong();
			int[] a = new int[92];
			for (int j = fl; j > 0; j--) {
				if (n >= fib[j]) {
					a[j] = 1;
					n -= fib[j];
				}
			}
			int al = 91;
			while (a[al] == 0) al--;
			long[] ans = fu(a, al);
			out.println(ans[0] + ans[1]);
		}
	}

	public void run() {
		Locale.setDefault(Locale.UK);
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
//			in = new BufferedReader(new FileReader("input.txt"));
//			out = new PrintWriter("output.txt");
			solve();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		} finally {
			out.flush();
		}
	}

}