#include #include using namespace std; int p(string s){ int w; if (s == "ooo") w = 1; else if(s == "xxx") w = -1; else if(s == "oox") w = 2; else if(s == "oxo") w = 3; else if(s == "xoo") w = 4; else if(s == "xxo") w = -2; else if(s == "xox") w = -3; else w = -4; return(w); } int q(int b, int a){ int x; if (b * a < 0) return (-1); if (b * a == 1) return 0; x = b - a; if (x < 0) x = x * (-1); return(x); } int main(){ string b,a; int N; cin >> b >> N >> a; int i = q(p(b), p(a)); if (i != 0 && N % i != 0) i = -1; if (i < 0) cout << "SUCCESS\n"; else cout << "FAILURE\n"; cin >> i; }