#include #include #include using namespace std; int main(void){ string b, a; int n; cin >> b >> n >> a; if (count(b.begin(), b.end(), 'o') != count(a.begin(), a.end(), 'o')){ cout << "SUCCESS" << endl; } else if (n == 0){ cout << ((b == a) ? "FAILURE" : "SUCCESS") << endl; } else if (n == 1){ string d, e, f; d = b[0], e = b[1], f = b[2]; cout << ((a == d + e + f || a == e + d + f || a == d + f + e) ? "FAILURE" : "SUCCESS") << endl; } else cout << "FAILURE" << endl; return 0; }