#include #include #include using namespace std; using ll = long long; int main() { string s, t; int n; cin >> s >> n >> t; if (s == t)cout << "FAILURE" << endl; else if (n == 0) cout << "SUCCESS" << endl; else { int a = 0, b = 0; for (auto c:s) { if (c == 'o')a++; } for (auto c:t) { if (c == 'o')b++; } if (a != b) cout << "SUCCESS" << endl; else if (n == 1 && s[1] == t[1] && ((s[0] != t[0]) == (s[2] != t[2]))) cout << "SUCCESS" << endl; else cout << "FAILURE" << endl; } return 0; }