#include <iostream>
using namespace std;
int main() {
int c;
cin >> c;
if (c == 1) {
long long cap,pic;
cin >> cap >> pic;
long long vacute = (pic - (2 * cap)) / 2;
long long gaini = cap - vacute;
cout << gaini <<" "<<vacute;
}
else {
int c , p, d;
int nrp = 0, nrimp = 0;
cin >> c >> p;
for ( d = 1; d * d < c; d++) {
if (c % d == 0) {
if ( d % 2 == 1)
nrimp++;
if ((c / d ) % 2 == 1 )
nrimp++;
}
}
if (d * d == c && d % 2 == 1)
nrimp++;
for ( d = 1; d * d < p; d++) {
if (p % d == 0) {
if ( d % 2 == 0)
nrp++;
if ((p / d ) % 2 == 0 )
nrp++;
}
}
if (d * d == p && d % 2 == 0)
nrp++;
cout << nrimp <<" " <<nrp;
}
return 0;
}