#include using namespace std; int main(){ string s1,s2; int n; cin >> s1 >> n >> s2; int x = 0, y = 0; for(int i = 0; i < 3; i++){ if(s1[i] == 'o') x++; if(s2[i] == 'o') y++; } if(x != y){ cout << "SUCCESS" << endl; return 0; } if(n == 0 and s1 != s2) cout << "SUCCESS" << endl; else if(n == 1){ if(s1[0] == s2[1] and s1[1] == s2[0] and s1[2] == s1[2]) cout << "FAILURE" << endl; else if(s1[0] == s2[0] and s1[1] == s2[2] and s1[2] == s2[1]) cout << "FAILURE" << endl; else cout << "SUCCESS" << endl; }else cout << "FAILURE" << endl; return 0; }