#include <bits/stdc++.h>
using namespace std;
#define int long long
int a,b,p[20],k[20];
signed main(){
while(~scanf("%lld%lld",&a,&b)){
int cnt=0,f=b;
bool flag=1;
for(int i=2;i*i<=b;i++)
if(!(b%i)){
p[++cnt]=i;
while(!(b%i))
b/=i,k[cnt]++;
}
if(b>1)
p[++cnt]=b,
k[cnt]=1;
for(int i=1;i<=cnt;i++){
int ff=a;
while(k[i]>0&&ff>0)
ff/=p[i],
k[i]-=ff;
if(k[i]>0){
flag=0;
break;
}
}
if(flag)
printf("%lld divides %lld!\n",f,a);
else
printf("%lld does not divide %lld!\n",f,a);
}
return 0;
}