#include #include #include #include using namespace std; int main(){ char s1[10],s2[10];int n;scanf("%s%d%s",s1,&n,s2); int cnt1=0,cnt2=0; int dcnt=0; for(int i=0;i<3;i++){ if(s1[i]=='o')cnt1++; if(s2[i]=='o')cnt2++; if(s1[i]!=s2[i])dcnt++; } if(cnt1!=cnt2)printf("SUCCESS\n"); else if(dcnt==0){ if(n%2==0)printf("FAILURE\n"); else printf("SUCCESS\n"); } else if(dcnt==2){ if(s2[0]!=s2[2]){ if(n%2==0)printf("SUCCESS\n"); else printf("FAILURE\n"); } else{ if(n>1)printf("FAILURE\n"); else printf("SUCCESS\n"); } } //printf("%d\n",ans); return 0; }