https://www.acmicpc.net/problem/5086
#include <iostream>
using namespace std;
int main() {
for(;;){
int a,b;
cin>>a>>b;
if(a==0&&b==0) break;
if(a>=b&&a%b==0) cout<<"multiple"<<"\n";
else if(b>=a&&b%a==0) cout<<"factor"<<"\n";
else cout<<"neither"<<"\n";
}
}