const n = require("fs").readFileSync(0,"utf8").toString().trim().split('\n');
let i=0;
while(true) {
    let [a, b] = n[i++].split(' ').map(Number);
    if(a==0 && b==0) break;
    console.log((b%a==0) ? "factor" : (a%b==0) ? "multiple" : "neither");
}