#include <iostream>
using namespace std;
int main(void)
{
int n1, n2;
while (1)
{
cin >> n1 >> n2;
if (n1 == 0 && n2 == 0)
break;
else if (n2 % n1 == 0)
cout << "factor" << endl;
else if (n1 % n2 == 0)
cout << "multiple" << endl;
else
cout << "neither" << endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKHZvaWQpCnsKCWludCBuMSwgbjI7CgoJd2hpbGUgKDEpCgl7CgkJY2luID4+IG4xID4+IG4yOwoJCWlmIChuMSA9PSAwICYmIG4yID09IDApCgkJCWJyZWFrOwoJCWVsc2UgaWYgKG4yICUgbjEgPT0gMCkKCQkJY291dCA8PCAiZmFjdG9yIiA8PCBlbmRsOwoJCWVsc2UgaWYgKG4xICUgbjIgPT0gMCkKCQkJY291dCA8PCAibXVsdGlwbGUiIDw8IGVuZGw7CgkJZWxzZQoJCQljb3V0IDw8ICJuZWl0aGVyIiA8PCBlbmRsOwoJfQoJcmV0dXJuIDA7Cn0=