s="x mod %d\n";b;main(c,v){for(;~scanf(s,&c);printf(v?"%dand x\n":s,c-v))for(v=0,b=64;b;b/=2)v|=b==c;}