#include #include #include #include void fail() { std::cout << "FAILURE" << std::endl; std::exit(0); } void succ() { std::cout << "SUCCESS" << std::endl; std::exit(0); } void solve() { std::string s, t; int n; std::cin >> s >> n >> t; if ((std::count(s.begin(), s.end(), 'o') != std::count(t.begin(), t.end(), 'o')) || (n == 0 && s != t)) succ(); if (n != 1) fail(); for (int i = 0; i < 2; ++i) { std::swap(s[i], s[i + 1]); if (s == t) fail(); std::swap(s[i], s[i + 1]); } succ(); } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }