#include using namespace std; int main(){ string before, after, result; int n; cin >> before >> n >> after; int bo = 0, ao = 0, ax = 0, bx = 0; for(int i = 0; i < 3; i++){ if(before[i] == 'o') bo++; else bx++; if(after[i] == 'o') ao++; else ax++; } if(bo+ao == 6 || bx+ax == 6){ cout << "FAILURE"; }else if(before == after){ if(n != 1) result = "FAILURE"; else result = "SUCCESS"; }else if(bo == ao && bx == ax){ string s; if(bo == 1){ s = "o"; }else if(bx == 1){ s = "x"; } int bef = before.find(s); int aft = after.find(s); int diff = abs(bef-aft); if((diff == 0 && n == 1) || (diff == 1 && n == 0)){ result = "SUCCESS"; }else{ result = "FAILURE"; } }else{ result = "SUCCESS"; } cout << result << endl; return 0; }