#include #include #include #include #include #include #include #include #include #define REP(i,n) for(int i=0;i<(n);i++) using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); string bef, aft; int N; cin >> bef >> N >> aft; bool succ = false; if (count(bef.begin(), bef.end(), 'o') != count(aft.begin(), aft.end(), 'o')) { succ = true; } else if (N >= 2) { succ = false; } else if (N == 0) { succ = bef != aft; } else { string b1 = bef, b2 = bef; swap(b1[0], b1[1]); swap(b2[1], b2[2]); succ = b1 != aft && b2 != aft; } if (succ) cout << "SUCCESS" << endl; else cout << "FAILURE\n"; return 0; }