#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { cin.tie(nullptr)->sync_with_stdio(false); string s, t; int n; cin >> s >> n >> t; int cnts = 0, cntt = 0; for (char c : s) cnts += (c == 'o'); for (char c : t) cntt += (c == 'o'); if (cnts != cntt) { cout << "SUCCESS" << '\n'; } else if (n == 0 && s != t) { cout << "SUCCESS" << '\n'; } else if (n == 1) { bool ok = true; swap(s[0], s[1]); if (s == t) ok = false; swap(s[0], s[1]); swap(s[1], s[2]); if (s == t) ok = false; swap(s[1], s[2]); cout << (ok ? "SUCCESS" : "FAILURE") << '\n'; } else { cout << "FAILURE" << '\n'; } return 0; }