#include #include using namespace std; int main(){ string ans[] = {"SUCCESS","FAILURE"}; int n; string before,after; cin >> before >> n >> after; if(count(before.begin(),before.end(),'o') != count(after.begin(),after.end(),'o')) cout << ans[0] << endl; else{ if(n == 0) cout << ans[before == after] << endl; else if(n == 1){ string tmp = before; char c = tmp[0]; tmp[0] = tmp[1]; tmp[1] = c; if(tmp == after){ cout << ans[1] << endl; return 0; } tmp = before; c = tmp[1]; tmp[1] = tmp[2]; tmp[2] = c; if(tmp == after){ cout << ans[1] << endl; return 0; } cout << ans[0] << endl; }else cout << ans[1] << endl; } }