// Arup Guha
// 2/10/2017
// Solution to 2017 FHSPS Problem: Counting Factors

import java.util.*;

public class counting {

	final public static long MOD = 1000000007L;
	final public static int MAX = 100;

	public static int numD;
	public static ArrayList<Integer> divisors;
	public static long[][] combo;

	public static void main(String[] args) {

		// Run prime sieve to given limit.
		boolean[] sieve = new boolean[MAX+1];
		Arrays.fill(sieve, true);
		sieve[0] = sieve[1] = false;
		for (int i=2; i<=MAX; i++)
			for (int j=2*i; j<=MAX; j+=i)
				sieve[j] = false;

		// Count up the number of primes.
		int numPrimes = 0;
		for (int i=2; i<=MAX; i++)
			if (sieve[i])
				numPrimes++;

		// Set up Pascal's Triangle.
		combo = new long[numPrimes+1][numPrimes+1];
		for (int i=0; i<=numPrimes; i++) {
			combo[i][0] = 1;
			combo[i][i] = 1;
		}

		// Now fill in Pascal's Triangle.
		for (int i=2; i<=numPrimes; i++)
			for (int j=1; j<i; j++)
				combo[i][j] = (combo[i-1][j-1] + combo[i-1][j])%MOD;

		Scanner stdin = new Scanner(System.in);
		int numCases = stdin.nextInt();

		// Process each case.
		for (int loop=0; loop<numCases; loop++) {

			int n = stdin.nextInt();

			// Not speeding this up because the actual problem solving takes longer =)
			divisors = new ArrayList<Integer>();
			for (int i=2; i<=n; i++)
				if (n%i == 0)
					divisors.add(i);
			numD = divisors.size();

			// Print out the result.
			System.out.println(go(n, 1, numPrimes));
		}
	}

	public static long go(int n, int lastExp, int primesLeft) {

		// Nothing more to fill in.
		if (n == 1) return 1;

		// No viable solution here.
		if (lastExp >= n) return 0;

		long res = 0;

		// Try each valid divisor from here.
		for (int i=0; i<numD; i++) {

			// For ease of use.
			int div = divisors.get(i);

			// These MUST go in order...
			if (div <= lastExp) continue;

			// Can't use this one.
			if (n%div != 0) continue;

			int tempn = n/div;
			for (int j=1;; j++) {
				res = (res + combo[primesLeft][j]*go(tempn, div, primesLeft-j))%MOD;
				if (tempn%div != 0) break;
				tempn /= div;
			}
		}

		// Finally, we multiply all the old ways by all the new ways to get our answer.
		return res;
	}
}