#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); string S,T; int N; cin >> S >> N >> T; auto c = [](string X) { int res = 0; for(char x : X) if(x == 'o') res++; return res; }; if(c(S) != c(T)) { cout << "SUCCESS" << endl; } else if(N == 0) { cout << (S == T ? "FAILURE" : "SUCCESS") << endl; } else if(N == 1) { int ex = 0; swap(S[0], S[1]); ex |= S == T; swap(S[0], S[1]); swap(S[1], S[2]); ex |= S == T; swap(S[1], S[2]); cout << (ex ? "FAILURE" : "SUCCESS") << endl; } else { cout << "FAILURE" << endl; } }