#include using namespace std; int main(void) { int n, i,marua=0,marub=0,batu=0; char sa[3], sb[3]; cin >> sa >> n >> sb; for (i = 0; i < 3; i++) { if (sa[i] == 'o')marua++; if (sb[i] == 'o')marub++; } if (marua != marub) { cout << "SUCCESS" << endl; return 0; } if (n > 1||marua==3||marub==0) { cout << "FAILURE" << endl; } else { if (n == 0 && sa[0] == sb[0] && sa[1] == sb[1])//n0で一緒 cout << "FAILURE" << endl; else if ((n == 1 && sa[0] == sa[2] && sa[1] != sb[1]) || (n == 1 && sa[1] == sa[2] && sa[0] == sb[1]))//n1であり得る組み合わせ cout << "FAILURE" << endl; else cout << "SUCCESS" << endl; } return 0; }