// Arup Guha
// 2/10/2017
// Solution to 2017 FHSPS Problem: Just in case

import java.util.*;

public class just {

	final public static long MOD = 1000000007L;
	final public static int MAX = 100;

	public static int numD;
	public static ArrayList<Long> divisors;
	public static ArrayList[] divOfDivList;

	public static HashMap<Long,Integer> map;
	public static long[][] combo;
	public static long[][] memo;

	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++;

		Scanner stdin = new Scanner(System.in);
		int numCases = stdin.nextInt();

		// Process each case.
		for (int loop=0; loop<numCases; loop++) {

			long n = stdin.nextLong();

			// Not speeding this up because the actual problem solving takes longer =)
			divisors = new ArrayList<Long>();
			for (long i=1; i*i<=n; i++) {
				if (n%i == 0) {
					divisors.add(i);
					if (n/i != i) divisors.add(n/i);
				}
			}
			Collections.sort(divisors);
			numD = divisors.size();
			divOfDivList = new ArrayList[numD];
			for (int i=0; i<numD; i++)
				divOfDivList[i] = new ArrayList<Long>();
			for (int i=0; i<numD; i++) {
				for (int j=0; j<=i; j++) {
					if (divisors.get(i)%divisors.get(j) == 0)
						divOfDivList[i].add(divisors.get(j));
				}
			}

			map = new HashMap<Long,Integer>();
			for (int i=0; i<numD; i++)
				map.put(divisors.get(i), i);

			memo = new long[numD][numPrimes+1];
			for (int i=0; i<numD; i++)
				Arrays.fill(memo[i], -1);

			// Print out the result.
			System.out.println(go(n, numPrimes));
		}
	}

	public static long go(long n, int primesLeft) {

		int mapNum = map.get(n);
		// Speed Up.
		if (memo[mapNum][primesLeft] != -1) {
			//System.out.println("trigger");
			return memo[mapNum][primesLeft];
		}

		// Nothing more to fill in.
		if (n == 1) return 1;

		// No viable solution here.
		if (primesLeft == 1) return 1;

		long res = 0;

		// Try each valid divisor from here.
		for (int i=0; i<divOfDivList[mapNum].size(); i++) {

			// For ease of use.
			long div = (Long)divOfDivList[mapNum].get(i);

			// Can't use this one.
			if (n%div != 0) continue;

			res = (res + go(n/div, primesLeft-1))%MOD;
		}

		// Finally, we multiply all the old ways by all the new ways to get our answer.
		memo[mapNum][primesLeft] = res;
		return res;
	}
}
