#include #include int main(void) { char before[4], after[4]; char tmp; int i, n, count = 0; scanf("%s", before); scanf("%d", &n); scanf("%s", after); for(i = 0; i < 3; i++){ if(before[i] == 'o') count++; if(after[i] == 'o') count--; } if(n == 0){ if(strcmp(before, after) == 0) printf("FAILURE"); else printf("SUCCESS"); } else if(n == 1){ if(count != 0) printf("SUCCESS"); else{ tmp = after[2]; after[2] = after[0]; after[0] = tmp; if(strcmp(before, after) == 0){ if(after[0] == after[2]) printf("FAILURE"); else printf("SUCCESS"); } else printf("FAILURE"); } } else if(n >= 2){ if(count != 0) printf("SUCCESS"); else printf("FAILURE"); } printf("\n"); return 0; }