#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
using namespace std;
const int MOD = 9973;
const int MAXN = 1e6 + 5;
int t;
long long n, card, sum;
vector<pair <long long, int> > putPrim;
vector<int> numPrim;
bool prim[MAXN];
void calcPrim() {
for (int i = 1; i < MAXN; ++i)
prim[i] = true;
for (int i = 2; i < MAXN; ++i) {
if (prim[i]) {
for (int j = i + i; j < MAXN; j += i)
prim[j] = false;
}
}
for (int i = 2; i < MAXN; ++i)
if (prim[i])
numPrim.push_back(i);
}
void factPrim(long long x) {
for (int i : numPrim) {
if (x % i == 0) {
int putere = 0;
while (x % i == 0) {
x /= i;
++putere;
}
putPrim.push_back({i, putere});
}
}
}
void calcDiv(long long x) {
factPrim(x);
for (auto& pereche : putPrim) {
card *= (pereche.second + 1);
sum = (sum * (((long long)pow(pereche.first, pereche.second + 1) - 1) / (pereche.first - 1)) % MOD) % MOD;
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
freopen("ssnd.in", "r", stdin);
freopen("ssnd.out", "w", stdout);
cin >> t;
calcPrim();
while (t--) {
cin >> n;
card = 1, sum = 1;
putPrim.clear();
calcDiv(n);
cout << card << " " << sum << "\n";
}
return 0;
}