#include using namespace std; int main() { string S, T; int N; cin >> S >> N >> T; if (count(S.begin(), S.end(), 'o') != count(T.begin(), T.end(), 'o')) cout << "SUCCESS"; else if (N == 0) cout << ((S != T) ? "SUCCESS" : "FAILURE"); else if (N > 1) cout << "FAILURE"; else { string s = S; swap(S.at(0), S.at(1)), swap(s.at(1), s.at(2)); cout << ((S == T || s == T) ? "FAILURE" : "SUCCESS") << "\n"; } cout << "\n"; }