#include #include #include #include #include #include #include #include #include #include #include using ll = long long; using namespace std; int main(){ string a, b, f = "FAILURE", s = "SUCCESS"; int n, an = 0, bn = 0; cin >> b >> n >> a; bool yes = false; for (int i = 0; i < 3; i++){ if (b[i] == 'o') bn++; if (a[i] == 'o') an++; } if (an != bn) cout << s << endl; else if (n >= 2) cout << f << endl; else { if (bn == 1){ if (b[0] == 'o' && a[2] == 'o') cout << s << endl; else if (b[2] == 'o' && a[0] == 'o') cout << s << endl; else if (b[1] == 'o' && a[1] == 'x') cout << s << endl; } else if (bn == 2){ if (b[0] == 'x' && a[2] == 'x') cout << s << endl; else if (b[2] == 'x' && a[0] == 'x') cout << s << endl; else if (b[1] == 'x' && a[1] == 'o') cout << s << endl; } else cout << f << endl; } }