b,n,a=$<.read.split puts b.count(?o)!=a.count(?o)||n==?1&&(a+b).count(?o)%6>0&&b.reverse==a||n==?0&&a!=b ?:SUCCESS:'FAILURE'